[dpdk-stable] patch 'net/qede: fix alloc from socket 0' has been queued to LTS release 16.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 1 12:44:35 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/03/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From d05b692ce8f2e20df16ba6b9e0771c4cbed14c5a Mon Sep 17 00:00:00 2001
From: Pascal Mazon <pascal.mazon at 6wind.com>
Date: Mon, 26 Feb 2018 09:01:10 +0100
Subject: [PATCH] net/qede: fix alloc from socket 0

[ upstream commit 368b11185c8c35f95c6b4db1b24fa7757e5678f9 ]

In case osal_dma_alloc_coherent() or osal_dma_alloc_coherent_aligned() are
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")

Signed-off-by: Pascal Mazon <pascal.mazon at 6wind.com>
Acked-by: Harish Patil <harish.patil at cavium.com>
Acked-by: Harish Patil <harish.patil at cavium.com>
---
 drivers/net/qede/base/bcm_osal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index 3f895cd46..b9dc1d6d4 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -122,7 +122,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);
@@ -152,7 +152,7 @@ void *osal_dma_alloc_coherent_aligned(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, align);
 	if (!mz) {
-- 
2.14.2



More information about the stable mailing list