From 8d6c8b9ade221d94622988968ab4a304e37dbab5 Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Wed, 5 Oct 2016 22:36:37 -0700 Subject: [PATCH] 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 --- drivers/net/bnx2x/bnx2x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.20.1