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. build MYSQL source code Using visual studio 2017

    https://dev.mysql.com/doc/refman/8.0/en/installing-source-distribution.html cmake .. -G "Visual ...

  2. Haproxy全透明代理

    1. 系统环境搭建 操作系统Centos7 内核版本3.10 Centos7已自带TPROXY模块,不需要安装TPROXY 2. Haproxy下载,编译,安装,配置 下载地址 http://www. ...

  3. InstallShield: 1628 完成基于脚本的安装失败

    问题: 第一次卸载程序失败,以后每次卸载出现1628 完成基于脚本的安装失败,使用安装包打开也会出现相同问题. 原因: 首先检查安装包是否出错,然后检查卸载脚本是否出错. InstallShield程 ...

  4. Go语言实践_实现一(客户端)对一(服务器端)聊天室

    一.目的 使用Go语言实现一个服务器端与客户端的聊天室. 软件:Goland,Go1.9 代码仓库地址 二.思路 1,首先启动服务器端,使用listen_socket函数监听IP地址上的客户端连接: ...

  5. Virtualbox的centos7 nat和桥接网络配置

    在实际配置虚拟机的过程中,网络配置时候一个很繁琐的过程,经常一个点没注意到,就访问不了了.在此,做一个简单的教程以供后续使用时可以参考! 方法一: 使用NAT网络 1. 选择网卡 安装centos7的 ...

  6. linux下Ftp服务安装

    安装vsftp 使用yum命令安装vsftp #yum install vsftpd -y 如果yum安装不成功,可以到 http://pkgs.org/centos-6/centos-x86_64/ ...

  7. 缓存技术PK:选择Memcached还是Redis?

    缓存技术PK:选择Memcached还是Redis? memcached完全剖析----------------->高质量文章 memcached的最佳实践方案 数据缓存系统-memcached ...

  8. Java中创建线程的三种方式以及区别

    在java中如果要创建线程的话,一般有3种方法: 继承Thread类: 实现Runnable接口: 使用Callable和Future创建线程. 1. 继承Thread类 继承Thread类的话,必须 ...

  9. mysql 第二高薪水

    编写一个 SQL 查询,获取 Employee 表中第二高的薪水(Salary) +----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | ...

  10. 正整数序列Q中的每个元素都至少能被正整数a和b中的一个整除,现给定a和b,如何生成Q中的前几项

    思路分析:可以与归并排序联系起来,给定两个变量A.B,变量A轮着存放:a*1,a*2,a*3,……变量组B轮着存放:b*1,b*2,b*3,……有两个整数i.j,分别代表A.B第i.j次存放的值,每次 ...