X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fsoftnic%2Frte_eth_softnic_thread.c;h=d610b1617e77c02380ffd7f01e933461adeac0ba;hb=422397c56cb573802964469b32e9ae5988621fb2;hp=855408e9883d32bfa46d68d6a75689f982e2fab8;hpb=5024da517de619912d75e215e113bfac977de785;p=dpdk.git diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c index 855408e988..d610b1617e 100644 --- a/drivers/net/softnic/rte_eth_softnic_thread.c +++ b/drivers/net/softnic/rte_eth_softnic_thread.c @@ -99,17 +99,12 @@ softnic_thread_init(struct pmd_internals *softnic) static inline int thread_is_valid(struct pmd_internals *softnic, uint32_t thread_id) { - struct rte_config *cfg = rte_eal_get_configuration(); - enum rte_lcore_role_t role; - - if ((thread_id >= RTE_MAX_LCORE) || - (thread_id == cfg->master_lcore)) + if (thread_id == rte_get_master_lcore()) return 0; /* FALSE */ - role = cfg->lcore_role[thread_id]; - - if ((softnic->params.sc && (role == ROLE_SERVICE)) || - (!softnic->params.sc && (role == ROLE_RTE))) + if (softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_SERVICE)) + return 1; /* TRUE */ + if (!softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_RTE)) return 1; /* TRUE */ return 0; /* FALSE */