X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fsoftnic%2Frte_eth_softnic_thread.c;h=d610b1617e77c02380ffd7f01e933461adeac0ba;hb=53108e95306b1e1905f8808aa878bfce499d85fd;hp=57989a5aac54a8015b1f6ef9f93d286eead5b569;hpb=a958a5c07f4b5e715921a2f22c931142417287a5;p=dpdk.git diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c index 57989a5aac..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 */ @@ -137,7 +132,10 @@ thread_sc_service_up(struct pmd_internals *softnic, uint32_t thread_id) uint16_t port_id; /* service params */ - rte_eth_dev_get_port_by_name(softnic->params.name, &port_id); + status = rte_eth_dev_get_port_by_name(softnic->params.name, &port_id); + if (status) + return status; + dev = &rte_eth_devices[port_id]; snprintf(service_params.name, sizeof(service_params.name), "%s_%u", softnic->params.name,