get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78145,
    "url": "https://patches.dpdk.org/api/patches/78145/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200921064837.15957-2-yong.liu@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": "<20200921064837.15957-2-yong.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200921064837.15957-2-yong.liu@intel.com",
    "date": "2020-09-21T06:48:33",
    "name": "[v2,1/5] vhost: add vectorized data path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9b48468b47a9fd63fca713cbf79ce7aa09a344dd",
    "submitter": {
        "id": 17,
        "url": "https://patches.dpdk.org/api/people/17/?format=api",
        "name": "Marvin Liu",
        "email": "yong.liu@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/20200921064837.15957-2-yong.liu@intel.com/mbox/",
    "series": [
        {
            "id": 12370,
            "url": "https://patches.dpdk.org/api/series/12370/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12370",
            "date": "2020-09-21T06:48:32",
            "name": "vhost add vectorized data path",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/12370/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/78145/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/78145/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 6B66FA04B7;\n\tMon, 21 Sep 2020 08:53:03 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DF0341D946;\n\tMon, 21 Sep 2020 08:52:58 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id CDF861D914\n for <dev@dpdk.org>; Mon, 21 Sep 2020 08:52:55 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Sep 2020 23:52:55 -0700",
            "from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.56])\n by fmsmga001.fm.intel.com with ESMTP; 20 Sep 2020 23:52:52 -0700"
        ],
        "IronPort-SDR": [
            "\n FIiBVA3BJ8pecvZXYnEWV8K1jv3mlJxqDUmbQgdO+Y0r+Rki1Db4o3lVIwICZDLn4dF0ex61JD\n KRVQYVU/HI/g==",
            "\n fRwj87LKGLZP9NjYfKpFQVWNpHsYHtc/JBiuTBmCvj0yTRmozy00vCk03J1+j9t4DNemRjXki3\n MAveLK/LeExw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9750\"; a=\"148073414\"",
            "E=Sophos;i=\"5.77,285,1596524400\"; d=\"scan'208\";a=\"148073414\"",
            "E=Sophos;i=\"5.77,285,1596524400\"; d=\"scan'208\";a=\"412078401\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Marvin Liu <yong.liu@intel.com>",
        "To": "maxime.coquelin@redhat.com, chenbo.xia@intel.com, zhihong.wang@intel.com",
        "Cc": "dev@dpdk.org,\n\tMarvin Liu <yong.liu@intel.com>",
        "Date": "Mon, 21 Sep 2020 14:48:33 +0800",
        "Message-Id": "<20200921064837.15957-2-yong.liu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200921064837.15957-1-yong.liu@intel.com>",
        "References": "<20200819032414.51430-2-yong.liu@intel.com>\n <20200921064837.15957-1-yong.liu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/5] vhost: add vectorized data path",
        "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 <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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Packed ring operations are split into batch and single functions for\nperformance perspective. Ring operations in batch function can be\naccelerated by SIMD instructions like AVX512.\n\nSo introduce vectorized parameter in vhost. Vectorized data path can be\nselected if platform and ring format matched requirements. Otherwise\nwill fallback to original data path.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>",
    "diff": "diff --git a/doc/guides/nics/vhost.rst b/doc/guides/nics/vhost.rst\nindex d36f3120b2..efdaf4de09 100644\n--- a/doc/guides/nics/vhost.rst\n+++ b/doc/guides/nics/vhost.rst\n@@ -64,6 +64,11 @@ The user can specify below arguments in `--vdev` option.\n     It is used to enable external buffer support in vhost library.\n     (Default: 0 (disabled))\n \n+#.  ``vectorized``:\n+\n+    It is used to enable vectorized data path support in vhost library.\n+    (Default: 0 (disabled))\n+\n Vhost PMD event handling\n ------------------------\n \ndiff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst\nindex b892eec67a..d5d421441c 100644\n--- a/doc/guides/prog_guide/vhost_lib.rst\n+++ b/doc/guides/prog_guide/vhost_lib.rst\n@@ -162,6 +162,18 @@ The following is an overview of some key Vhost API functions:\n \n     It is disabled by default.\n \n+ - ``RTE_VHOST_USER_VECTORIZED``\n+    Vectorized data path will used when this flag is set. When packed ring\n+    enabled, available descriptors are stored from frontend driver in sequence.\n+    SIMD instructions like AVX can be used to handle multiple descriptors\n+    simultaneously. Thus can accelerate the throughput of ring operations.\n+\n+    * Only packed ring has vectorized data path.\n+\n+    * Will fallback to normal datapath if no vectorization support.\n+\n+    It is disabled by default.\n+\n * ``rte_vhost_driver_set_features(path, features)``\n \n   This function sets the feature bits the vhost-user driver supports. The\ndiff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex e55278af69..2ba5a2a076 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -35,6 +35,7 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};\n #define ETH_VHOST_VIRTIO_NET_F_HOST_TSO \"tso\"\n #define ETH_VHOST_LINEAR_BUF  \"linear-buffer\"\n #define ETH_VHOST_EXT_BUF  \"ext-buffer\"\n+#define ETH_VHOST_VECTORIZED \"vectorized\"\n #define VHOST_MAX_PKT_BURST 32\n \n static const char *valid_arguments[] = {\n@@ -47,6 +48,7 @@ static const char *valid_arguments[] = {\n \tETH_VHOST_VIRTIO_NET_F_HOST_TSO,\n \tETH_VHOST_LINEAR_BUF,\n \tETH_VHOST_EXT_BUF,\n+\tETH_VHOST_VECTORIZED,\n \tNULL\n };\n \n@@ -1507,6 +1509,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)\n \tint tso = 0;\n \tint linear_buf = 0;\n \tint ext_buf = 0;\n+\tint vectorized = 0;\n \tstruct rte_eth_dev *eth_dev;\n \tconst char *name = rte_vdev_device_name(dev);\n \n@@ -1626,6 +1629,17 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)\n \t\t\tflags |= RTE_VHOST_USER_EXTBUF_SUPPORT;\n \t}\n \n+\tif (rte_kvargs_count(kvlist, ETH_VHOST_VECTORIZED) == 1) {\n+\t\tret = rte_kvargs_process(kvlist,\n+\t\t\t\tETH_VHOST_VECTORIZED,\n+\t\t\t\t&open_int, &vectorized);\n+\t\tif (ret < 0)\n+\t\t\tgoto out_free;\n+\n+\t\tif (vectorized == 1)\n+\t\t\tflags |= RTE_VHOST_USER_VECTORIZED;\n+\t}\n+\n \tif (dev->device.numa_node == SOCKET_ID_ANY)\n \t\tdev->device.numa_node = rte_socket_id();\n \n@@ -1679,4 +1693,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_vhost,\n \t\"postcopy-support=<0|1> \"\n \t\"tso=<0|1> \"\n \t\"linear-buffer=<0|1> \"\n-\t\"ext-buffer=<0|1>\");\n+\t\"ext-buffer=<0|1> \"\n+\t\"vectorized=<0|1>\");\ndiff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h\nindex a94c84134d..c7f946c6c1 100644\n--- a/lib/librte_vhost/rte_vhost.h\n+++ b/lib/librte_vhost/rte_vhost.h\n@@ -36,6 +36,7 @@ extern \"C\" {\n /* support only linear buffers (no chained mbufs) */\n #define RTE_VHOST_USER_LINEARBUF_SUPPORT\t(1ULL << 6)\n #define RTE_VHOST_USER_ASYNC_COPY\t(1ULL << 7)\n+#define RTE_VHOST_USER_VECTORIZED\t(1ULL << 8)\n \n /* Features. */\n #ifndef VIRTIO_NET_F_GUEST_ANNOUNCE\ndiff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c\nindex 73e1dca95e..cc11244693 100644\n--- a/lib/librte_vhost/socket.c\n+++ b/lib/librte_vhost/socket.c\n@@ -43,6 +43,7 @@ struct vhost_user_socket {\n \tbool extbuf;\n \tbool linearbuf;\n \tbool async_copy;\n+\tbool vectorized;\n \n \t/*\n \t * The \"supported_features\" indicates the feature bits the\n@@ -245,6 +246,9 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)\n \t\t\tdev->async_copy = 1;\n \t}\n \n+\tif (vsocket->vectorized)\n+\t\tvhost_enable_vectorized(vid);\n+\n \tVHOST_LOG_CONFIG(INFO, \"new device, handle is %d\\n\", vid);\n \n \tif (vsocket->notify_ops->new_connection) {\n@@ -881,6 +885,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \tvsocket->dequeue_zero_copy = flags & RTE_VHOST_USER_DEQUEUE_ZERO_COPY;\n \tvsocket->extbuf = flags & RTE_VHOST_USER_EXTBUF_SUPPORT;\n \tvsocket->linearbuf = flags & RTE_VHOST_USER_LINEARBUF_SUPPORT;\n+\tvsocket->vectorized = flags & RTE_VHOST_USER_VECTORIZED;\n \n \tif (vsocket->dequeue_zero_copy &&\n \t    (flags & RTE_VHOST_USER_IOMMU_SUPPORT)) {\ndiff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c\nindex 8f20a0818f..50bf033a9d 100644\n--- a/lib/librte_vhost/vhost.c\n+++ b/lib/librte_vhost/vhost.c\n@@ -752,6 +752,17 @@ vhost_enable_linearbuf(int vid)\n \tdev->linearbuf = 1;\n }\n \n+void\n+vhost_enable_vectorized(int vid)\n+{\n+\tstruct virtio_net *dev = get_device(vid);\n+\n+\tif (dev == NULL)\n+\t\treturn;\n+\n+\tdev->vectorized = 1;\n+}\n+\n int\n rte_vhost_get_mtu(int vid, uint16_t *mtu)\n {\ndiff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex 632f66d532..b556eb3bf6 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -383,6 +383,7 @@ struct virtio_net {\n \tint\t\t\tasync_copy;\n \tint\t\t\textbuf;\n \tint\t\t\tlinearbuf;\n+\tint                     vectorized;\n \tstruct vhost_virtqueue\t*virtqueue[VHOST_MAX_QUEUE_PAIRS * 2];\n \tstruct inflight_mem_info *inflight_info;\n #define IF_NAME_SZ (PATH_MAX > IFNAMSIZ ? PATH_MAX : IFNAMSIZ)\n@@ -721,6 +722,7 @@ void vhost_enable_dequeue_zero_copy(int vid);\n void vhost_set_builtin_virtio_net(int vid, bool enable);\n void vhost_enable_extbuf(int vid);\n void vhost_enable_linearbuf(int vid);\n+void vhost_enable_vectorized(int vid);\n int vhost_enable_guest_notification(struct virtio_net *dev,\n \t\tstruct vhost_virtqueue *vq, int enable);\n \n",
    "prefixes": [
        "v2",
        "1/5"
    ]
}