get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50362,
    "url": "http://patches.dpdk.org/api/patches/50362/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190219105951.31046-3-tiwei.bie@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20190219105951.31046-3-tiwei.bie@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190219105951.31046-3-tiwei.bie@intel.com",
    "date": "2019-02-19T10:59:48",
    "name": "[2/5] net/virtio: fix in-order Tx path for split ring",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "67ccb9204222facf703f57d3dd3920610b292067",
    "submitter": {
        "id": 617,
        "url": "http://patches.dpdk.org/api/people/617/?format=api",
        "name": "Tiwei Bie",
        "email": "tiwei.bie@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190219105951.31046-3-tiwei.bie@intel.com/mbox/",
    "series": [
        {
            "id": 3481,
            "url": "http://patches.dpdk.org/api/series/3481/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3481",
            "date": "2019-02-19T10:59:46",
            "name": "Fixes and enhancements for Tx path in Virtio PMD",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/3481/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50362/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50362/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 4B0BE1B123;\n\tTue, 19 Feb 2019 12:02:43 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id CD1AE5B26;\n\tTue, 19 Feb 2019 12:02:39 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Feb 2019 03:02:38 -0800",
            "from dpdk-tbie.sh.intel.com ([10.67.104.173])\n\tby orsmga002.jf.intel.com with ESMTP; 19 Feb 2019 03:02:37 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,388,1544515200\"; d=\"scan'208\";a=\"135430791\"",
        "From": "Tiwei Bie <tiwei.bie@intel.com>",
        "To": "maxime.coquelin@redhat.com,\n\tzhihong.wang@intel.com,\n\tdev@dpdk.org",
        "Cc": "stable@dpdk.org",
        "Date": "Tue, 19 Feb 2019 18:59:48 +0800",
        "Message-Id": "<20190219105951.31046-3-tiwei.bie@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190219105951.31046-1-tiwei.bie@intel.com>",
        "References": "<20190219105951.31046-1-tiwei.bie@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/5] net/virtio: fix in-order Tx path for split\n\tring",
        "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 IN_ORDER feature is negotiated, device may just write out a\nsingle used ring entry for a batch of buffers:\n\n\"\"\"\nSome devices always use descriptors in the same order in which they\nhave been made available. These devices can offer the VIRTIO_F_IN_ORDER\nfeature. If negotiated, this knowledge allows devices to notify the\nuse of a batch of buffers to the driver by only writing out a single\nused ring entry with the id corresponding to the head entry of the\ndescriptor chain describing the last buffer in the batch.\n\nThe device then skips forward in the ring according to the size of\nthe batch. Accordingly, it increments the used idx by the size of\nthe batch.\n\nThe driver needs to look up the used id and calculate the batch size\nto be able to advance to where the next used ring entry will be written\nby the device.\n\"\"\"\n\nCurrently, the in-order Tx path in split ring can't handle this.\nWith this patch, driver will allocate desc_extra[] based on the\nindex in avail/used ring instead of the index in descriptor table.\nAnd driver can just relay on the used->idx written by device to\nreclaim the descriptors and Tx buffers.\n\nFixes: e5f456a98d3c (\"net/virtio: support in-order Rx and Tx\")\nCc: stable@dpdk.org\n\nSigned-off-by: Tiwei Bie <tiwei.bie@intel.com>\n---\n drivers/net/virtio/virtio_rxtx.c | 28 ++++++++++------------------\n 1 file changed, 10 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c\nindex b07ceac6d..407f58bce 100644\n--- a/drivers/net/virtio/virtio_rxtx.c\n+++ b/drivers/net/virtio/virtio_rxtx.c\n@@ -279,7 +279,7 @@ virtio_xmit_cleanup(struct virtqueue *vq, uint16_t num)\n static void\n virtio_xmit_cleanup_inorder(struct virtqueue *vq, uint16_t num)\n {\n-\tuint16_t i, used_idx, desc_idx = 0, last_idx;\n+\tuint16_t i, idx = vq->vq_used_cons_idx;\n \tint16_t free_cnt = 0;\n \tstruct vq_desc_extra *dxp = NULL;\n \n@@ -287,27 +287,16 @@ virtio_xmit_cleanup_inorder(struct virtqueue *vq, uint16_t num)\n \t\treturn;\n \n \tfor (i = 0; i < num; i++) {\n-\t\tstruct vring_used_elem *uep;\n-\n-\t\tused_idx = vq->vq_used_cons_idx & (vq->vq_nentries - 1);\n-\t\tuep = &vq->vq_ring.used->ring[used_idx];\n-\t\tdesc_idx = (uint16_t)uep->id;\n-\n-\t\tdxp = &vq->vq_descx[desc_idx];\n-\t\tvq->vq_used_cons_idx++;\n-\n+\t\tdxp = &vq->vq_descx[idx++ & (vq->vq_nentries - 1)];\n+\t\tfree_cnt += dxp->ndescs;\n \t\tif (dxp->cookie != NULL) {\n \t\t\trte_pktmbuf_free(dxp->cookie);\n \t\t\tdxp->cookie = NULL;\n \t\t}\n \t}\n \n-\tlast_idx = desc_idx + dxp->ndescs - 1;\n-\tfree_cnt = last_idx - vq->vq_desc_tail_idx;\n-\tif (free_cnt <= 0)\n-\t\tfree_cnt += vq->vq_nentries;\n-\n-\tvq_ring_free_inorder(vq, last_idx, free_cnt);\n+\tvq->vq_free_cnt += free_cnt;\n+\tvq->vq_used_cons_idx = idx;\n }\n \n static inline int\n@@ -556,7 +545,7 @@ virtqueue_enqueue_xmit_inorder(struct virtnet_tx *txvq,\n \n \twhile (i < num) {\n \t\tidx = idx & (vq->vq_nentries - 1);\n-\t\tdxp = &vq->vq_descx[idx];\n+\t\tdxp = &vq->vq_descx[vq->vq_avail_idx & (vq->vq_nentries - 1)];\n \t\tdxp->cookie = (void *)cookies[i];\n \t\tdxp->ndescs = 1;\n \n@@ -708,7 +697,10 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie,\n \n \thead_idx = vq->vq_desc_head_idx;\n \tidx = head_idx;\n-\tdxp = &vq->vq_descx[idx];\n+\tif (in_order)\n+\t\tdxp = &vq->vq_descx[vq->vq_avail_idx & (vq->vq_nentries - 1)];\n+\telse\n+\t\tdxp = &vq->vq_descx[idx];\n \tdxp->cookie = (void *)cookie;\n \tdxp->ndescs = needed;\n \n",
    "prefixes": [
        "2/5"
    ]
}