From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 0C766E5D for ; Mon, 30 Apr 2018 16:07:46 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id x12so11543276wmc.0 for ; Mon, 30 Apr 2018 07:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=egNdJDBIC+xgTf0HPPVTn7vv+WorWV9t1cypiXS2D5k=; b=qGcpqVYchwRd/fpdOKQUb3cbWGBBT7uADAegHWZ88hoTM3oQpoDf+L5ggdTDM5kqKn b8cvGY0CxgSZNmrDokooM5fgoWr7J0ufFBfCn9RZlL3ATSRNDFuEXWe6g5yRCQEDbBQM 2AIC5HkmofDG8rJxgDXbjBkn5UlZIt/RC+wtIIGZncp4z1ph2TCDSgK2Uct/9kY3KfF5 ynL7/Vtpc7MZoNOa2cNJ3CjPfsefuTjOBOUpIS0DTMm3Bgr2V7ysq+sZTbLA0HS+Lrvj 1Cz10hWHnYCqMIqG+ve9kVmUYlTFeI024G6gt8kg7g30tWjbvGBdx4MAz4rHaIvuUC1+ jOAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=egNdJDBIC+xgTf0HPPVTn7vv+WorWV9t1cypiXS2D5k=; b=udAV3daFgYjIy0X55atVdmN7t4gGy5l1Im69N/8SKn4l+X4VeOBJYJBnNlutsxxoki g+kf5y97AxDGXVYIjpA0FClbzkXiP5JRsLKD9aCIg9nQ0NQGshU3l1DEeN66u/h0gIhB Cl93iRpeyvsv14R7wtX1meJXuB4iREwLQjyZio+9xgmXoVxAHXQXQOiYOdPhgXZSrhF/ TotfQZJoxfq7RAR07yK+28Bvq5/ZHnOcdl/RTH48Xq21nZljJSac85Yb3VPfXENTGBkm 9S28G67Zq6pBgDEG7u1NQ7M6n+YzWvVIjFq0Tzk/2jmFZXns3pEj4s+wp6qwMknTeYXy 02HQ== X-Gm-Message-State: ALQs6tAsinO4Dj8p2vz5i+SDXOwxrJM9wnmElFHjzYw7wC/EVqM7b6M0 9BTXaZAWqRzvk15aHW3KDos= X-Google-Smtp-Source: AB8JxZpU6GgjI3L9vWZTMmRGyIscFfJ2bJBN4x/9HQVUML/rPHzeVLYY+gIjSlBN3U+szMR+o0vxmA== X-Received: by 10.28.177.9 with SMTP id a9mr2869687wmf.18.1525097265353; Mon, 30 Apr 2018 07:07:45 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id p10-v6sm7400895wre.77.2018.04.30.07.07.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:07:44 -0700 (PDT) From: luca.boccassi@gmail.com To: Pascal Mazon Cc: Harish Patil , dpdk stable Date: Mon, 30 Apr 2018 15:03:29 +0100 Message-Id: <20180430140606.4615-51-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430140606.4615-1-luca.boccassi@gmail.com> References: <20180430140606.4615-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/qede: fix alloc from socket 0' has been queued to stable release 18.02.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: Mon, 30 Apr 2018 14:07:46 -0000 Hi, FYI, your patch has been queued to stable release 18.02.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 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From f5a5d6008bc11003053d3d9cfd3c7c6ec6a96396 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.14.2