get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 56214,
    "url": "https://patches.dpdk.org/api/patches/56214/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190708171320.38802-8-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": "<20190708171320.38802-8-yong.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190708171320.38802-8-yong.liu@intel.com",
    "date": "2019-07-08T17:13:14",
    "name": "[RFC,07/13] add vhost dequeue shadow descs update function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4fc3c92122bcde7e8c97d335ec9715827a1e4741",
    "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/20190708171320.38802-8-yong.liu@intel.com/mbox/",
    "series": [
        {
            "id": 5390,
            "url": "https://patches.dpdk.org/api/series/5390/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5390",
            "date": "2019-07-08T17:13:08",
            "name": "[RFC,01/13] add vhost normal enqueue function",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/5390/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/56214/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/56214/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 363941B9CD;\n\tMon,  8 Jul 2019 11:30:08 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 196BD1B95A\n\tfor <dev@dpdk.org>; Mon,  8 Jul 2019 11:29:56 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Jul 2019 02:29:56 -0700",
            "from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.142])\n\tby orsmga007.jf.intel.com with ESMTP; 08 Jul 2019 02:29:54 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.63,466,1557212400\"; d=\"scan'208\";a=\"155821674\"",
        "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": "Tue,  9 Jul 2019 01:13:14 +0800",
        "Message-Id": "<20190708171320.38802-8-yong.liu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190708171320.38802-1-yong.liu@intel.com>",
        "References": "<20190708171320.38802-1-yong.liu@intel.com>",
        "Subject": "[dpdk-dev] [RFC PATCH 07/13] add vhost dequeue shadow descs update\n\tfunction",
        "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": "Vhost dequeue function will buffer used descriptors as many as possible,\nso that shadow used element should itself contain descriptor index and\nwrap counter. First shadowed ring index also be recorded.\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 d084fe364..5ccbe67b5 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -42,6 +42,8 @@\n /* Pre-calculated packed ring flags */\n #define VIRTIO_RX_FLAG_PACKED  (0ULL | VRING_DESC_F_AVAIL | VRING_DESC_F_USED | VRING_DESC_F_WRITE)\n #define VIRTIO_RX_WRAP_FLAG_PACKED (VRING_DESC_F_WRITE)\n+#define VIRTIO_TX_FLAG_PACKED  (0ULL | VRING_DESC_F_AVAIL | VRING_DESC_F_USED)\n+#define VIRTIO_TX_WRAP_FLAG_PACKED (0x0)\n \n /* Used in fast packed ring functions */\n #define PACKED_DESC_PER_CACHELINE (RTE_CACHE_LINE_SIZE / sizeof(struct vring_packed_desc))\n@@ -93,9 +95,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@@ -150,6 +154,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 9eeebe642..83ed2d599 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -299,6 +299,28 @@ update_enqueue_shadow_used_ring_packed(struct vhost_virtqueue *vq,\n \tvq->enqueue_shadow_count += count;\n }\n \n+static __rte_always_inline void\n+update_dequeue_shadow_used_ring_packed(struct vhost_virtqueue *vq,\n+\t\t\t\t uint16_t buf_id, uint16_t count)\n+{\n+\tif (!vq->shadow_used_idx)\n+\t\tvq->dequeue_shadow_head = vq->last_used_idx;\n+\n+\tuint16_t i = vq->shadow_used_idx++;\n+\n+\tvq->shadow_used_packed[i].id  = buf_id;\n+\tvq->shadow_used_packed[i].len = 0;\n+\tvq->shadow_used_packed[i].count = count;\n+\tvq->shadow_used_packed[i].used_idx = vq->last_used_idx;\n+\tvq->shadow_used_packed[i].used_wrap_counter = vq->used_wrap_counter;\n+\n+\tvq->last_used_idx += count;\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 __rte_always_inline void\n update_shadow_used_ring_packed(struct vhost_virtqueue *vq,\n \t\t\t uint16_t desc_idx, uint32_t len, uint16_t count)\n@@ -1990,6 +2012,8 @@ virtio_dev_tx_normal_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t&desc_count))\n \t\t\treturn -1;\n \n+\tupdate_dequeue_shadow_used_ring_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": [
        "RFC",
        "07/13"
    ]
}