get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 58617,
    "url": "https://patches.dpdk.org/api/patches/58617/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190905161421.55981-9-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": "<20190905161421.55981-9-yong.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190905161421.55981-9-yong.liu@intel.com",
    "date": "2019-09-05T16:14:15",
    "name": "[v1,08/14] vhost: buffer vhost dequeue shadow ring",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "36c93ecf53bd94ed799355d2a89827a58acbab84",
    "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/20190905161421.55981-9-yong.liu@intel.com/mbox/",
    "series": [
        {
            "id": 6248,
            "url": "https://patches.dpdk.org/api/series/6248/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6248",
            "date": "2019-09-05T16:14:07",
            "name": "vhost packed ring performance optimization",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/6248/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/58617/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/58617/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 1FA7E1EE5F;\n\tThu,  5 Sep 2019 10:34:53 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id BACF01EE07\n\tfor <dev@dpdk.org>; Thu,  5 Sep 2019 10:34:40 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Sep 2019 01:34:40 -0700",
            "from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.142])\n\tby fmsmga006.fm.intel.com with ESMTP; 05 Sep 2019 01:34:39 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,470,1559545200\"; d=\"scan'208\";a=\"383781571\"",
        "From": "Marvin Liu <yong.liu@intel.com>",
        "To": "tiwei.bie@intel.com,\n\tmaxime.coquelin@redhat.com,\n\tdev@dpdk.org",
        "Cc": "Marvin Liu <yong.liu@intel.com>",
        "Date": "Fri,  6 Sep 2019 00:14:15 +0800",
        "Message-Id": "<20190905161421.55981-9-yong.liu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190905161421.55981-1-yong.liu@intel.com>",
        "References": "<20190905161421.55981-1-yong.liu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v1 08/14] vhost: buffer vhost dequeue shadow ring",
        "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": "Buffer used ring updates as many as possible in vhost dequeue function\nfor coordinating with virtio driver. For supporting buffer, shadow used\nring element should contain descriptor index and its wrap counter. First\nshadowed ring index is recorded for calculating buffered number.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>",
    "diff": "diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex 5471acaf7..b161082ca 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -42,6 +42,8 @@\n #define VIRTIO_RX_USED_FLAG  (0ULL | VRING_DESC_F_AVAIL | VRING_DESC_F_USED \\\n \t\t\t\t| VRING_DESC_F_WRITE)\n #define VIRTIO_RX_USED_WRAP_FLAG (VRING_DESC_F_WRITE)\n+#define VIRTIO_TX_USED_FLAG  (0ULL | VRING_DESC_F_AVAIL | VRING_DESC_F_USED)\n+#define VIRTIO_TX_USED_WRAP_FLAG (0x0)\n #define PACKED_DESCS_BURST 4\n #define PACKED_BURST_MASK (PACKED_DESCS_BURST - 1)\n #define DESC_SINGLE_DEQUEUE (VRING_DESC_F_NEXT | VRING_DESC_F_INDIRECT)\n@@ -90,9 +92,11 @@ struct log_cache_entry {\n };\n \n struct vring_used_elem_packed {\n+\tuint16_t used_idx;\n \tuint16_t id;\n \tuint32_t len;\n \tuint32_t count;\n+\tuint16_t used_wrap_counter;\n };\n \n /**\n@@ -147,6 +151,7 @@ struct vhost_virtqueue {\n \t};\n \tuint16_t                shadow_used_idx;\n \tuint16_t                enqueue_shadow_count;\n+\tuint16_t                dequeue_shadow_head;\n \tstruct vhost_vring_addr ring_addrs;\n \n \tstruct batch_copy_elem\t*batch_copy_elems;\ndiff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex ce255dd82..f8ad54e18 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -240,6 +240,42 @@ update_shadow_packed(struct vhost_virtqueue *vq,\n \tvq->shadow_used_packed[i].count = count;\n }\n \n+static __rte_always_inline void\n+update_dequeue_shadow_packed(struct vhost_virtqueue *vq, uint16_t buf_id,\n+\tuint16_t count)\n+{\n+\tif (!vq->shadow_used_idx) {\n+\t\tvq->dequeue_shadow_head = vq->last_used_idx;\n+\n+\t\tvq->shadow_used_packed[0].id  = buf_id;\n+\t\tvq->shadow_used_packed[0].len = 0;\n+\t\tvq->shadow_used_packed[0].count = count;\n+\t\tvq->shadow_used_packed[0].used_idx = vq->last_used_idx;\n+\t\tvq->shadow_used_packed[0].used_wrap_counter =\n+\t\t\tvq->used_wrap_counter;\n+\n+\t\tvq->shadow_used_idx = 1;\n+\t} else {\n+\t\tvq->desc_packed[vq->last_used_idx].id = buf_id;\n+\t\tvq->desc_packed[vq->last_used_idx].len = 0;\n+\n+\t\tif (vq->used_wrap_counter)\n+\t\t\tvq->desc_packed[vq->last_used_idx].flags =\n+\t\t\t\tVIRTIO_TX_USED_FLAG;\n+\t\telse\n+\t\t\tvq->desc_packed[vq->last_used_idx].flags =\n+\t\t\t\tVIRTIO_TX_USED_WRAP_FLAG;\n+\n+\t}\n+\n+\tvq->last_used_idx += count;\n+\n+\tif (vq->last_used_idx >= vq->size) {\n+\t\tvq->used_wrap_counter ^= 1;\n+\t\tvq->last_used_idx -= vq->size;\n+\t}\n+}\n+\n static inline void\n do_data_copy_enqueue(struct virtio_net *dev, struct vhost_virtqueue *vq)\n {\n@@ -1898,6 +1934,8 @@ virtio_dev_tx_single_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\t\t\t&desc_count))\n \t\treturn -1;\n \n+\tupdate_dequeue_shadow_packed(vq, buf_id, desc_count);\n+\n \tvq->last_avail_idx += desc_count;\n \tif (vq->last_avail_idx >= vq->size) {\n \t\tvq->last_avail_idx -= vq->size;\n",
    "prefixes": [
        "v1",
        "08/14"
    ]
}