From patchwork Fri Feb 23 12:53:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pascal Mazon X-Patchwork-Id: 35372 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E363D4CA7; Fri, 23 Feb 2018 13:54:10 +0100 (CET) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id D2D3D4CA6; Fri, 23 Feb 2018 13:54:08 +0100 (CET) Received: from 6wind.com (unknown [10.16.0.184]) by proxy.6wind.com (Postfix) with SMTP id BD9CE137C06; Fri, 23 Feb 2018 13:50:50 +0100 (CET) Received: by 6wind.com (sSMTP sendmail emulation); Fri, 23 Feb 2018 13:53:56 +0100 From: Pascal Mazon To: dev@dpdk.org, Rasesh Mody , Harish Patil , Shahed Shaikh Cc: pascal.mazon@6wind.com, stable@dpdk.org Date: Fri, 23 Feb 2018 13:53:05 +0100 Message-Id: X-Mailer: git-send-email 2.16.1.72.g5be1f00a9 Subject: [dpdk-dev] [PATCH] net/qede: fix alloc from socket 0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Harish Patil --- 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);