get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/117136/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 117136,
    "url": "https://patches.dpdk.org/api/patches/117136/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220929120512.480-1-olivier.matz@6wind.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20220929120512.480-1-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220929120512.480-1-olivier.matz@6wind.com",
    "date": "2022-09-29T12:05:12",
    "name": "drivers/bus: set device NUMA node to unknown by default",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "836aaa1d3487ef94a4c2c1ffc6a3fa069d44d178",
    "submitter": {
        "id": 8,
        "url": "https://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220929120512.480-1-olivier.matz@6wind.com/mbox/",
    "series": [
        {
            "id": 24914,
            "url": "https://patches.dpdk.org/api/series/24914/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=24914",
            "date": "2022-09-29T12:05:12",
            "name": "drivers/bus: set device NUMA node to unknown by default",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/24914/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/117136/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/117136/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2ED7DA00C4;\n\tThu, 29 Sep 2022 14:05:25 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 21C2541143;\n\tThu, 29 Sep 2022 14:05:25 +0200 (CEST)",
            "from mail-wr1-f42.google.com (mail-wr1-f42.google.com\n [209.85.221.42]) by mails.dpdk.org (Postfix) with ESMTP id ED14640395\n for <dev@dpdk.org>; Thu, 29 Sep 2022 14:05:23 +0200 (CEST)",
            "by mail-wr1-f42.google.com with SMTP id s14so1886874wro.0\n for <dev@dpdk.org>; Thu, 29 Sep 2022 05:05:23 -0700 (PDT)",
            "from gojira.dev.6wind.com ([185.13.181.2])\n by smtp.gmail.com with ESMTPSA id\n r4-20020adfe684000000b0022ae0965a8asm6494725wrm.24.2022.09.29.05.05.22\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 29 Sep 2022 05:05:22 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date;\n bh=an/F51QeKLEVtvdGauOVZ95z+Adl+E1/pYMRoAwBhE4=;\n b=d5Zk9WI+k+SVS3tW9TkecBl2DBd8nQ2mvVgR/5QaQFljIJSEVSLTLHf+ksmSGvnNlI\n UEYvkArdAnQVCyUIlIxUoSRGVp6oaXKO1yLApVg0vfELq2BZbxj+dl2rXr6puiuSEb//\n oBWlmuFy6DX70+R3PE+tdCA5zdR4dIjdSy3V+Gn9lZIsPsg4ylUHFnlPMiKIBbpbu/aF\n dmEKX/+bhebKO3n6CiqFmYTlF64gUt3Ctet7IrcM4uUkswk0XU+rSko0CBvuvCyz8DXV\n 0z/dxSzXNnFHNXNEQeIGfhSIHZoU+g6vQOABkUcXwwnycNKRMsmU9DVHNPCYvKl+KUVJ\n L7Xw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date;\n bh=an/F51QeKLEVtvdGauOVZ95z+Adl+E1/pYMRoAwBhE4=;\n b=WwscmME5L+YgHVjJ46mwBOS5a3ZsxCImN8VYKdCOSbfpU5928h8mjEKQff9Ot3YEET\n p4ld8tU+pIbM+tzYTICf/N9hoC9oLhiJuhhhUwgIw10s8yrBRHLfykHwnSLlAU4Lg1X9\n /oCKF35w7pYS0B68OFTzCEInYQ9Q63IqKMy/lRte9/5FV2BIL2Pd+D+pGPi44jytUFsm\n bHMfvDeyVr37vPJv8w9hLBcH3tbJfVnfqiTp+suHHWkmQapJ4jyZmIY6Hja3/GIpwfWp\n nAMsPZURi8J2I3Dog7QgV8/j43Gc3Pno69IIO5XwH3DI0N2NPLYBMSYOHMDso+2iTpSW\n 2/fg==",
        "X-Gm-Message-State": "ACrzQf3Rht9bDhhDA1F2Mn9nBl2Jl4O2fCvLsOvZ+zqHfVVXdAYqCJeM\n y4TnATiJF4ZhlS/e1uIgcEt6Vn5g80uHMQ8u",
        "X-Google-Smtp-Source": "\n AMsMyM524Zkt5Gd8WvQdwxOpQwk0Kl0Cny5Yf4fvcc4b1MfjrMGdi91enxCzrD5v48Fr62Wyh3s3Lg==",
        "X-Received": "by 2002:a5d:52d0:0:b0:21e:4923:fa09 with SMTP id\n r16-20020a5d52d0000000b0021e4923fa09mr2080802wrv.244.1664453123678;\n Thu, 29 Sep 2022 05:05:23 -0700 (PDT)",
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Ray Kinsella <mdr@ashroe.eu>, Parav Pandit <parav@nvidia.com>,\n Xueming Li <xuemingl@nvidia.com>, Hemant Agrawal <hemant.agrawal@nxp.com>,\n Sachin Saxena <sachin.saxena@oss.nxp.com>,\n Stephen Hemminger <sthemmin@microsoft.com>, Long Li <longli@microsoft.com>",
        "Subject": "[PATCH] drivers/bus: set device NUMA node to unknown by default",
        "Date": "Thu, 29 Sep 2022 14:05:12 +0200",
        "Message-Id": "<20220929120512.480-1-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "The dev->device.numa_node field is set by each bus driver for\nevery device it manages to indicate on which NUMA node this device lies.\n\nWhen this information is unknown, the assigned value is not consistent\nacross the bus drivers.\n\nSet the default value to SOCKET_ID_ANY (-1) by all bus drivers\nwhen the NUMA information is unavailable.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n doc/guides/rel_notes/deprecation.rst     |  7 -------\n doc/guides/rel_notes/release_22_11.rst   |  6 ++++++\n drivers/bus/auxiliary/auxiliary_common.c |  8 ++------\n drivers/bus/auxiliary/linux/auxiliary.c  | 13 +++++--------\n drivers/bus/dpaa/dpaa_bus.c              |  1 +\n drivers/bus/fslmc/fslmc_bus.c            |  1 +\n drivers/bus/pci/bsd/pci.c                |  2 +-\n drivers/bus/pci/linux/pci.c              | 16 ++++++----------\n drivers/bus/pci/pci_common.c             |  8 ++------\n drivers/bus/pci/windows/pci.c            |  1 -\n drivers/bus/vmbus/linux/vmbus_bus.c      |  1 -\n drivers/bus/vmbus/vmbus_common.c         |  8 ++------\n 12 files changed, 26 insertions(+), 46 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst\nindex be231ff8d2..75645f0a9a 100644\n--- a/doc/guides/rel_notes/deprecation.rst\n+++ b/doc/guides/rel_notes/deprecation.rst\n@@ -36,13 +36,6 @@ Deprecation Notices\n   ``__atomic_thread_fence`` must be used for patches that need to be merged in\n   20.08 onwards. This change will not introduce any performance degradation.\n \n-* bus: The ``dev->device.numa_node`` field is set by each bus driver for\n-  every device it manages to indicate on which NUMA node this device lies.\n-  When this information is unknown, the assigned value is not consistent\n-  across the bus drivers.\n-  In DPDK 22.11, the default value will be set to -1 by all bus drivers\n-  when the NUMA information is unavailable.\n-\n * kni: The KNI kernel module and library are not recommended for use by new\n   applications - other technologies such as virtio-user are recommended instead.\n   Following the DPDK technical board\ndiff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst\nindex 0231959874..5989e4a04f 100644\n--- a/doc/guides/rel_notes/release_22_11.rst\n+++ b/doc/guides/rel_notes/release_22_11.rst\n@@ -266,6 +266,12 @@ ABI Changes\n * eventdev: Added ``weight`` and ``affinity`` fields\n   to ``rte_event_queue_conf`` structure.\n \n+* bus: Changed the device numa node to -1 when NUMA information is unavailable.\n+  The ``dev->device.numa_node`` field is set by each bus driver for\n+  every device it manages to indicate on which NUMA node this device lies.\n+  When this information is unknown, the assigned value was not consistent\n+  across the bus drivers.\n+\n \n Known Issues\n ------------\ndiff --git a/drivers/bus/auxiliary/auxiliary_common.c b/drivers/bus/auxiliary/auxiliary_common.c\nindex 259ff152c4..6bb1fe7c96 100644\n--- a/drivers/bus/auxiliary/auxiliary_common.c\n+++ b/drivers/bus/auxiliary/auxiliary_common.c\n@@ -105,12 +105,8 @@ rte_auxiliary_probe_one_driver(struct rte_auxiliary_driver *drv,\n \t\treturn -1;\n \t}\n \n-\tif (dev->device.numa_node < 0) {\n-\t\tif (rte_socket_count() > 1)\n-\t\t\tAUXILIARY_LOG(INFO, \"Device %s is not NUMA-aware, defaulting socket to 0\",\n-\t\t\t\t\tdev->name);\n-\t\tdev->device.numa_node = 0;\n-\t}\n+\tif (dev->device.numa_node < 0 && rte_socket_count() > 1)\n+\t\tRTE_LOG(INFO, EAL, \"Device %s is not NUMA-aware\\n\", dev->name);\n \n \tiova_mode = rte_eal_iova_mode();\n \tif ((drv->drv_flags & RTE_AUXILIARY_DRV_NEED_IOVA_AS_VA) > 0 &&\ndiff --git a/drivers/bus/auxiliary/linux/auxiliary.c b/drivers/bus/auxiliary/linux/auxiliary.c\nindex d4c564cd78..02fc9285dc 100644\n--- a/drivers/bus/auxiliary/linux/auxiliary.c\n+++ b/drivers/bus/auxiliary/linux/auxiliary.c\n@@ -40,14 +40,11 @@ auxiliary_scan_one(const char *dirname, const char *name)\n \t/* Get NUMA node, default to 0 if not present */\n \tsnprintf(filename, sizeof(filename), \"%s/%s/numa_node\",\n \t\t dirname, name);\n-\tif (access(filename, F_OK) != -1) {\n-\t\tif (eal_parse_sysfs_value(filename, &tmp) == 0)\n-\t\t\tdev->device.numa_node = tmp;\n-\t\telse\n-\t\t\tdev->device.numa_node = -1;\n-\t} else {\n-\t\tdev->device.numa_node = 0;\n-\t}\n+\tif (access(filename, F_OK) == 0 &&\n+\t    eal_parse_sysfs_value(filename, &tmp) == 0)\n+\t\tdev->device.numa_node = tmp;\n+\telse\n+\t\tdev->device.numa_node = SOCKET_ID_ANY;\n \n \tauxiliary_on_scan(dev);\n \ndiff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c\nindex 682427ba2c..447b222a76 100644\n--- a/drivers/bus/dpaa/dpaa_bus.c\n+++ b/drivers/bus/dpaa/dpaa_bus.c\n@@ -179,6 +179,7 @@ dpaa_create_device_list(void)\n \t\t}\n \n \t\tdev->device.bus = &rte_dpaa_bus.bus;\n+\t\tdev->device.numa_node = SOCKET_ID_ANY;\n \n \t\t/* Allocate interrupt handle instance */\n \t\tdev->intr_handle =\ndiff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c\nindex 8503004e3d..57bfb5111a 100644\n--- a/drivers/bus/fslmc/fslmc_bus.c\n+++ b/drivers/bus/fslmc/fslmc_bus.c\n@@ -156,6 +156,7 @@ scan_one_fslmc_device(char *dev_name)\n \t}\n \n \tdev->device.bus = &rte_fslmc_bus.bus;\n+\tdev->device.numa_node = SOCKET_ID_ANY;\n \n \t/* Allocate interrupt instance */\n \tdev->intr_handle =\ndiff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c\nindex 844d145fed..7459d15c7e 100644\n--- a/drivers/bus/pci/bsd/pci.c\n+++ b/drivers/bus/pci/bsd/pci.c\n@@ -246,7 +246,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)\n \tdev->max_vfs = 0;\n \n \t/* FreeBSD has no NUMA support (yet) */\n-\tdev->device.numa_node = 0;\n+\tdev->device.numa_node = SOCKET_ID_ANY;\n \n \tpci_common_set(dev);\n \ndiff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c\nindex c8703d52f3..ade17079fc 100644\n--- a/drivers/bus/pci/linux/pci.c\n+++ b/drivers/bus/pci/linux/pci.c\n@@ -283,17 +283,13 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)\n \t}\n \n \t/* get numa node, default to 0 if not present */\n-\tsnprintf(filename, sizeof(filename), \"%s/numa_node\",\n-\t\t dirname);\n+\tsnprintf(filename, sizeof(filename), \"%s/numa_node\", dirname);\n \n-\tif (access(filename, F_OK) != -1) {\n-\t\tif (eal_parse_sysfs_value(filename, &tmp) == 0)\n-\t\t\tdev->device.numa_node = tmp;\n-\t\telse\n-\t\t\tdev->device.numa_node = -1;\n-\t} else {\n-\t\tdev->device.numa_node = 0;\n-\t}\n+\tif (access(filename, F_OK) == 0 &&\n+\t    eal_parse_sysfs_value(filename, &tmp) == 0)\n+\t\tdev->device.numa_node = tmp;\n+\telse\n+\t\tdev->device.numa_node = SOCKET_ID_ANY;\n \n \tpci_common_set(dev);\n \ndiff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c\nindex 5ea72bcf23..a59c5b4286 100644\n--- a/drivers/bus/pci/pci_common.c\n+++ b/drivers/bus/pci/pci_common.c\n@@ -235,12 +235,8 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,\n \t\treturn 1;\n \t}\n \n-\tif (dev->device.numa_node < 0) {\n-\t\tif (rte_socket_count() > 1)\n-\t\t\tRTE_LOG(INFO, EAL, \"Device %s is not NUMA-aware, defaulting socket to 0\\n\",\n-\t\t\t\t\tdev->name);\n-\t\tdev->device.numa_node = 0;\n-\t}\n+\tif (dev->device.numa_node < 0 && rte_socket_count() > 1)\n+\t\tRTE_LOG(INFO, EAL, \"Device %s is not NUMA-aware\\n\", dev->name);\n \n \talready_probed = rte_dev_is_probed(&dev->device);\n \tif (already_probed && !(dr->drv_flags & RTE_PCI_DRV_PROBE_AGAIN)) {\ndiff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c\nindex 3f7a8b9432..5cf05ce1a0 100644\n--- a/drivers/bus/pci/windows/pci.c\n+++ b/drivers/bus/pci/windows/pci.c\n@@ -249,7 +249,6 @@ get_device_resource_info(HDEVINFO dev_info,\n \t\tDWORD error = GetLastError();\n \t\tif (error == ERROR_NOT_FOUND) {\n \t\t\t/* On older CPUs, NUMA is not bound to PCIe locality. */\n-\t\t\tdev->device.numa_node = 0;\n \t\t\treturn ERROR_SUCCESS;\n \t\t}\n \t\tRTE_LOG_WIN32_ERR(\"SetupDiGetDevicePropertyW\"\ndiff --git a/drivers/bus/vmbus/linux/vmbus_bus.c b/drivers/bus/vmbus/linux/vmbus_bus.c\nindex f502783f7a..01d8111b85 100644\n--- a/drivers/bus/vmbus/linux/vmbus_bus.c\n+++ b/drivers/bus/vmbus/linux/vmbus_bus.c\n@@ -293,7 +293,6 @@ vmbus_scan_one(const char *name)\n \t\t\tgoto error;\n \t\tdev->device.numa_node = tmp;\n \t} else {\n-\t\t/* if no NUMA support, set default to 0 */\n \t\tdev->device.numa_node = SOCKET_ID_ANY;\n \t}\n \ndiff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c\nindex 03b39c82b7..8d32d66504 100644\n--- a/drivers/bus/vmbus/vmbus_common.c\n+++ b/drivers/bus/vmbus/vmbus_common.c\n@@ -111,12 +111,8 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr,\n \t/* reference driver structure */\n \tdev->driver = dr;\n \n-\tif (dev->device.numa_node < 0) {\n-\t\tif (rte_socket_count() > 1)\n-\t\t\tVMBUS_LOG(INFO, \"Device %s is not NUMA-aware, defaulting socket to 0\",\n-\t\t\t\t\tguid);\n-\t\tdev->device.numa_node = 0;\n-\t}\n+\tif (dev->device.numa_node < 0 && rte_socket_count() > 1)\n+\t\tVMBUS_LOG(INFO, \"Device %s is not NUMA-aware\", guid);\n \n \t/* call the driver probe() function */\n \tVMBUS_LOG(INFO, \"  probe driver: %s\", dr->driver.name);\n",
    "prefixes": []
}