/**
* 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开始。