dpdk程序的命令行参数 --lcores可以设置lcore到CPU processer的多对多映射关系。

这样既可以提供CPU processor的伸缩扩展,同时也保证了EAL thread的运行环境,只需要简单的修改一下配置,基本上不需要做太多的代码调整。

dpdk文档传送门

摘录官网文档的描述:

The term “lcore” refers to an EAL thread, which is really a Linux/FreeBSD pthread. “EAL pthreads” are created and managed by EAL and execute the tasks issued by remote_launch. In each EAL pthread, there is a TLS (Thread Local Storage) called _lcore_id for unique identification. As EAL pthreads usually bind 1:1 to the physical CPU, the _lcore_id is typically equal to the CPU ID.
When using multiple pthreads, however, the binding is no longer always 1:1 between an EAL pthread and a specified physical CPU. The EAL pthread may have affinity to a CPU set, and as such the _lcore_id will not be the same as the CPU ID. For this reason, there is an EAL long option ‘–lcores’ defined to assign the CPU affinity of lcores. For a specified lcore ID or ID group, the option allows setting the CPU set for that EAL pthread.

语法格式:

The format pattern:
–lcores=’<lcore_set>[@cpu_set][,<lcore_set>[@cpu_set],...]’
‘lcore_set’ and ‘cpu_set’ can be a single number, range or a group. A number is a “digit([0-9]+)”; a range is “<number>-<number>”; a group is “(<number|range>[,<number|range>,...])”.

做了一个测试程序 code,效果如下:

[root@D128 dpdk_lcores]# ./build/app/test
EAL: Detected 4 lcore(s)
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
hello from core 1
hello from core 2
hello from core 3
hello from core 0
^C
[root@D128 dpdk_lcores]# ./build/app/test --lcores "(0,1,2,3,4)@(0,1),(5,6,7,8)@3"
EAL: Detected 4 lcore(s)
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
hello from core 1
hello from core 2
hello from core 3
hello from core 4
hello from core 5
hello from core 6
hello from core 7
hello from core 8
hello from core 0

[dpdk] dpdk --lcores参数的更多相关文章

  1. [developmemt][dpdk] dpdk优化(转)

    转发:https://software.intel.com/en-us/articles/dpdk-performance-optimization-guidelines-white-paper 转发 ...

  2. [dpdk] dpdk编译成动态库使用 -- PCI port自动发现与pmd动态加载

    1.  修改配置文件 .conf, 设置如下变量的值. [root@D129 x86_64-native-linuxapp-gcc]# cat dpdk/x86_64-native-linuxapp- ...

  3. [dpdk] dpdk多线程任务调度

    DPDK下的线程,叫做EAL线程. EAL线程默认是与CPU core一对一绑定的,这样的话,有一些实时性,计算量不高的任务独占CORE是一种浪费,大概找了如下几种解决方案. 1. dpdk seri ...

  4. [dpdk] dpdk启动几个线程

    看别人的代码搞得有点晕,突然有点不确定,再确认一次. 使用 helloworld程序测试一下. /root/dpdk-16.07/examples/helloworld 一:  只启动一个核心. [r ...

  5. [development][dpdk] dpdk与CONFIG_RTE_MAX_MEMSEG有关的错误

    dpdk程序无法启动, 错误如下: EAL: Requesting pages of size 2MB EAL: Requesting pages of size 2MB EAL: Can only ...

  6. [dpdk] 熟悉SDK与初步使用 (三)(IP Fragmentation源码分析)

    对例子IP Fragmentation的熟悉,使用,以及源码分析. 功能: 该例子的功能有二: 一: 将IP分片? 二: 根据路由表,做包转发. 路由表如下: IP_FRAG: Socket : ad ...

  7. [dpdk] TSC , HPET, Timer, Event Timer,RDTSCP

    关于dpdk timer跨越CPU core调度的准确性问题 首先dpdk的timer接口里边使用 cpu cycle来比较时间.根据之前的内容 [dpdk] dpdk --lcores参数 当一个E ...

  8. [dev][ipsec][dpdk] strongswan/dpdk源码分析之ipsec算法配置过程

    1 简述 storngswan的配置里用一种固定格式的字符串设置了用于协商的预定义算法.在包协商过程中strongswan将字符串转换为固定的枚举值封在数据包里用于传输. 协商成功之后,这组被协商选中 ...

  9. DPDK 网络加速在 NFV 中的应用

    目录 文章目录 目录 前文列表 传统内核协议栈的数据转发性能瓶颈是什么? DPDK DPDK 基本技术 DPDK 架构 DPDK 核心组件 应用 NUMA 亲和性技术减少跨 NUMA 内存访问 应用 ...

随机推荐

  1. Basic SAP Data Types

    Basic SAP Data Types 6 out of 11 rated this helpful - Rate this topic The parameter types that the M ...

  2. 【iCore4 双核心板_FPGA】例程十:FSMC总线通信实验——复用地址模式

    实验原理: STM32F767上自带FMC控制器,本实验将通过FMC总线的地址复用模式实现STM32与FPGA 之间通信,FPGA内部建立RAM块,FPGA桥接STM32和RAM块,本实验通过FSMC ...

  3. 【emWin】例程十三:字库放到外部存储器

    介绍: 本例将字库文件放到SD卡中,通过读取SD卡中的字库文件在液晶上显示文字.   实验指导书及代码包下载: 链接:http://pan.baidu.com/s/1bo0yTLd 密码:i4sm   ...

  4. Ubuntu 14.04 下搭建SVN服务器 (转载自 http://www.linuxidc.com/Linux/2015-01/111956.htm)-------------我所用到是红色字体

    http://www.linuxidc.com/Linux/2015-01/111956.htm Ubuntu 14.04 下搭建SVN服务器 svn:// 安装软件包: sudo apt-get i ...

  5. python 简单的server请求

    1.代码 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # __author henry # __date 2018/11/4 from wsgiref ...

  6. 多密钥ssh-key生成与管理

    由于 git 大文件用 http 方式难以传输,必须使用 ssh-key,而 ssh-key 又生成了好多个.最近在各种折腾 ssh,公钥私钥上花费了很多时间,现将一些问题总结如下.系统为 Mac/L ...

  7. Apache Nginx URL 地址 重写

    URL重写这东西在工作中用了很多次了,但每次都忘记了要记得把知道的积累下来. 哎,要么认为没必要,要么就是没时间?! 一.Apache 篇 官方地址:http://man.chinaunix.net/ ...

  8. Flv的结构分析

    Flv是网络上流行的非常广的一种媒体格式,很多大型媒体网站都在使用这种格式承载音视频信息,比如优酷等网站. Flv文件格式相对而言还是比较简单的,主要是由两部分组成 FLV header FLV bo ...

  9. MySQL 错误 1366:1366 Incorrect integer value

    错误提示:General error: 1366 Incorrect integer value: '' for column 'pay_type' at row 1 (SQL: INSERT INT ...

  10. linux几个命令

    ll |wc -l 统计目录下多少文件 df -h 磁盘统计大小 du -sh 该目录占磁盘总大小 du -sh * 该目录下每个目录占用磁盘大小