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 7FCFDA034C; Fri, 30 Sep 2022 09:11:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 291E840FAE; Fri, 30 Sep 2022 09:11:14 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 7D82840E5A for ; Fri, 30 Sep 2022 09:11:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664521872; 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=dNyBY8DUD+wVsIGT/sCpfxy+ed11keSVFvM5axMT7jM=; b=HAq8T5Lg50vdc2mYOufgQOSI0oL1POATG+2KEdAIL7xQW4xJrUmuJFGB0EMsBy1OJPobL2 T1qd0hH4cUESYLDr6aZHZZBHOsyEZDJhrAFRJhh1f/VIjAg6lKowFbo2lIqICK0JskQsJo wysgAH9R31cMkxfOWUCf1TgJqbFuzUw= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-541-RpIIVUTdNyCWHv9RTw_i7Q-1; Fri, 30 Sep 2022 03:11:07 -0400 X-MC-Unique: RpIIVUTdNyCWHv9RTw_i7Q-1 Received: by mail-pj1-f71.google.com with SMTP id hk15-20020a17090b224f00b00205fa3483bdso4068288pjb.8 for ; Fri, 30 Sep 2022 00:11:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=dNyBY8DUD+wVsIGT/sCpfxy+ed11keSVFvM5axMT7jM=; b=bGhrh401ow9pzvEUxDwNWSKxq1IJNGvmuMJv/Oo7Zry3w3RHXH/6Y6qNyyOKdWbkIG TEj8HaVpKOtHB85hjrVrX07Tgqn5azyb/wxO8C+h3ud1RE9CCYX/5t5TghgcHWss21A3 doTcw8aC6SnGaHt23tgm/ePkYWhgUeoBYhUa/bop+hfUeOeWfn+bckn48P/iZ7U0mf7f tBwIWbmBaSKH/lnLXYl2sg64YoH5qdtuV9+o+u9XCQ4sAg1bnt5EHHPdgL+Eqf3GFvWh aU5hq/V3ktxq5XAgo6Wx069O4Pm232H6POihmXBNLBwdQAsPoTxbd9AJVangCIl89dl8 ae3Q== X-Gm-Message-State: ACrzQf0AAZxrx3H9tTFZcTaPgdwEUGD3YhZVChktgZLkDU4YSxGosO5K ATOzms4QgB3mLWTTFc9AVRLOXPOd6xusyiO+EoA/xJpEAtekduWqHzLyowqwrZXth1jrhvH2aVp LJGCAEoCOpgjKor4iXfY= X-Received: by 2002:a17:90b:4a48:b0:202:9bcb:b89c with SMTP id lb8-20020a17090b4a4800b002029bcbb89cmr21183079pjb.161.1664521866997; Fri, 30 Sep 2022 00:11:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4WYWCyFiVC/KmzhBilj6UN/EeGw1OYxLxCs9N2fQngoyeNnuH9mIy29VMFsbSqSI9qGIfWw51L9XDBz02vP04= X-Received: by 2002:a17:90b:4a48:b0:202:9bcb:b89c with SMTP id lb8-20020a17090b4a4800b002029bcbb89cmr21183058pjb.161.1664521866735; Fri, 30 Sep 2022 00:11:06 -0700 (PDT) MIME-Version: 1.0 References: <20220929120512.480-1-olivier.matz@6wind.com> In-Reply-To: <20220929120512.480-1-olivier.matz@6wind.com> From: David Marchand Date: Fri, 30 Sep 2022 09:10:55 +0200 Message-ID: Subject: Re: [PATCH] drivers/bus: set device NUMA node to unknown by default To: Olivier Matz Cc: dev@dpdk.org, Ray Kinsella , Parav Pandit , Xueming Li , Hemant Agrawal , Sachin Saxena , Stephen Hemminger , Long Li X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 On Thu, Sep 29, 2022 at 2:05 PM Olivier Matz wrote: > > The dev->device.numa_node field is set by each bus driver for > every device it manages to indicate on which NUMA node this device lies. > > When this information is unknown, the assigned value is not consistent > across the bus drivers. > > Set the default value to SOCKET_ID_ANY (-1) by all bus drivers > when the NUMA information is unavailable. > > Signed-off-by: Olivier Matz - The dma/idxd driver, which has its own bus, seems ok, though I would align its code for readability. @@ -322,7 +322,7 @@ dsa_scan(void) while ((wq = readdir(dev_dir)) != NULL) { struct rte_dsa_device *dev; - int numa_node = -1; + int numa_node = SOCKET_ID_ANY; if (strncmp(wq->d_name, "wq", 2) != 0) continue; - There is an impact on upper classes of devices. For ethdev, a port inherits the numa_node value from the rte_device object. Yet, rte_eth_dev_socket_id() is described as: * @return * The NUMA socket ID to which the Ethernet device is connected or * a default of zero if the socket could not be determined. * -1 is returned is the port_id value is out of range. -- David marchand