From: Rasesh Mody <rasesh.mody@qlogic.com>
To: <dev@dpdk.org>
Cc: <Dept-EngDPDKDev@qlogic.com>, Rasesh Mody <rasesh.mody@qlogic.com>
Subject: [dpdk-dev] [PATCH 2/2] bnx2x: fix to use SOCKET_ID_ANY for slowpath memory
Date: Wed, 5 Oct 2016 22:36:37 -0700 [thread overview]
Message-ID: <1475732197-668-2-git-send-email-rasesh.mody@qlogic.com> (raw)
In-Reply-To: <1475732197-668-1-git-send-email-rasesh.mody@qlogic.com>
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: 540a211 ("bnx2x: driver core")
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
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 2bb4a84..8970334 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);
--
1.7.10.3
next prev parent reply other threads:[~2016-10-06 5:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-06 5:36 [dpdk-dev] [PATCH 1/2] bnx2x: fix maximum PF queues Rasesh Mody
2016-10-06 5:36 ` Rasesh Mody [this message]
2016-10-11 13:56 ` Chas Williams
2016-10-11 14:22 ` Harish Patil
2016-10-12 16:33 ` Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1475732197-668-2-git-send-email-rasesh.mody@qlogic.com \
--to=rasesh.mody@qlogic.com \
--cc=Dept-EngDPDKDev@qlogic.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).