get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 115863,
    "url": "http://patches.dpdk.org/api/patches/115863/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220905083933.2506819-25-david.marchand@redhat.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20220905083933.2506819-25-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220905083933.2506819-25-david.marchand@redhat.com",
    "date": "2022-09-05T08:39:30",
    "name": "[v5,24/27] dev: introduce device accessors",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5bc6be5bf9583880f1a70440353d22c9f621295f",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220905083933.2506819-25-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 24531,
            "url": "http://patches.dpdk.org/api/series/24531/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24531",
            "date": "2022-09-05T08:39:07",
            "name": "[v5,01/27] devtools: forbid inclusions of driver only headers",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/24531/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/115863/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/115863/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 399F3A054A;\n\tMon,  5 Sep 2022 10:42:22 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C04B1427ED;\n\tMon,  5 Sep 2022 10:41:42 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id 637294069C\n for <dev@dpdk.org>; Mon,  5 Sep 2022 10:41:41 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com\n [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-443-x0mLxk7qOL2CscJyfWdHsQ-1; Mon, 05 Sep 2022 04:41:39 -0400",
            "from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com\n [10.11.54.3])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D9D243C02B80;\n Mon,  5 Sep 2022 08:41:38 +0000 (UTC)",
            "from fchome.redhat.com (unknown [10.40.193.251])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 93CC41121314;\n Mon,  5 Sep 2022 08:41:36 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1662367301;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=gLq3vjKKdHoM5YVxq+fGQbMuhbHXVmuKI5Os4gK7jfQ=;\n b=hyq6M2Iq0ikElwzpPomI/G6axaSLoBmG6c/6b2GaS8ZiTu2oCtlF+ha885+4t6BOAnWXOs\n xSHWR/T9eEB7LpLhIAY51yUq56aAOOAy8iIRexwrJnQuqOFwg7vZiq/5zvyZKoSf3aFgsN\n a2ZD94ERPy0T4B1PjLDhQdz3vpI4Jdk=",
        "X-MC-Unique": "x0mLxk7qOL2CscJyfWdHsQ-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, bruce.richardson@intel.com,\n Maryam Tahhan <maryam.tahhan@intel.com>,\n Reshma Pattan <reshma.pattan@intel.com>,\n Aman Singh <aman.deep.singh@intel.com>,\n Yuying Zhang <yuying.zhang@intel.com>,\n Maxime Coquelin <maxime.coquelin@redhat.com>,\n Chenbo Xia <chenbo.xia@intel.com>, Ray Kinsella <mdr@ashroe.eu>,\n Ferruh Yigit <ferruh.yigit@xilinx.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "Subject": "[PATCH v5 24/27] dev: introduce device accessors",
        "Date": "Mon,  5 Sep 2022 10:39:30 +0200",
        "Message-Id": "<20220905083933.2506819-25-david.marchand@redhat.com>",
        "In-Reply-To": "<20220905083933.2506819-1-david.marchand@redhat.com>",
        "References": "<20220628144643.1213026-1-david.marchand@redhat.com>\n <20220905083933.2506819-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.78 on 10.11.54.3",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "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": "Prepare for making the device object opaque by adding accessors.\nUpdate existing \"external\" users.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\nAcked-by: Bruce Richardson <bruce.richardson@intel.com>\n---\nChanges since v4:\n- updated test_vdev.c,\n\nChanges since RFC v2:\n- added rte_dev_devargs,\n- updated testpmd,\n\n---\n app/proc-info/main.c               |  6 +--\n app/test-pmd/config.c              | 18 +++----\n app/test-pmd/testpmd.c             |  6 +--\n app/test/test_vdev.c               |  4 +-\n examples/ethtool/lib/rte_ethtool.c |  2 +-\n examples/l3fwd/l3fwd_em.c          |  4 +-\n examples/l3fwd/l3fwd_fib.c         |  8 +--\n examples/l3fwd/l3fwd_lpm.c         |  4 +-\n examples/vdpa/main.c               | 16 +++---\n lib/eal/common/eal_common_dev.c    | 30 ++++++++++++\n lib/eal/include/rte_dev.h          | 78 ++++++++++++++++++++++++++++++\n lib/eal/version.map                |  7 +++\n lib/ethdev/rte_ethdev.h            |  2 +-\n 13 files changed, 150 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/app/proc-info/main.c b/app/proc-info/main.c\nindex 1bfba5f60d..d52ac8a038 100644\n--- a/app/proc-info/main.c\n+++ b/app/proc-info/main.c\n@@ -755,7 +755,7 @@ show_port(void)\n \t\t}\n \n \t\tprintf(\"\\t  -- driver %s device %s socket %d\\n\",\n-\t\t       dev_info.driver_name, dev_info.device->name,\n+\t\t       dev_info.driver_name, rte_dev_name(dev_info.device),\n \t\t       rte_eth_dev_socket_id(i));\n \n \t\tret = rte_eth_dev_owner_get(i, &owner);\n@@ -1254,7 +1254,7 @@ show_crypto(void)\n \t\t       rte_cryptodev_name_get(i),\n \t\t       dev_info.driver_name,\n \t\t       dev_info.driver_id,\n-\t\t       dev_info.device->numa_node,\n+\t\t       rte_dev_numa_node(dev_info.device),\n \t\t       rte_cryptodev_queue_pair_count(i));\n \n \t\tdisplay_crypto_feature_info(dev_info.feature_flags);\n@@ -1466,7 +1466,7 @@ dump_regs(char *file_prefix)\n \t\t\telse\n \t\t\t\tprintf(\"Device (%s) regs dumped successfully, \"\n \t\t\t\t\t\"driver:%s version:0X%08X\\n\",\n-\t\t\t\t\tdev_info.device->name,\n+\t\t\t\t\trte_dev_name(dev_info.device),\n \t\t\t\t\tdev_info.driver_name, reg_info.version);\n \n \t\t\tfclose(fp_regs);\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 6510f29c76..de74690f06 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -645,19 +645,19 @@ device_infos_display(const char *identifier)\n \t\tsnprintf(devstr, sizeof(devstr), \"bus=%s\", rte_bus_name(next));\n \t\tRTE_DEV_FOREACH(dev, devstr, &dev_iter) {\n \n-\t\t\tif (!dev->driver)\n+\t\t\tif (rte_dev_driver(dev) == NULL)\n \t\t\t\tcontinue;\n \t\t\t/* Check for matching device if identifier is present */\n \t\t\tif (identifier &&\n-\t\t\t    strncmp(da.name, dev->name, strlen(dev->name)))\n+\t\t\t    strncmp(da.name, rte_dev_name(dev), strlen(rte_dev_name(dev))))\n \t\t\t\tcontinue;\n \t\t\tprintf(\"\\n%s Infos for device %s %s\\n\",\n-\t\t\t       info_border, dev->name, info_border);\n-\t\t\tprintf(\"Bus name: %s\", rte_bus_name(dev->bus));\n-\t\t\tprintf(\"\\nDriver name: %s\", rte_driver_name(dev->driver));\n+\t\t\t       info_border, rte_dev_name(dev), info_border);\n+\t\t\tprintf(\"Bus name: %s\", rte_bus_name(rte_dev_bus(dev)));\n+\t\t\tprintf(\"\\nDriver name: %s\", rte_driver_name(rte_dev_driver(dev)));\n \t\t\tprintf(\"\\nDevargs: %s\",\n-\t\t\t       dev->devargs ? dev->devargs->args : \"\");\n-\t\t\tprintf(\"\\nConnect to socket: %d\", dev->numa_node);\n+\t\t\t       rte_dev_devargs(dev) ? rte_dev_devargs(dev)->args : \"\");\n+\t\t\tprintf(\"\\nConnect to socket: %d\", rte_dev_numa_node(dev));\n \t\t\tprintf(\"\\n\");\n \n \t\t\t/* List ports with matching device name */\n@@ -802,8 +802,8 @@ port_infos_display(portid_t port_id)\n \telse\n \t\tprintf(\"\\nFirmware-version: %s\", \"not available\");\n \n-\tif (dev_info.device->devargs && dev_info.device->devargs->args)\n-\t\tprintf(\"\\nDevargs: %s\", dev_info.device->devargs->args);\n+\tif (rte_dev_devargs(dev_info.device) && rte_dev_devargs(dev_info.device)->args)\n+\t\tprintf(\"\\nDevargs: %s\", rte_dev_devargs(dev_info.device)->args);\n \tprintf(\"\\nConnect to socket: %u\", port->socket_id);\n \n \tif (port_numa[port_id] != NUMA_NO_CONFIG) {\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex c7d1fa2719..a399193e53 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -1057,7 +1057,7 @@ dma_unmap_cb(struct rte_mempool *mp __rte_unused, void *opaque __rte_unused,\n \t\t\tTESTPMD_LOG(DEBUG,\n \t\t\t\t    \"unable to DMA unmap addr 0x%p \"\n \t\t\t\t    \"for device %s\\n\",\n-\t\t\t\t    memhdr->addr, dev_info.device->name);\n+\t\t\t\t    memhdr->addr, rte_dev_name(dev_info.device));\n \t\t}\n \t}\n \tret = rte_extmem_unregister(memhdr->addr, memhdr->len);\n@@ -1098,7 +1098,7 @@ dma_map_cb(struct rte_mempool *mp __rte_unused, void *opaque __rte_unused,\n \t\t\tTESTPMD_LOG(DEBUG,\n \t\t\t\t    \"unable to DMA map addr 0x%p \"\n \t\t\t\t    \"for device %s\\n\",\n-\t\t\t\t    memhdr->addr, dev_info.device->name);\n+\t\t\t\t    memhdr->addr, rte_dev_name(dev_info.device));\n \t\t}\n \t}\n }\n@@ -3441,7 +3441,7 @@ detach_device(struct rte_device *dev)\n \t}\n \n \tif (rte_dev_remove(dev) < 0) {\n-\t\tTESTPMD_LOG(ERR, \"Failed to detach device %s\\n\", dev->name);\n+\t\tTESTPMD_LOG(ERR, \"Failed to detach device %s\\n\", rte_dev_name(dev));\n \t\treturn;\n \t}\n \tremove_invalid_ports();\ndiff --git a/app/test/test_vdev.c b/app/test/test_vdev.c\nindex 1904e76e44..9f0e6c4b99 100644\n--- a/app/test/test_vdev.c\n+++ b/app/test/test_vdev.c\n@@ -23,7 +23,7 @@ static const char * const valid_keys[] = {\n static int\n cmp_dev_name(const struct rte_device *dev, const void *name)\n {\n-\treturn strcmp(dev->name, name);\n+\treturn strcmp(rte_dev_name(dev), name);\n }\n \n static int\n@@ -39,7 +39,7 @@ cmp_dev_match(const struct rte_device *dev, const void *_kvlist)\n \n \t/* if key is present in kvlist and does not match, filter device */\n \tname = rte_kvargs_get(kvlist, key);\n-\tif (name != NULL && strcmp(name, dev->name))\n+\tif (name != NULL && strcmp(name, rte_dev_name(dev)) != 0)\n \t\treturn -1;\n \n \treturn 0;\ndiff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c\nindex 88dc917b73..33acc5e3cc 100644\n--- a/examples/ethtool/lib/rte_ethtool.c\n+++ b/examples/ethtool/lib/rte_ethtool.c\n@@ -49,7 +49,7 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo)\n \tstrlcpy(drvinfo->driver, dev_info.driver_name,\n \t\tsizeof(drvinfo->driver));\n \tstrlcpy(drvinfo->version, rte_version(), sizeof(drvinfo->version));\n-\tstrlcpy(drvinfo->bus_info, dev_info.device->name,\n+\tstrlcpy(drvinfo->bus_info, rte_dev_name(dev_info.device),\n \t\tsizeof(drvinfo->bus_info));\n \n \tmemset(&reg_info, 0, sizeof(reg_info));\ndiff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c\nindex 10be24c61d..0531282a1f 100644\n--- a/examples/l3fwd/l3fwd_em.c\n+++ b/examples/l3fwd/l3fwd_em.c\n@@ -403,7 +403,7 @@ populate_ipv4_flow_into_table(const struct rte_hash *h)\n \t\t\t   em_route_base_v4[i].v4_key.port_dst,\n \t\t\t   em_route_base_v4[i].v4_key.port_src,\n \t\t\t   em_route_base_v4[i].v4_key.proto,\n-\t\t       em_route_base_v4[i].if_out, dev_info.device->name);\n+\t\t       em_route_base_v4[i].if_out, rte_dev_name(dev_info.device));\n \t}\n \tprintf(\"Hash: Adding 0x%\" PRIx64 \" keys\\n\",\n \t\t(uint64_t)route_num_v4);\n@@ -455,7 +455,7 @@ populate_ipv6_flow_into_table(const struct rte_hash *h)\n \t\t\t   em_route_base_v6[i].v6_key.port_dst,\n \t\t\t   em_route_base_v6[i].v6_key.port_src,\n \t\t\t   em_route_base_v6[i].v6_key.proto,\n-\t\t       em_route_base_v6[i].if_out, dev_info.device->name);\n+\t\t       em_route_base_v6[i].if_out, rte_dev_name(dev_info.device));\n \t}\n \tprintf(\"Hash: Adding 0x%\" PRIx64 \"keys\\n\",\n \t\t(uint64_t)route_num_v6);\ndiff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c\nindex e02e4b3f5a..b82e0c0354 100644\n--- a/examples/l3fwd/l3fwd_fib.c\n+++ b/examples/l3fwd/l3fwd_fib.c\n@@ -640,11 +640,11 @@ setup_fib(const int socketid)\n \t\t\tprintf(\"FIB: Adding route %s / %d (%d) [%s]\\n\", abuf,\n \t\t\t       route_base_v4[i].depth,\n \t\t\t       route_base_v4[i].if_out,\n-\t\t\t       dev_info.device->name);\n+\t\t\t       rte_dev_name(dev_info.device));\n \t\t} else {\n \t\t\tprintf(\"FIB: IPv4 route added to port %d [%s]\\n\",\n \t\t\t       route_base_v4[i].if_out,\n-\t\t\t       dev_info.device->name);\n+\t\t\t       rte_dev_name(dev_info.device));\n \t\t}\n \t}\n \t/* >8 End of setup fib. */\n@@ -695,11 +695,11 @@ setup_fib(const int socketid)\n \t\t\tprintf(\"FIB: Adding route %s / %d (%d) [%s]\\n\", abuf,\n \t\t\t       route_base_v6[i].depth,\n \t\t\t       route_base_v6[i].if_out,\n-\t\t\t       dev_info.device->name);\n+\t\t\t       rte_dev_name(dev_info.device));\n \t\t} else {\n \t\t\tprintf(\"FIB: IPv6 route added to port %d [%s]\\n\",\n \t\t\t       route_base_v6[i].if_out,\n-\t\t\t       dev_info.device->name);\n+\t\t\t       rte_dev_name(dev_info.device));\n \t\t}\n \t}\n }\ndiff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c\nindex d1b850dd5b..22d7f61a42 100644\n--- a/examples/l3fwd/l3fwd_lpm.c\n+++ b/examples/l3fwd/l3fwd_lpm.c\n@@ -598,7 +598,7 @@ setup_lpm(const int socketid)\n \t\tprintf(\"LPM: Adding route %s / %d (%d) [%s]\\n\",\n \t\t       inet_ntop(AF_INET, &in, abuf, sizeof(abuf)),\n \t\t       route_base_v4[i].depth,\n-\t\t       route_base_v4[i].if_out, dev_info.device->name);\n+\t\t       route_base_v4[i].if_out, rte_dev_name(dev_info.device));\n \t}\n \n \t/* create the LPM6 table */\n@@ -642,7 +642,7 @@ setup_lpm(const int socketid)\n \t\t       inet_ntop(AF_INET6, route_base_v6[i].ip_8, abuf,\n \t\t\t\t sizeof(abuf)),\n \t\t       route_base_v6[i].depth,\n-\t\t       route_base_v6[i].if_out, dev_info.device->name);\n+\t\t       route_base_v6[i].if_out, rte_dev_name(dev_info.device));\n \t}\n }\n \ndiff --git a/examples/vdpa/main.c b/examples/vdpa/main.c\nindex 7e11ef4e26..ee240dd15a 100644\n--- a/examples/vdpa/main.c\n+++ b/examples/vdpa/main.c\n@@ -119,7 +119,7 @@ new_device(int vid)\n \t\t\t\t\"Failed to get generic device for port %d\\n\", i);\n \t\t\tcontinue;\n \t\t}\n-\t\tprintf(\"\\nnew port %s, device : %s\\n\", ifname, dev->name);\n+\t\tprintf(\"\\nnew port %s, device : %s\\n\", ifname, rte_dev_name(dev));\n \t\tvports[i].vid = vid;\n \t\tbreak;\n \t}\n@@ -149,7 +149,7 @@ destroy_device(int vid)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tprintf(\"\\ndestroy port %s, device: %s\\n\", ifname, dev->name);\n+\t\tprintf(\"\\ndestroy port %s, device: %s\\n\", ifname, rte_dev_name(dev));\n \t\tbreak;\n \t}\n }\n@@ -353,23 +353,23 @@ static void cmd_list_vdpa_devices_parsed(\n \n \tcmdline_printf(cl, \"device name\\tqueue num\\tsupported features\\n\");\n \tRTE_DEV_FOREACH(dev, \"class=vdpa\", &dev_iter) {\n-\t\tvdev = rte_vdpa_find_device_by_name(dev->name);\n+\t\tvdev = rte_vdpa_find_device_by_name(rte_dev_name(dev));\n \t\tif (!vdev)\n \t\t\tcontinue;\n \t\tif (rte_vdpa_get_queue_num(vdev, &queue_num) < 0) {\n \t\t\tRTE_LOG(ERR, VDPA,\n \t\t\t\t\"failed to get vdpa queue number \"\n-\t\t\t\t\"for device %s.\\n\", dev->name);\n+\t\t\t\t\"for device %s.\\n\", rte_dev_name(dev));\n \t\t\tcontinue;\n \t\t}\n \t\tif (rte_vdpa_get_features(vdev, &features) < 0) {\n \t\t\tRTE_LOG(ERR, VDPA,\n \t\t\t\t\"failed to get vdpa features \"\n-\t\t\t\t\"for device %s.\\n\", dev->name);\n+\t\t\t\t\"for device %s.\\n\", rte_dev_name(dev));\n \t\t\tcontinue;\n \t\t}\n \t\tcmdline_printf(cl, \"%s\\t\\t%\" PRIu32 \"\\t\\t0x%\" PRIx64 \"\\n\",\n-\t\t\tdev->name, queue_num, features);\n+\t\t\trte_dev_name(dev), queue_num, features);\n \t}\n }\n \n@@ -606,10 +606,10 @@ main(int argc, char *argv[])\n \t\tcmdline_stdin_exit(cl);\n \t} else {\n \t\tRTE_DEV_FOREACH(dev, \"class=vdpa\", &dev_iter) {\n-\t\t\tvdev = rte_vdpa_find_device_by_name(dev->name);\n+\t\t\tvdev = rte_vdpa_find_device_by_name(rte_dev_name(dev));\n \t\t\tif (vdev == NULL) {\n \t\t\t\trte_panic(\"Failed to find vDPA dev for %s\\n\",\n-\t\t\t\t\t\tdev->name);\n+\t\t\t\t\t\trte_dev_name(dev));\n \t\t\t}\n \t\t\tvports[devcnt].dev = vdev;\n \t\t\tsnprintf(vports[devcnt].ifname, MAX_PATH_LEN, \"%s%d\",\ndiff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c\nindex 98f3c78795..7b12d6e531 100644\n--- a/lib/eal/common/eal_common_dev.c\n+++ b/lib/eal/common/eal_common_dev.c\n@@ -25,6 +25,36 @@ rte_driver_name(const struct rte_driver *driver)\n \treturn driver->name;\n }\n \n+const struct rte_bus *\n+rte_dev_bus(const struct rte_device *dev)\n+{\n+\treturn dev->bus;\n+}\n+\n+const struct rte_devargs *\n+rte_dev_devargs(const struct rte_device *dev)\n+{\n+\treturn dev->devargs;\n+}\n+\n+const struct rte_driver *\n+rte_dev_driver(const struct rte_device *dev)\n+{\n+\treturn dev->driver;\n+}\n+\n+const char *\n+rte_dev_name(const struct rte_device *dev)\n+{\n+\treturn dev->name;\n+}\n+\n+int\n+rte_dev_numa_node(const struct rte_device *dev)\n+{\n+\treturn dev->numa_node;\n+}\n+\n /**\n  * The device event callback description.\n  *\ndiff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h\nindex 7214f5d7fb..ce97ee1086 100644\n--- a/lib/eal/include/rte_dev.h\n+++ b/lib/eal/include/rte_dev.h\n@@ -24,6 +24,9 @@ extern \"C\" {\n #include <rte_compat.h>\n #include <rte_log.h>\n \n+struct rte_bus;\n+struct rte_devargs;\n+struct rte_device;\n struct rte_driver;\n \n /**\n@@ -80,6 +83,81 @@ struct rte_mem_resource {\n const char *\n rte_driver_name(const struct rte_driver *driver);\n \n+/**\n+ * Retrieve a device bus.\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * @param dev\n+ *   A pointer to a device structure.\n+ * @return\n+ *   A pointer to this device bus.\n+ */\n+__rte_experimental\n+const struct rte_bus *\n+rte_dev_bus(const struct rte_device *dev);\n+\n+/**\n+ * Retrieve a device arguments.\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * @param dev\n+ *   A pointer to a device structure.\n+ * @return\n+ *   A pointer to this device devargs.\n+ */\n+__rte_experimental\n+const struct rte_devargs *\n+rte_dev_devargs(const struct rte_device *dev);\n+\n+/**\n+ * Retrieve a device driver.\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * @param dev\n+ *   A pointer to a device structure.\n+ * @return\n+ *   A pointer to this device driver.\n+ */\n+__rte_experimental\n+const struct rte_driver *\n+rte_dev_driver(const struct rte_device *dev);\n+\n+/**\n+ * Retrieve a device name.\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * @param dev\n+ *   A pointer to a device structure.\n+ * @return\n+ *   A pointer to this device name.\n+ */\n+__rte_experimental\n+const char *\n+rte_dev_name(const struct rte_device *dev);\n+\n+/**\n+ * Retrieve a device numa node.\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * @param dev\n+ *   A pointer to a device structure.\n+ * @return\n+ *   A pointer to this device numa node.\n+ */\n+__rte_experimental\n+int\n+rte_dev_numa_node(const struct rte_device *dev);\n+\n /*\n  * Internal identifier length\n  * Sufficiently large to allow for UUID or PCI address\ndiff --git a/lib/eal/version.map b/lib/eal/version.map\nindex 8b53a1d258..719789b8d1 100644\n--- a/lib/eal/version.map\n+++ b/lib/eal/version.map\n@@ -424,6 +424,13 @@ EXPERIMENTAL {\n \trte_thread_self;\n \trte_thread_set_affinity_by_id;\n \trte_thread_set_priority;\n+\n+\t# added in 22.11\n+\trte_dev_bus;\n+\trte_dev_devargs;\n+\trte_dev_driver;\n+\trte_dev_name;\n+\trte_dev_numa_node;\n };\n \n INTERNAL {\ndiff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h\nindex 7556b94602..2e783536c1 100644\n--- a/lib/ethdev/rte_ethdev.h\n+++ b/lib/ethdev/rte_ethdev.h\n@@ -3380,7 +3380,7 @@ int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma,\n  * exists for the device and the rte_eth_dev 'dev' has been populated\n  * successfully with a call to it:\n  *\n- * driver_name = rte_driver_name(dev->device->driver)\n+ * driver_name = rte_driver_name(rte_dev_driver(dev->device));\n  * nb_rx_queues = dev->data->nb_rx_queues\n  * nb_tx_queues = dev->data->nb_tx_queues\n  * dev_flags = &dev->data->dev_flags\n",
    "prefixes": [
        "v5",
        "24/27"
    ]
}