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 5BEFAA0C47; Wed, 3 Nov 2021 21:37:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5D82410E5; Wed, 3 Nov 2021 21:37:05 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 8E65040E0F for ; Wed, 3 Nov 2021 21:37:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635971824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zPxsK3/IXuO6IWwaXWq5AvbOIeIWUBeqHqVfpB20Jts=; b=EFH1m1U6w9gL3+i5B+1L1m/cM0qrF8nYpmNdkBRkYP1FTLG9XpAUkEGItVbqeNVqr9Qv8H rHhi1P8hk+EdyxDm910ghldTlX9EHXoiZ2m88DYjSPLzi0CNEr2d1xy6SQ9bnWrHCuEM2s NlsIh8H1Bhaflk+w3gdnvlELRGlv6SA= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-526-TsgOx5OkMaygmsOTE4st_Q-1; Wed, 03 Nov 2021 16:37:02 -0400 X-MC-Unique: TsgOx5OkMaygmsOTE4st_Q-1 Received: by mail-lj1-f198.google.com with SMTP id 73-20020a2e054c000000b0021668f13ce2so1545043ljf.17 for ; Wed, 03 Nov 2021 13:37:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zPxsK3/IXuO6IWwaXWq5AvbOIeIWUBeqHqVfpB20Jts=; b=VUF5vkzi/PjAHU29de3G93qP7/kBuf7fVvrGFIZsgwSRbD65Gt4uw+B5ssVJilSm/j u9HlspAGP8MSi4ZJb1GrEhcBLxop0zuijJS+keTO0ow2EtbM/Y+UK0jwRYUPn55WPg0W UZ+ZWO3uK4/hbFXJXDl6WVwN4JS3/XOFVq/LbSNYf6MO4aYZB9MHxRtymuC5djgLep98 9oks25AXv3HnaxVI6YA4GK3udu2EAO6qpLP0UU+t/MvlbM0ApvJPvXtkXnvrE3Ud8tpU As1054a7ljr+IF9CY28naQuxBRS1rVcL8hH7dMwTBMeMoQtecw/vbydKwPqaNhfNAjX4 3TLA== X-Gm-Message-State: AOAM5319gcWmb/e9tTOmVIbfFL9FCQt5HQUhPEhRvNsmyyJU08sVkeL7 sn5ibV98YhDMPnMKneUYeqEMDSUa6NE6LVBHl/mRoMnMNuS3AQgf/1v6Rp0AbytqAGsvGAhtxZb 4RsdB+1KVg6VxsymTcjM= X-Received: by 2002:a2e:7f1b:: with SMTP id a27mr47763317ljd.55.1635971820967; Wed, 03 Nov 2021 13:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP4+F8/7KTe1MXECEL2x32QhurM/l+l5BnraDSxLOWVf7KYpalsH49KyZHsQP/qioUsHUmr/L+ysbQpyDJeEI= X-Received: by 2002:a2e:7f1b:: with SMTP id a27mr47763295ljd.55.1635971820768; Wed, 03 Nov 2021 13:37:00 -0700 (PDT) MIME-Version: 1.0 References: <20211026090610.10823-1-houssem.bouhlel@6wind.com> In-Reply-To: From: David Marchand Date: Wed, 3 Nov 2021 21:36:49 +0100 Message-ID: To: Olivier Matz Cc: Houssem Bouhlel , dev , dpdk stable , Thomas Monjalon , "Yigit, Ferruh" , "Burakov, Anatoly" , Bruce Richardson Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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" On Fri, Oct 29, 2021 at 10:45 AM Olivier Matz wrote: > > +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? Good summary. I copied some more people. I am for -1 too (as a way to indicate "I don't know what this PCI device affinity is"). It is dangerous to change now, and I think it is late for 21.11. -- David Marchand