get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 48748,
    "url": "https://patches.dpdk.org/api/patches/48748/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20181213100910.13087-2-xiao.w.wang@intel.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": "<20181213100910.13087-2-xiao.w.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181213100910.13087-2-xiao.w.wang@intel.com",
    "date": "2018-12-13T10:09:02",
    "name": "[v3,1/9] vhost: provide helper for host notifier ctrl",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9e0038c7418b106a41063d1f0330b37089892827",
    "submitter": {
        "id": 281,
        "url": "https://patches.dpdk.org/api/people/281/?format=api",
        "name": "Xiao Wang",
        "email": "xiao.w.wang@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20181213100910.13087-2-xiao.w.wang@intel.com/mbox/",
    "series": [
        {
            "id": 2755,
            "url": "https://patches.dpdk.org/api/series/2755/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2755",
            "date": "2018-12-13T10:09:01",
            "name": "support SW assisted VDPA live migration",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/2755/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/48748/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/48748/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8E2C61B4DB;\n\tThu, 13 Dec 2018 11:19:23 +0100 (CET)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id EE76C5A6E\n\tfor <dev@dpdk.org>; Thu, 13 Dec 2018 11:19:20 +0100 (CET)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Dec 2018 02:19:20 -0800",
            "from dpdk-xiao-1.sh.intel.com ([10.67.111.145])\n\tby orsmga008.jf.intel.com with ESMTP; 13 Dec 2018 02:19:18 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,348,1539673200\"; d=\"scan'208\";a=\"101210390\"",
        "From": "Xiao Wang <xiao.w.wang@intel.com>",
        "To": "alejandro.lucero@netronome.com,\n\ttiwei.bie@intel.com",
        "Cc": "maxime.coquelin@redhat.com, dev@dpdk.org, zhihong.wang@intel.com,\n\txiaolong.ye@intel.com, Xiao Wang <xiao.w.wang@intel.com>",
        "Date": "Thu, 13 Dec 2018 18:09:02 +0800",
        "Message-Id": "<20181213100910.13087-2-xiao.w.wang@intel.com>",
        "X-Mailer": "git-send-email 2.15.1",
        "In-Reply-To": "<20181213100910.13087-1-xiao.w.wang@intel.com>",
        "References": "<20181213011014.110089-3-xiao.w.wang@intel.com>\n\t<20181213100910.13087-1-xiao.w.wang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 1/9] vhost: provide helper for host notifier\n\tctrl",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "VDPA driver can decide if it needs to enable/disable the host notifier\nmapping, so exposing a API can allow flexibility. A later patch will\nbase on this.\n\nSigned-off-by: Xiao Wang <xiao.w.wang@intel.com>\n---\nv2:\n* Reword the vdpa host notifier control API comment.\n---\n drivers/net/ifc/ifcvf_vdpa.c           |  3 +++\n lib/librte_vhost/rte_vdpa.h            | 18 ++++++++++++++++++\n lib/librte_vhost/rte_vhost_version.map |  1 +\n lib/librte_vhost/vhost.c               |  3 +--\n lib/librte_vhost/vhost_user.c          |  7 +------\n 5 files changed, 24 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c\nindex 97a57f182..e844109f3 100644\n--- a/drivers/net/ifc/ifcvf_vdpa.c\n+++ b/drivers/net/ifc/ifcvf_vdpa.c\n@@ -556,6 +556,9 @@ ifcvf_dev_config(int vid)\n \trte_atomic32_set(&internal->dev_attached, 1);\n \tupdate_datapath(internal);\n \n+\tif (rte_vhost_host_notifier_ctrl(vid, true) != 0)\n+\t\tDRV_LOG(NOTICE, \"vDPA (%d): software relay is used.\", did);\n+\n \treturn 0;\n }\n \ndiff --git a/lib/librte_vhost/rte_vdpa.h b/lib/librte_vhost/rte_vdpa.h\nindex a418da47c..fff657391 100644\n--- a/lib/librte_vhost/rte_vdpa.h\n+++ b/lib/librte_vhost/rte_vdpa.h\n@@ -11,6 +11,8 @@\n  * Device specific vhost lib\n  */\n \n+#include <stdbool.h>\n+\n #include <rte_pci.h>\n #include \"rte_vhost.h\"\n \n@@ -155,4 +157,20 @@ rte_vdpa_get_device(int did);\n  */\n int __rte_experimental\n rte_vdpa_get_device_num(void);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Enable/Disable host notifier mapping for a vdpa port.\n+ *\n+ * @param vid\n+ *  vhost device id\n+ * @enable\n+ *  true for host notifier map, false for host notifier unmap\n+ * @return\n+ *  0 on success, -1 on failure\n+ */\n+int __rte_experimental\n+rte_vhost_host_notifier_ctrl(int vid, bool enable);\n #endif /* _RTE_VDPA_H_ */\ndiff --git a/lib/librte_vhost/rte_vhost_version.map b/lib/librte_vhost/rte_vhost_version.map\nindex ae39b6e21..22302e972 100644\n--- a/lib/librte_vhost/rte_vhost_version.map\n+++ b/lib/librte_vhost/rte_vhost_version.map\n@@ -83,4 +83,5 @@ EXPERIMENTAL {\n \trte_vhost_crypto_finalize_requests;\n \trte_vhost_crypto_set_zero_copy;\n \trte_vhost_va_from_guest_pa;\n+\trte_vhost_host_notifier_ctrl;\n };\ndiff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c\nindex 70ac6bc9c..e7a60e0b4 100644\n--- a/lib/librte_vhost/vhost.c\n+++ b/lib/librte_vhost/vhost.c\n@@ -408,8 +408,7 @@ vhost_detach_vdpa_device(int vid)\n \tif (dev == NULL)\n \t\treturn;\n \n-\tvhost_user_host_notifier_ctrl(vid, false);\n-\n+\tvhost_destroy_device_notify(dev);\n \tdev->vdpa_dev_id = -1;\n }\n \ndiff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex 3ea64eba6..5e0da0589 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -2045,11 +2045,6 @@ vhost_user_msg_handler(int vid, int fd)\n \t\tif (vdpa_dev->ops->dev_conf)\n \t\t\tvdpa_dev->ops->dev_conf(dev->vid);\n \t\tdev->flags |= VIRTIO_DEV_VDPA_CONFIGURED;\n-\t\tif (vhost_user_host_notifier_ctrl(dev->vid, true) != 0) {\n-\t\t\tRTE_LOG(INFO, VHOST_CONFIG,\n-\t\t\t\t\"(%d) software relay is used for vDPA, performance may be low.\\n\",\n-\t\t\t\tdev->vid);\n-\t\t}\n \t}\n \n \treturn 0;\n@@ -2144,7 +2139,7 @@ static int vhost_user_slave_set_vring_host_notifier(struct virtio_net *dev,\n \treturn process_slave_message_reply(dev, &msg);\n }\n \n-int vhost_user_host_notifier_ctrl(int vid, bool enable)\n+int rte_vhost_host_notifier_ctrl(int vid, bool enable)\n {\n \tstruct virtio_net *dev;\n \tstruct rte_vdpa_device *vdpa_dev;\n",
    "prefixes": [
        "v3",
        "1/9"
    ]
}