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. python3.6 使用pyinstaller 打包web程序的方法

    官方文档连接 (https://pyinstaller.readthedocs.io/en/stable/ ) 第一步,下载pywin32 首先下载pywin32,下面是下载链接,下载自己的系统版本对 ...

  2. SQL 中的LastIndexOf,截取最后一次出现字符后面的字符(转)

    SQL如何取出一个字符串中最后一个特殊字符右边的字符,例如:10*20*300,怎样得到300? 使用reverse配合charindex来实现. reverse是把字符串倒置,然后通过charind ...

  3. 【iCore1S 双核心板_FPGA】例程二:GPIO输入实验——识别按键输入

    实验现象: iCore1s 双核心板上与FPGA相连的三色LED(PCB上标示为FPGA·LED),按键按下红灯点亮,松开按键红灯熄灭. 核心源代码: module KEY( input CLK_12 ...

  4. 关于Python打包运行的一些思路

    需求 本地开发python django应用程序,然后放到生产环境运行.使用了tensorflow,手动安装包很麻烦.生产环境不能联网,不能使用 pip freeze. 思路: 使用docker,直接 ...

  5. ssh免密码登录配置方法

    每次输密码很麻烦,免密登录设置方法按照<ssh免密码登录配置方法>即可,简单来说: 1.终端上执行ssh-keygen -t rsa,生成密钥对(存放在/home/usera/.ssh). ...

  6. linux-centos下持续集成工具jenkins部署使用教程

    centos下准备工作: 1.安装jdk环境 2.安装maven环境(用于构建项目) 3.git客户端(用于拉取源码) 此外码云还要准备一份java源码(springboot项目) 一.安装jenki ...

  7. H5 (webApi) 接口帮助文档

    只有你想不到,没有找不到的,强大的 webApis!!! https://developer.mozilla.org/en-US/docs/Web/API

  8. POST 发送HTTP请求入参为:String url, Map<String, Object> propsMap

    /** * 发送HTTP请求 * * @param url * @param propsMap * 发送的参数 */ public static String httpSend(String url, ...

  9. 面试题思考:GET和POST两种基本请求方法的区别

    面试回答: GET请求在URL中传送的参数是有长度限制的,而POST没有. GET比POST更不安全,因为参数直接暴露在URL上,所以不能用来传递敏感信息. GET参数通过URL传递,POST放在Re ...

  10. sencha touch datepicker/datepickerfield(时间选择控件)扩展

    参考资料: https://market.sencha.com/extensions/datetimepicker 适用于2.4.1版本 uxPickerTime 使用方法参考:datepicker控 ...