From patchwork Tue Oct 26 09:06:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Houssem Bouhlel X-Patchwork-Id: 102884 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 662DCA0C47; Tue, 26 Oct 2021 11:06:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5101D410D5; Tue, 26 Oct 2021 11:06:57 +0200 (CEST) Received: from smtpservice.6wind.com (host.78.145.23.62.rev.coltfrance.com [62.23.145.78]) by mails.dpdk.org (Postfix) with ESMTP id 79C60407FF; Tue, 26 Oct 2021 11:06:56 +0200 (CEST) Received: from metallica.dev.6wind.com (metallica.dev.6wind.com [10.16.0.191]) by smtpservice.6wind.com (Postfix) with ESMTP id 51D1860071; Tue, 26 Oct 2021 11:06:56 +0200 (CEST) From: Houssem Bouhlel To: dev@dpdk.org Cc: Houssem Bouhlel , stable@dpdk.org, Olivier Matz Date: Tue, 26 Oct 2021 11:06:10 +0200 Message-Id: <20211026090610.10823-1-houssem.bouhlel@6wind.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] bus/pci: fix selection of default device NUMA node X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" There can be dev binding issue when no hugepages are allocated for socket 0. To avoid this, set device numa node value based on the first lcore instead of 0. Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support") Cc: stable@dpdk.org Signed-off-by: Houssem Bouhlel Signed-off-by: Olivier Matz --- drivers/bus/pci/pci_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index f8fff2c98ebf..c70ab2373c79 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -166,6 +166,7 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *dev) { int ret; + unsigned int socket_id; bool already_probed; struct rte_pci_addr *loc; @@ -194,7 +195,8 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, if (rte_socket_count() > 1) RTE_LOG(INFO, EAL, "Device %s is not NUMA-aware, defaulting socket to 0\n", dev->name); - dev->device.numa_node = 0; + socket_id = rte_lcore_to_socket_id(rte_get_next_lcore(-1, 0, 0)); + dev->device.numa_node = socket_id; } already_probed = rte_dev_is_probed(&dev->device);