DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pascal Mazon <pascal.mazon@6wind.com>
To: dev@dpdk.org, Rasesh Mody <rasesh.mody@cavium.com>,
	Harish Patil <harish.patil@cavium.com>,
	Shahed Shaikh <shahed.shaikh@cavium.com>
Cc: pascal.mazon@6wind.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/qede: fix alloc from socket 0
Date: Fri, 23 Feb 2018 13:53:05 +0100	[thread overview]
Message-ID: <cef0a87d69a78f57c938a099a85041d3b612d7b3.1519390269.git.pascal.mazon@6wind.com> (raw)

In case osal_dma_alloc_coherent() is called from a management thread,
core_id turn out to be LCORE_ID_ANY, and the resulting socket for alloc
will be socket 0.

This is not desirable when using a NIC from socket 1 which might very
likely be configured to use memory from that socket only.
In that case, allocation will fail.

To address this, use master lcore instead when called from mgmt thread.
The associated socket should have memory available.

Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
---
 drivers/net/qede/base/bcm_osal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index fe42f3256400..0760cdcb9523 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -133,7 +133,7 @@ void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
 	snprintf(mz_name, sizeof(mz_name) - 1, "%lx",
 					(unsigned long)rte_get_timer_cycles());
 	if (core_id == (unsigned int)LCORE_ID_ANY)
-		core_id = 0;
+		core_id = rte_get_master_lcore();
 	socket_id = rte_lcore_to_socket_id(core_id);
 	mz = rte_memzone_reserve_aligned(mz_name, size,
 					 socket_id, 0, RTE_CACHE_LINE_SIZE);
-- 
2.16.1.72.g5be1f00a9

             reply	other threads:[~2018-02-23 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 12:53 Pascal Mazon [this message]
2018-02-25  6:38 ` Patil, Harish
2018-02-26  8:01 ` [dpdk-dev] [PATCH v2] " Pascal Mazon
2018-02-26 18:38   ` Patil, Harish
2018-03-07 13:17     ` Ferruh Yigit

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=cef0a87d69a78f57c938a099a85041d3b612d7b3.1519390269.git.pascal.mazon@6wind.com \
    --to=pascal.mazon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=harish.patil@cavium.com \
    --cc=rasesh.mody@cavium.com \
    --cc=shahed.shaikh@cavium.com \
    --cc=stable@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).