From: David Marchand Date: Tue, 16 Jun 2020 09:47:00 +0000 (+0200) Subject: net/mvpp2: fix non-EAL thread support X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b52d25ae4b1bbe9adba0d9276b7771ec27e3d151;p=dpdk.git net/mvpp2: fix non-EAL thread support Caught by code inspection, for a non-EAL thread identified with rte_lcore_id() == LCORE_ID_ANY, the code currently arbitrarily uses lcore 0 while there is no guarantee this lcore is used. Fixes: 3588aaa68eab ("net/mrvl: fix HIF objects allocation") Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Liron Himi --- diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index b98b1fd667..9037274327 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -816,7 +816,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev) unsigned int core_id = rte_lcore_id(); if (core_id == LCORE_ID_ANY) - core_id = 0; + core_id = rte_get_master_lcore(); hif = mrvl_get_hif(priv, core_id); @@ -1620,7 +1620,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num) core_id = rte_lcore_id(); if (core_id == LCORE_ID_ANY) - core_id = 0; + core_id = rte_get_master_lcore(); hif = mrvl_get_hif(rxq->priv, core_id); if (!hif) @@ -1770,7 +1770,7 @@ mrvl_rx_queue_release(void *rxq) unsigned int core_id = rte_lcore_id(); if (core_id == LCORE_ID_ANY) - core_id = 0; + core_id = rte_get_master_lcore(); if (!q) return;