dpdk lcore_id&cpuid&core_id关系


/**
 * Structure storing internal configuration (per-lcore)
 */
struct lcore_config {
	pthread_t thread_id;       /**< pthread identifier */
	int pipe_master2slave[2];  /**< communication pipe with master */
	int pipe_slave2master[2];  /**< communication pipe with master */

	lcore_function_t * volatile f; /**< function to call */
	void * volatile arg;       /**< argument of function */
	volatile int ret;          /**< return value of function */

	volatile enum rte_lcore_state_t state; /**< lcore state */
	unsigned int socket_id;    /**< physical socket id for this lcore */
	unsigned int core_id;      /**< core number on socket for this lcore */
	int core_index;            /**< relative index, starting from 0 */
	uint8_t core_role;         /**< role of core eg: OFF, RTE, SERVICE */
	uint8_t detected;          /**< true if lcore was detected */

	rte_cpuset_t cpuset;       /**< cpu set which the lcore affinity to */
};

struct lcore_config lcore_config[RTE_MAX_LCORE];

lcore相关配置保存在lcore_config变量中
lcore_id:每个rte线程一个唯一ID。
core_id: 指的cpu物理coreID,这里指的不是cpuid。 coreid与cpuid对应关系可以在
cat /proc/meminfo或DPDK自带脚本./cpu_layout.py中查看。这里的core_id完全由lcore_id换算得到。(当lcore_id与cpuid不相等时,core_id与cpuid之间没有关联)
core_index:使用lcore_id的index,从0开始。(lcoreID不一定是连续的,如-l指定时,不连续时core_index与lcore_id不相等)
cpuset:当前lcore绑定的cpumask信息。绑定cpu时使用此字段。

-l 参数可指使用的定具体lcore_id
-lcores参数可指定lcore_id与cpuid映射关系。当运行多个dpdk程序时,可以确保lcore_id都从0开始。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值