get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 118412,
    "url": "http://patches.dpdk.org/api/patches/118412/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1666094871-25721-11-git-send-email-andy.pei@intel.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": "<1666094871-25721-11-git-send-email-andy.pei@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1666094871-25721-11-git-send-email-andy.pei@intel.com",
    "date": "2022-10-18T12:07:49",
    "name": "[v8,10/12] vhost: add type to rte vdpa device",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ad408cce269ea5c3b3202e36379764526a5ee913",
    "submitter": {
        "id": 1185,
        "url": "http://patches.dpdk.org/api/people/1185/?format=api",
        "name": "Pei, Andy",
        "email": "andy.pei@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1666094871-25721-11-git-send-email-andy.pei@intel.com/mbox/",
    "series": [
        {
            "id": 25282,
            "url": "http://patches.dpdk.org/api/series/25282/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25282",
            "date": "2022-10-18T12:07:39",
            "name": "vdpa/ifc: add multi queue support",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/25282/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/118412/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/118412/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 66FE9A0560;\n\tTue, 18 Oct 2022 14:59:17 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6B33342905;\n\tTue, 18 Oct 2022 14:58:40 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id ADECB4114E\n for <dev@dpdk.org>; Tue, 18 Oct 2022 14:58:34 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 Oct 2022 05:58:31 -0700",
            "from dpdk-dipei.sh.intel.com ([10.67.110.251])\n by fmsmga002.fm.intel.com with ESMTP; 18 Oct 2022 05:58:29 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1666097914; x=1697633914;\n h=from:to:cc:subject:date:message-id:in-reply-to: references;\n bh=rmntRoYemBdBkVYAkztI3VB+WJhfNvZrUw0KxUA9b9Q=;\n b=g6J6w/FfCyN+xunNUsehizla2TroLW9EOGjbvoeg3vw6GMTd0Q47Q7nK\n VkuzGyH2eeN9R4i0aJvRie5AmLpqdqHfLO8IDl2iWnpcJlAmB2SLMPz8i\n EIPM7rTHPKBKTdO0G2DeWiZaf3GjfL74UikNbIt4zxOsRwhcux/dB8w+k\n esQr5dyrTPCSW9ztP98f1BX5FyZraq28s+whIXYO0BzrfDvAOkOzwg9GV\n QkH57A2KNRSTbp4x1t3X7S+9px3g4WBV7sUR46qYfHfrp1EwZqlkTGJCe\n 3x3ktYzX8dui+moRbPqI8uyayoqxz1iiQV4Nhaf6EpaDD8ByPuIhjpqL/ w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10504\"; a=\"307179504\"",
            "E=Sophos;i=\"5.95,193,1661842800\"; d=\"scan'208\";a=\"307179504\"",
            "E=McAfee;i=\"6500,9779,10504\"; a=\"733614547\"",
            "E=Sophos;i=\"5.95,193,1661842800\"; d=\"scan'208\";a=\"733614547\""
        ],
        "X-ExtLoop1": "1",
        "From": "Andy Pei <andy.pei@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "chenbo.xia@intel.com, rosen.xu@intel.com, wei.huang@intel.com,\n gang.cao@intel.com, maxime.coquelin@redhat.com",
        "Subject": "[PATCH v8 10/12] vhost: add type to rte vdpa device",
        "Date": "Tue, 18 Oct 2022 20:07:49 +0800",
        "Message-Id": "<1666094871-25721-11-git-send-email-andy.pei@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1666094871-25721-1-git-send-email-andy.pei@intel.com>",
        "References": "<1661229305-240952-2-git-send-email-andy.pei@intel.com>\n <1666094871-25721-1-git-send-email-andy.pei@intel.com>",
        "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": "Add type to rte_vdpa_device to store device type.\nCall vdpa ops get_dev_type to fill type when register\nvdpa device.\n\nSigned-off-by: Andy Pei <andy.pei@intel.com>\n---\n lib/vhost/socket.c      | 15 +--------------\n lib/vhost/vdpa.c        | 15 +++++++++++++++\n lib/vhost/vdpa_driver.h |  2 ++\n 3 files changed, 18 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c\nindex 608ae57..863a6f6 100644\n--- a/lib/vhost/socket.c\n+++ b/lib/vhost/socket.c\n@@ -627,7 +627,6 @@ struct rte_vdpa_device *\n {\n \tstruct vhost_user_socket *vsocket;\n \tstruct rte_vdpa_device *vdpa_dev;\n-\tuint32_t vdpa_type = 0;\n \tint ret = 0;\n \n \tpthread_mutex_lock(&vhost_user.mutex);\n@@ -644,19 +643,7 @@ struct rte_vdpa_device *\n \t\tgoto unlock_exit;\n \t}\n \n-\tif (vdpa_dev->ops->get_dev_type) {\n-\t\tret = vdpa_dev->ops->get_dev_type(vdpa_dev, &vdpa_type);\n-\t\tif (ret) {\n-\t\t\tVHOST_LOG_CONFIG(path, ERR,\n-\t\t\t\t\"failed to get vdpa dev type for socket file.\\n\");\n-\t\t\tret = -1;\n-\t\t\tgoto unlock_exit;\n-\t\t}\n-\t} else {\n-\t\tvdpa_type = RTE_VHOST_VDPA_DEVICE_TYPE_NET;\n-\t}\n-\n-\t*type = vdpa_type;\n+\t*type = vdpa_dev->type;\n \n unlock_exit:\n \tpthread_mutex_unlock(&vhost_user.mutex);\ndiff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c\nindex bb82857..577cb00 100644\n--- a/lib/vhost/vdpa.c\n+++ b/lib/vhost/vdpa.c\n@@ -73,6 +73,7 @@ struct rte_vdpa_device *\n \t\tstruct rte_vdpa_dev_ops *ops)\n {\n \tstruct rte_vdpa_device *dev;\n+\tint ret = 0;\n \n \tif (ops == NULL)\n \t\treturn NULL;\n@@ -101,6 +102,20 @@ struct rte_vdpa_device *\n \n \tdev->device = rte_dev;\n \tdev->ops = ops;\n+\n+\tif (ops->get_dev_type) {\n+\t\tret = ops->get_dev_type(dev, &dev->type);\n+\t\tif (ret) {\n+\t\t\tVHOST_LOG_CONFIG(rte_dev->name, ERR,\n+\t\t\t\t\t \"Failed to get vdpa dev type.\\n\");\n+\t\t\tret = -1;\n+\t\t\tgoto out_unlock;\n+\t\t}\n+\t} else {\n+\t\t/** by default, we assume vdpa device is a net device */\n+\t\tdev->type = RTE_VHOST_VDPA_DEVICE_TYPE_NET;\n+\t}\n+\n \tTAILQ_INSERT_TAIL(&vdpa_device_list, dev, next);\n out_unlock:\n \trte_spinlock_unlock(&vdpa_device_list_lock);\ndiff --git a/lib/vhost/vdpa_driver.h b/lib/vhost/vdpa_driver.h\nindex 8b88a53..8db4ab9 100644\n--- a/lib/vhost/vdpa_driver.h\n+++ b/lib/vhost/vdpa_driver.h\n@@ -92,6 +92,8 @@ struct rte_vdpa_device {\n \tstruct rte_device *device;\n \t/** vdpa device operations */\n \tstruct rte_vdpa_dev_ops *ops;\n+\t/** vdpa device type: net, blk... */\n+\tuint32_t type;\n };\n \n /**\n",
    "prefixes": [
        "v8",
        "10/12"
    ]
}