From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 7D63529D6 for ; Sun, 22 Apr 2018 17:11:06 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2095B21319; Sun, 22 Apr 2018 11:11:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 22 Apr 2018 11:11:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=wXRmuv1oyzQpFmaNB LYCV+DKncd0hXy2/cNG2SjQztI=; b=ACAiWYPuVZ3dJhQbLr0If5pEXr8x18e/m DFqoHjIBa8/MTqswec5EpYsddEsF7bYcB++0LYLjW8WxzvlgQ/6ncDCizJP1ql4+ zmlg0nFXdLqjA3X5buled85hpmQqfCXKkNIoUPtJsy5MoZu/gASvWq8ZxpH+jTpK IUvS4L5IKCy33lMx0t+hrKCnC4E4mLFO3YDxhhnEEOjEpsgepoyc2fYatDGbMfrO 4n7flP//F/8Y3hRR0bHVqrY3pqL0g9ynlLI0hODjeCStb32u4/HhCOf+OpNzlpIe 8gV5DecNPKxyt//EchTatCkxaptGc4MHli4shGuZESXNgOBVtXFYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=wXRmuv1oyzQpFmaNBLYCV+DKncd0hXy2/cNG2SjQztI=; b=WP8/XkJM cp4xfaPg4KPE6uwbXeLLkTHy58c4WKEL4+3KTXWuQOfEZ6iD8FTUOXZHfl+iKHGm nG9g4ZEftBXul5qXcX7zD5qK8M6nzjBwAAE9fc5uYrqVkOzK6RnZsM70gl7RW6v9 RPP4eoYI9YZv4lSVupO2vAg1DIZ6mSJY1FubEIF1vRPehYBvqcNv2iK0Irg5hvNw j5t+LrSifc5xSyO+Qi4e+Z/8B3oOvBHwjD5BnDTd8huqenMMHX5244YkSGDG35ZB H0KxR6kyRXvjj3w3huNslS7klmhFV8BUiWT+rbSZMsCbKFxRkYllUxJM/ZUB+Ye4 emn72UI+2PcYJA== X-ME-Sender: Received: from yuanhanliu-NB0.tencent.com (unknown [223.74.148.66]) by mail.messagingengine.com (Postfix) with ESMTPA id 254EA10253; Sun, 22 Apr 2018 11:11:03 -0400 (EDT) From: Yuanhan Liu To: Pascal Mazon Cc: Harish Patil , dpdk stable Date: Sun, 22 Apr 2018 23:09:12 +0800 Message-Id: <20180422150949.17523-22-yliu@fridaylinux.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180422150949.17523-1-yliu@fridaylinux.org> References: <20180422150949.17523-1-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/qede: fix alloc from socket 0' has been queued to LTS release 17.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 15:11:06 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/29/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 5978967e184e4a27fa34a1370d07c0889cc416b3 Mon Sep 17 00:00:00 2001 From: Pascal Mazon 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 Acked-by: Harish Patil Acked-by: Harish Patil --- 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 fe42f3256..91017b89a 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); @@ -172,7 +172,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.11.0