From: Rasesh Mody Date: Thu, 6 Oct 2016 05:36:37 +0000 (-0700) Subject: net/bnx2x: fix socket id for slowpath memory X-Git-Tag: spdx-start~5553 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8d6c8b9ade221d94622988968ab4a304e37dbab5;p=dpdk.git net/bnx2x: fix socket id for slowpath memory When the DMA allocation routine is invoked in the context of a non-EAL thread, the API rte_lcore_id() returns -1 and indexing on that in rte_lcore_to_socket_id() leads to segfault. The fix is to use SOCKET_ID_ANY as the socket_id for all slowpath memory allocation. Fixes: 540a211084a7 ("bnx2x: driver core") Signed-off-by: Rasesh Mody --- diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 2bb4a84068..8970334e0d 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -178,7 +178,7 @@ bnx2x_dma_alloc(struct bnx2x_softc *sc, size_t size, struct bnx2x_dma *dma, /* Caller must take care that strlen(mz_name) < RTE_MEMZONE_NAMESIZE */ z = rte_memzone_reserve_aligned(mz_name, (uint64_t) (size), - rte_lcore_to_socket_id(rte_lcore_id()), + SOCKET_ID_ANY, 0, align); if (z == NULL) { PMD_DRV_LOG(ERR, "DMA alloc failed for %s", msg);