get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 56219,
    "url": "https://patches.dpdk.org/api/patches/56219/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190708171320.38802-13-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-13-yong.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190708171320.38802-13-yong.liu@intel.com",
    "date": "2019-07-08T17:13:19",
    "name": "[RFC,12/13] support inorder in vhost dequeue path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "77602ea906e91a3c024f745c1c6b56d88492cdf1",
    "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-13-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/56219/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/56219/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 770851BDF2;\n\tMon,  8 Jul 2019 11:30:16 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 70A711B9A6\n\tfor <dev@dpdk.org>; Mon,  8 Jul 2019 11:30:02 +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:30:01 -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:59 -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=\"155821719\"",
        "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:19 +0800",
        "Message-Id": "<20190708171320.38802-13-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 12/13] support inorder in vhost dequeue 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\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": "When inorder feature bit is negotiated, just update first used\ndescriptor with last descriptor index. It can reflect all used\ndescriptors.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>",
    "diff": "diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex 0f9292eb0..6bcf565f0 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -31,6 +31,12 @@ rxvq_is_mergeable(struct virtio_net *dev)\n \treturn dev->features & (1ULL << VIRTIO_NET_F_MRG_RXBUF);\n }\n \n+static  __rte_always_inline bool\n+virtio_net_is_inorder(struct virtio_net *dev)\n+{\n+\treturn dev->features & (1ULL << VIRTIO_F_IN_ORDER);\n+}\n+\n static bool\n is_valid_virt_queue_idx(uint32_t idx, int is_tx, uint32_t nr_vring)\n {\n@@ -158,6 +164,35 @@ flush_shadow_used_ring_packed(struct virtio_net *dev,\n \tvhost_log_cache_sync(dev, vq);\n }\n \n+static __rte_always_inline void\n+flush_dequeue_shadow_used_packed_inorder(struct virtio_net *dev,\n+\t\t\t\tstruct vhost_virtqueue *vq)\n+{\n+\tuint16_t head_idx = vq->dequeue_shadow_head;\n+\tuint16_t head_flags = 0;\n+\tstruct vring_used_elem_packed *last_elem;\n+\n+\tlast_elem = &vq->shadow_used_packed[vq->shadow_used_idx - 1];\n+\tvq->desc_packed[head_idx].id = last_elem->id + last_elem->count - 1;\n+\n+\tif (vq->shadow_used_packed[0].used_wrap_counter)\n+\t\thead_flags = VIRTIO_TX_FLAG_PACKED;\n+\telse\n+\t\thead_flags = VIRTIO_TX_WRAP_FLAG_PACKED;\n+\n+\trte_smp_wmb();\n+\n+\tvq->desc_packed[head_idx].flags = head_flags;\n+\n+\tvhost_log_cache_used_vring(dev, vq,\n+\t\t\t\thead_idx *\n+\t\t\t\tsizeof(struct vring_packed_desc),\n+\t\t\t\tsizeof(struct vring_packed_desc));\n+\n+\tvq->shadow_used_idx = 0;\n+\tvhost_log_cache_sync(dev, vq);\n+}\n+\n static __rte_always_inline void\n flush_enqueue_used_packed(struct virtio_net *dev,\n \t\t\tstruct vhost_virtqueue *vq)\n@@ -269,6 +304,34 @@ flush_dequeue_shadow_used_packed(struct virtio_net *dev,\n \tvhost_log_cache_sync(dev, vq);\n }\n \n+static __rte_always_inline void\n+flush_used_fast_packed_inorder(struct virtio_net *dev,\n+\t\t\tstruct vhost_virtqueue *vq, uint64_t len,\n+\t\t\tuint64_t len1, uint64_t len2, uint64_t len3,\n+\t\t\tuint16_t id, uint16_t flags)\n+{\n+\tvq->desc_packed[vq->last_used_idx].id = id;\n+\tvq->desc_packed[vq->last_used_idx].len = len;\n+\tvq->desc_packed[vq->last_used_idx + 1].len = len1;\n+\tvq->desc_packed[vq->last_used_idx + 2].len = len2;\n+\tvq->desc_packed[vq->last_used_idx + 3].len = len3;\n+\n+\trte_smp_wmb();\n+\tvq->desc_packed[vq->last_used_idx].flags = flags;\n+\n+\tvhost_log_cache_used_vring(dev, vq,\n+\t\t\t\tvq->last_used_idx *\n+\t\t\t\tsizeof(struct vring_packed_desc),\n+\t\t\t\tRTE_CACHE_LINE_SIZE);\n+\tvhost_log_cache_sync(dev, vq);\n+\n+\tvq->last_used_idx += PACKED_DESC_PER_CACHELINE;\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 /* flags are same when flushing used ring in fast path */\n static __rte_always_inline void\n flush_used_fast_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n@@ -320,8 +383,12 @@ flush_dequeue_fast_used_packed(struct virtio_net *dev,\n \t\tflags = VIRTIO_TX_FLAG_PACKED;\n \telse\n \t\tflags = VIRTIO_TX_WRAP_FLAG_PACKED;\n-\n-\tflush_used_fast_packed(dev, vq, 0, 0, 0, 0, id, id1, id2, id3, flags);\n+\tif (virtio_net_is_inorder(dev))\n+\t\tflush_used_fast_packed_inorder(dev, vq, 0, 0, 0, 0, id3,\n+\t\t\t\t\tflags);\n+\telse\n+\t\tflush_used_fast_packed(dev, vq, 0, 0, 0, 0, id, id1, id2, id3,\n+\t\t\t\tflags);\n }\n \n static __rte_always_inline void\n@@ -451,7 +518,10 @@ flush_dequeue_shadow_used(struct virtio_net *dev, struct vhost_virtqueue *vq)\n \tshadow_count += vq->last_used_idx & 0x3;\n \tif ((uint16_t)shadow_count >= (vq->size >> 1)) {\n \t\tdo_data_copy_dequeue(vq);\n-\t\tflush_dequeue_shadow_used_packed(dev, vq);\n+\t\tif (virtio_net_is_inorder(dev))\n+\t\t\tflush_dequeue_shadow_used_packed_inorder(dev, vq);\n+\t\telse\n+\t\t\tflush_dequeue_shadow_used_packed(dev, vq);\n \t\tvhost_vring_call_packed(dev, vq);\n \t}\n }\n",
    "prefixes": [
        "RFC",
        "12/13"
    ]
}