dpdk lcore 初始化

 

 

int rte_lcore_is_enabled(unsigned int lcore_id)
{
        struct rte_config *cfg = rte_eal_get_configuration();

        if (lcore_id >= RTE_MAX_LCORE)
                return 0;
        return cfg->lcore_role[lcore_id] == ROLE_RTE;
}
eal_parse_lcores(const char *lcores)    
          /* start to update lcore_set */
                for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
                        if (!set[idx])
                                continue;

                        if (cfg->lcore_role[idx] != ROLE_RTE) {
                                lcore_config[idx].core_index = count;
                                cfg->lcore_role[idx] = ROLE_RTE;
                                count++;
                        }

                        if (lflags) {
                                CPU_ZERO(&cpuset);
                                CPU_SET(idx, &cpuset);
                        }
                        rte_memcpy(&lcore_config[idx].cpuset, &cpuset,
                                   sizeof(rte_cpuset_t));
                }

 

posted on 2020-09-03 14:19  tycoon3  阅读(547)  评论(0)    收藏  举报

导航