get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 134254,
    "url": "http://patchwork.dpdk.org/api/patches/134254/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20231114102300.409158-1-mingjinx.ye@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20231114102300.409158-1-mingjinx.ye@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231114102300.409158-1-mingjinx.ye@intel.com",
    "date": "2023-11-14T10:23:00",
    "name": "vfio: add get device info API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c3b6ac45d974351fd1ab93a83fa7ef65e592f034",
    "submitter": {
        "id": 2862,
        "url": "http://patchwork.dpdk.org/api/people/2862/?format=api",
        "name": "Mingjin Ye",
        "email": "mingjinx.ye@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20231114102300.409158-1-mingjinx.ye@intel.com/mbox/",
    "series": [
        {
            "id": 30287,
            "url": "http://patchwork.dpdk.org/api/series/30287/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=30287",
            "date": "2023-11-14T10:23:00",
            "name": "vfio: add get device info API",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/30287/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/134254/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/134254/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 23D3D43326;\n\tTue, 14 Nov 2023 11:38:14 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0C0434027D;\n\tTue, 14 Nov 2023 11:38:14 +0100 (CET)",
            "from mgamail.intel.com (mgamail.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id A037F4027B;\n Tue, 14 Nov 2023 11:38:12 +0100 (CET)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Nov 2023 02:38:11 -0800",
            "from unknown (HELO localhost.localdomain) ([10.239.252.253])\n by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Nov 2023 02:38:09 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1699958292; x=1731494292;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=oFsHjZJuusbFVtD09ho7788IdxmEY5gAqTJAh9OzzLM=;\n b=CYceW8IGk8NLdy9Zih5d1FRIMBYglf9uWRqEDZ1CH84x2EA4voFKBvVU\n bGCm9eyXJsOpMFo5O92MLNZHDxuguQwQYHlwTW+BAWfeemouIKx0ihtwB\n 68qMeOptBYeEpgKedYhtJfyb+9b4Ly9mwIEDqoRPCEMhWgyWQIOvDpPWv\n LuIgytsTyO5yD3hMT0IYx/IlC2V84M9uXmN9zGDXFfVbS8S3l0yvowwmp\n eEAFxcFhBHwnhhhnSmk1ZO/dxbtVaj8pE+qe6rld+SLgWR/N/vJwYvVTP\n MQUoMJs8gaF/z1HZ+XPFvnOvkIluyqnnJawcn5DvgeA4tjRl1jO0BDpI0 Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10893\"; a=\"370826386\"",
            "E=Sophos;i=\"6.03,301,1694761200\"; d=\"scan'208\";a=\"370826386\"",
            "E=McAfee;i=\"6600,9927,10893\"; a=\"768218233\"",
            "E=Sophos;i=\"6.03,301,1694761200\"; d=\"scan'208\";a=\"768218233\""
        ],
        "X-ExtLoop1": "1",
        "From": "Mingjin Ye <mingjinx.ye@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, Mingjin Ye <mingjinx.ye@intel.com>,\n stable@dpdk.org,\n Anatoly Burakov <anatoly.burakov@intel.com>",
        "Subject": "[PATCH] vfio: add get device info API",
        "Date": "Tue, 14 Nov 2023 10:23:00 +0000",
        "Message-Id": "<20231114102300.409158-1-mingjinx.ye@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "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": "This patch adds an API to support getting device information.\n\nThe driver can use the \"rte_vfio_get_device_info\" helper to get\ndevice information from EAL.\n\nCc: stable@dpdk.org\n\nSigned-off-by: Mingjin Ye <mingjinx.ye@intel.com>\n---\n lib/eal/include/rte_vfio.h | 26 ++++++++++++++++++++++++++\n lib/eal/linux/eal_vfio.c   | 19 +++++++++++++++++++\n lib/eal/version.map        |  3 +++\n 3 files changed, 48 insertions(+)",
    "diff": "diff --git a/lib/eal/include/rte_vfio.h b/lib/eal/include/rte_vfio.h\nindex 3487c4f2a2..b3f55963e3 100644\n--- a/lib/eal/include/rte_vfio.h\n+++ b/lib/eal/include/rte_vfio.h\n@@ -212,6 +212,32 @@ int\n rte_vfio_get_group_num(const char *sysfs_base,\n \t\t      const char *dev_addr, int *iommu_group_num);\n \n+/**\n+ * Get device information\n+ *\n+ * This function is only relevant to linux and will return\n+ * an error on BSD.\n+ *\n+ * @param sysfs_base\n+ *   sysfs path prefix.\n+ *\n+ * @param dev_addr\n+ *   device location.\n+ *\n+ * @param vfio_dev_fd\n+ *   VFIO fd.\n+ *\n+ * @param device_info\n+ *   Device information.\n+ *\n+ * @return\n+ *   0 on success.\n+ *   <0 on failure.\n+ */\n+int\n+rte_vfio_get_device_info(const char *sysfs_base, const char *dev_addr,\n+\t\t\tint *vfio_dev_fd, struct vfio_device_info *device_info);\n+\n /**\n  * Open a new VFIO container fd\n  *\ndiff --git a/lib/eal/linux/eal_vfio.c b/lib/eal/linux/eal_vfio.c\nindex ad3c1654b2..5810d9fcd7 100644\n--- a/lib/eal/linux/eal_vfio.c\n+++ b/lib/eal/linux/eal_vfio.c\n@@ -1222,6 +1222,25 @@ vfio_set_iommu_type(int vfio_container_fd)\n \treturn NULL;\n }\n \n+int\n+rte_vfio_get_device_info(const char *sysfs_base, const char *dev_addr,\n+\t\t\tint *vfio_dev_fd, struct vfio_device_info *device_info)\n+{\n+\tif (!device_info || *vfio_dev_fd < 0)\n+\t\treturn -1;\n+\n+\tif (*vfio_dev_fd == 0) {\n+\t\tif (rte_vfio_setup_device(sysfs_base, dev_addr,\n+\t\t\t\tvfio_dev_fd, device_info))\n+\t\t\treturn -1;\n+\t} else {\n+\t\tif (ioctl(*vfio_dev_fd, VFIO_DEVICE_GET_INFO, &device_info))\n+\t\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n int\n vfio_has_supported_extensions(int vfio_container_fd)\n {\ndiff --git a/lib/eal/version.map b/lib/eal/version.map\nindex e00a844805..8a211aaefd 100644\n--- a/lib/eal/version.map\n+++ b/lib/eal/version.map\n@@ -413,6 +413,9 @@ EXPERIMENTAL {\n \t# added in 23.07\n \trte_memzone_max_get;\n \trte_memzone_max_set;\n+\n+\t# added in 23.11\n+\trte_vfio_get_device_info; # WINDOWS_NO_EXPORT\n };\n \n INTERNAL {\n",
    "prefixes": []
}