get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 100731,
    "url": "https://patches.dpdk.org/api/patches/100731/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211007220013.355530-4-maxime.coquelin@redhat.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": "<20211007220013.355530-4-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211007220013.355530-4-maxime.coquelin@redhat.com",
    "date": "2021-10-07T22:00:02",
    "name": "[RFC,03/14] vhost: simplify async IO vectors",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c2bbc2b32632498933d2ffe78f2ec2dc2abdec35",
    "submitter": {
        "id": 512,
        "url": "https://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.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/20211007220013.355530-4-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 19439,
            "url": "https://patches.dpdk.org/api/series/19439/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19439",
            "date": "2021-10-07T22:00:01",
            "name": "vhost: clean-up and simplify async implementation",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/19439/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/100731/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/100731/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 000ECA0C43;\n\tFri,  8 Oct 2021 00:14:01 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E4DC441406;\n\tFri,  8 Oct 2021 00:14:00 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 3A0944145D\n for <dev@dpdk.org>; Fri,  8 Oct 2021 00:13:59 +0200 (CEST)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-248-e0g_dufxOxeKuuWtbPQeWg-1; Thu, 07 Oct 2021 18:13:55 -0400",
            "from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com\n [10.5.11.16])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1207A11ED92C;\n Thu,  7 Oct 2021 22:00:25 +0000 (UTC)",
            "from max-t490s.redhat.com (unknown [10.39.208.18])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 3D0B85C1CF;\n Thu,  7 Oct 2021 22:00:23 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1633644838;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=x72n5PZzRvC+MHEcgyciapk4uuGHpP9CaOQNzNn2mcI=;\n b=L0nG/+REbuH88jzyfQ/rtotmNJjg1wh4QUywi3SxGdaH7dRyNBMukVHBVDN/2B3yxxgD0V\n Zg9ZEu2SGTAii1yuPXCdonsEfveUCNvwQ2iPJrZMuahUUgT60lK/6LTx70zgdiwoaFe+0r\n HLdUGw3obQxd6JfH9NMC16JzLREqlPQ=",
        "X-MC-Unique": "e0g_dufxOxeKuuWtbPQeWg-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, chenbo.xia@intel.com, jiayu.hu@intel.com,\n yuanx.wang@intel.com, wenwux.ma@intel.com, bruce.richardson@intel.com,\n john.mcnamara@intel.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Fri,  8 Oct 2021 00:00:02 +0200",
        "Message-Id": "<20211007220013.355530-4-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20211007220013.355530-1-maxime.coquelin@redhat.com>",
        "References": "<20211007220013.355530-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.16",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"",
        "Subject": "[dpdk-dev] [RFC 03/14] vhost: simplify async IO vectors",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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": "IO vectors implementation is unnecessarily complex, mixing\nsource and destinations vectors in the same array.\n\nThis patch declares two arrays, one for the source and one\nfor the destination. It also get rid off seg_awaits variable\nin both packed and split implementation, which is the same\nas iovec_idx.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/vhost/vhost.h      |  5 +++--\n lib/vhost/virtio_net.c | 28 +++++++++++-----------------\n 2 files changed, 14 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h\nindex 9de87d20cc..f2d9535174 100644\n--- a/lib/vhost/vhost.h\n+++ b/lib/vhost/vhost.h\n@@ -49,7 +49,7 @@\n #define MAX_PKT_BURST 32\n \n #define VHOST_MAX_ASYNC_IT (MAX_PKT_BURST * 2)\n-#define VHOST_MAX_ASYNC_VEC (BUF_VECTOR_MAX * 4)\n+#define VHOST_MAX_ASYNC_VEC (BUF_VECTOR_MAX * 2)\n \n #define PACKED_DESC_ENQUEUE_USED_FLAG(w)\t\\\n \t((w) ? (VRING_DESC_F_AVAIL | VRING_DESC_F_USED | VRING_DESC_F_WRITE) : \\\n@@ -133,7 +133,8 @@ struct vhost_async {\n \tstruct rte_vhost_async_channel_ops ops;\n \n \tstruct rte_vhost_iov_iter it_pool[VHOST_MAX_ASYNC_IT];\n-\tstruct iovec vec_pool[VHOST_MAX_ASYNC_VEC];\n+\tstruct iovec src_iovec[VHOST_MAX_ASYNC_VEC];\n+\tstruct iovec dst_iovec[VHOST_MAX_ASYNC_VEC];\n \n \t/* data transfer status */\n \tstruct async_inflight_info *pkts_info;\ndiff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c\nindex a109c2a316..4e0e1584b8 100644\n--- a/lib/vhost/virtio_net.c\n+++ b/lib/vhost/virtio_net.c\n@@ -1512,14 +1512,12 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,\n \n \tstruct vhost_async *async = vq->async;\n \tstruct rte_vhost_iov_iter *it_pool = async->it_pool;\n-\tstruct iovec *vec_pool = async->vec_pool;\n \tstruct rte_vhost_async_desc tdes[MAX_PKT_BURST];\n-\tstruct iovec *src_iovec = vec_pool;\n-\tstruct iovec *dst_iovec = vec_pool + (VHOST_MAX_ASYNC_VEC >> 1);\n+\tstruct iovec *src_iovec = async->src_iovec;\n+\tstruct iovec *dst_iovec = async->dst_iovec;\n \tstruct async_inflight_info *pkts_info = async->pkts_info;\n \tuint32_t n_pkts = 0, pkt_err = 0;\n \tint32_t n_xfer;\n-\tuint16_t segs_await = 0;\n \tuint16_t iovec_idx = 0, it_idx = 0, slot_idx = 0;\n \n \t/*\n@@ -1562,7 +1560,6 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,\n \t\tpkts_info[slot_idx].mbuf = pkts[pkt_idx];\n \n \t\tiovec_idx += it_pool[it_idx].nr_segs;\n-\t\tsegs_await += it_pool[it_idx].nr_segs;\n \t\tit_idx += 2;\n \n \t\tvq->last_avail_idx += num_buffers;\n@@ -1573,8 +1570,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,\n \t\t * - unused async iov number is less than max vhost vector\n \t\t */\n \t\tif (unlikely(pkt_burst_idx >= VHOST_ASYNC_BATCH_THRESHOLD ||\n-\t\t\t((VHOST_MAX_ASYNC_VEC >> 1) - segs_await <\n-\t\t\tBUF_VECTOR_MAX))) {\n+\t\t\t(VHOST_MAX_ASYNC_VEC - iovec_idx < BUF_VECTOR_MAX))) {\n \t\t\tn_xfer = async->ops.transfer_data(dev->vid,\n \t\t\t\t\tqueue_id, tdes, 0, pkt_burst_idx);\n \t\t\tif (likely(n_xfer >= 0)) {\n@@ -1588,7 +1584,6 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,\n \n \t\t\tiovec_idx = 0;\n \t\t\tit_idx = 0;\n-\t\t\tsegs_await = 0;\n \n \t\t\tif (unlikely(n_pkts < pkt_burst_idx)) {\n \t\t\t\t/*\n@@ -1745,8 +1740,11 @@ vhost_enqueue_async_packed(struct virtio_net *dev,\n \t\tif (unlikely(++tries > max_tries))\n \t\t\treturn -1;\n \n-\t\tif (unlikely(fill_vec_buf_packed(dev, vq, avail_idx, &desc_count, buf_vec, &nr_vec,\n-\t\t\t\t\t\t&buf_id, &len, VHOST_ACCESS_RW) < 0))\n+\t\tif (unlikely(fill_vec_buf_packed(dev, vq,\n+\t\t\t\t\t\tavail_idx, &desc_count,\n+\t\t\t\t\t\tbuf_vec, &nr_vec,\n+\t\t\t\t\t\t&buf_id, &len,\n+\t\t\t\t\t\tVHOST_ACCESS_RW) < 0))\n \t\t\treturn -1;\n \n \t\tlen = RTE_MIN(len, size);\n@@ -1832,14 +1830,12 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev,\n \n \tstruct vhost_async *async = vq->async;\n \tstruct rte_vhost_iov_iter *it_pool = async->it_pool;\n-\tstruct iovec *vec_pool = async->vec_pool;\n \tstruct rte_vhost_async_desc tdes[MAX_PKT_BURST];\n-\tstruct iovec *src_iovec = vec_pool;\n-\tstruct iovec *dst_iovec = vec_pool + (VHOST_MAX_ASYNC_VEC >> 1);\n+\tstruct iovec *src_iovec = async->src_iovec;\n+\tstruct iovec *dst_iovec = async->dst_iovec;\n \tstruct async_inflight_info *pkts_info = async->pkts_info;\n \tuint32_t n_pkts = 0, pkt_err = 0;\n \tuint16_t slot_idx = 0;\n-\tuint16_t segs_await = 0;\n \tuint16_t iovec_idx = 0, it_idx = 0;\n \n \tdo {\n@@ -1861,7 +1857,6 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev,\n \t\tpkts_info[slot_idx].nr_buffers = num_buffers;\n \t\tpkts_info[slot_idx].mbuf = pkts[pkt_idx];\n \t\tiovec_idx += it_pool[it_idx].nr_segs;\n-\t\tsegs_await += it_pool[it_idx].nr_segs;\n \t\tit_idx += 2;\n \n \t\tpkt_idx++;\n@@ -1874,7 +1869,7 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev,\n \t\t * - unused async iov number is less than max vhost vector\n \t\t */\n \t\tif (unlikely(pkt_burst_idx >= VHOST_ASYNC_BATCH_THRESHOLD ||\n-\t\t\t((VHOST_MAX_ASYNC_VEC >> 1) - segs_await < BUF_VECTOR_MAX))) {\n+\t\t\t(VHOST_MAX_ASYNC_VEC - iovec_idx < BUF_VECTOR_MAX))) {\n \t\t\tn_xfer = async->ops.transfer_data(dev->vid,\n \t\t\t\t\tqueue_id, tdes, 0, pkt_burst_idx);\n \t\t\tif (likely(n_xfer >= 0)) {\n@@ -1888,7 +1883,6 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev,\n \n \t\t\tiovec_idx = 0;\n \t\t\tit_idx = 0;\n-\t\t\tsegs_await = 0;\n \n \t\t\tif (unlikely(n_pkts < pkt_burst_idx)) {\n \t\t\t\t/*\n",
    "prefixes": [
        "RFC",
        "03/14"
    ]
}