From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AC303A0032; Fri, 29 Oct 2021 10:44:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74C37410E0; Fri, 29 Oct 2021 10:44:55 +0200 (CEST) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mails.dpdk.org (Postfix) with ESMTP id 7435D40688 for ; Fri, 29 Oct 2021 10:44:54 +0200 (CEST) Received: by mail-wr1-f53.google.com with SMTP id b12so10600061wrh.4 for ; Fri, 29 Oct 2021 01:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Bnnc5WxKVeuCB/YQs8FdXL0yKCmzUIbg77vb4CtdhNI=; b=P+FDQH2+qzx2m1kJSgnsb+lLEg9c5y8/6fjySTCJGJKATA8hvXj+tAZOM97zoFPJWW 2nvE/TsQO8Ry5Zjs+1wLW8Hm5JF2iHI8Okog0ndw41vLfueqivn8YP/AAFDeuR8+7ptU ss9p0I3jHW6Sv/umtgkNm7A6SBlbH4Fi9AbvwCZ8vdIGcm/w6i0X7NtVK4b01Cp8VeMb 0nOpzd2uKG7mE7nuvpqKF2/PpuLzScH2jIEVfe7Wtb0ada4+D9Ow8M74H8HylreNy3em nNZaq5RtETNnbICjT7KMQa1J6mrzDI+EUjx9Od6y4fZZs35N4BEmVjuGocjstquSIkB7 mQyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Bnnc5WxKVeuCB/YQs8FdXL0yKCmzUIbg77vb4CtdhNI=; b=Q7Y8XnvoXQ/ONJThO5ZvyXAFnSDZXQhqPCV6IwepR/w3zF23dwd+dg+LX9G405Fd2B m0JBPGHQL9BAgxlnqY5nlPvEow335KNXcvNDfM0WTpU7sjaZZvAN+uUDCgcjxwhFjaYB BDrL31ISaCJT9dxTP8LpjuKOlShwQynHyNvKDfmzBu4fYu07L8ka6AgDDGuUYbN2O570 re5lzzyCgh43HKRr5sN0WuzgUBanZnWZZuPDSgFCRpNtgOERBP7EUZxPgGOuilDOrg4v 2oyCByJrE5poWGDxRh/B/vLs21FJnvrJdzuOmPqATcFeUuEDj92FkZmKI4b2FkOJ2UdR 0ibw== X-Gm-Message-State: AOAM532nV+c9Dmy+S3spaRtwoH/nFVJ1LpOFr5OyafZxIHfvREUJlECI Hmr0Vt9CmiqPvbWylyPv0SFYIO4HGLctog== X-Google-Smtp-Source: ABdhPJze0jzs7Cfkx6mi4w4zd1J8nS5siSi52x/mgWCQhrG1BvJcc0LEDLVJiylICkTLQ/hcJ0AE/g== X-Received: by 2002:a05:6000:15c6:: with SMTP id y6mr12834094wry.210.1635497094139; Fri, 29 Oct 2021 01:44:54 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id x6sm5864731wro.63.2021.10.29.01.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 01:44:53 -0700 (PDT) Date: Fri, 29 Oct 2021 10:44:53 +0200 From: Olivier Matz To: Houssem Bouhlel Cc: dev@dpdk.org, stable@dpdk.org, David Marchand Message-ID: References: <20211026090610.10823-1-houssem.bouhlel@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [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" +CC David On Tue, Oct 26, 2021 at 11:17:08AM +0200, Olivier Matz wrote: > On Tue, Oct 26, 2021 at 11:06:10AM +0200, Houssem Bouhlel wrote: > > 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") > > Sorry, the Fixes line is wrong. This is the correct one: > Fixes: 8a04cb612589 ("pci: set default numa node for broken systems") > > > 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); > > One more comment (sorry, I should have done it before you send the mail): > We should move this log below, and use the socket_id instead of 0. > > > - 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; After some offline discussions with David, some additional comments: - a similar change may be needed in other bus drivers - instead of setting the numa node to an existing socket, it can make more sense to keep its value to unknown (-1). This would however be a behavior change for pci bus, which returns 0 since 2015 for unknown cases. See: 81f8d2317df2 ("eal/linux: fix socket value for undetermined numa node") 8a04cb612589 ("pci: set default numa node for broken systems") I'll tend to be in favor of using -1. Any other opinion? Should we announce a behavior change in this case? > > } > > > > already_probed = rte_dev_is_probed(&dev->device); > > -- > > 2.30.2 > >