get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 85728,
    "url": "https://patches.dpdk.org/api/patches/85728/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1608884934-106977-2-git-send-email-jiayu.hu@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": "<1608884934-106977-2-git-send-email-jiayu.hu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1608884934-106977-2-git-send-email-jiayu.hu@intel.com",
    "date": "2020-12-25T08:28:53",
    "name": "[v3,1/2] vhost: cleanup async enqueue",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d0c7d0378b4d160b9e9bfec30a4c4824eb7f5221",
    "submitter": {
        "id": 539,
        "url": "https://patches.dpdk.org/api/people/539/?format=api",
        "name": "Hu, Jiayu",
        "email": "jiayu.hu@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/1608884934-106977-2-git-send-email-jiayu.hu@intel.com/mbox/",
    "series": [
        {
            "id": 14461,
            "url": "https://patches.dpdk.org/api/series/14461/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14461",
            "date": "2020-12-25T08:28:52",
            "name": "Enhance Async Enqueue for Small Packets",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/14461/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/85728/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/85728/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 4B651A09FF;\n\tFri, 25 Dec 2020 02:58:12 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 5BD73CA58;\n\tFri, 25 Dec 2020 02:57:55 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id DEC772BA2\n for <dev@dpdk.org>; Fri, 25 Dec 2020 02:57:51 +0100 (CET)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 24 Dec 2020 17:57:49 -0800",
            "from npg_dpdk_virtio_jiayuhu_07.sh.intel.com ([10.67.118.193])\n by fmsmga002.fm.intel.com with ESMTP; 24 Dec 2020 17:57:48 -0800"
        ],
        "IronPort-SDR": [
            "\n tMM+cCyyy3W7LckSHtmDaxkYKHGorDyJplWzMPQsQZ9k4eTEN1Wzb7KQwH9RzKXEB+/47C1fLB\n gyR5iFtChuNw==",
            "\n jBvxdXk/jauIRTEaXmP+jNppOlSrnw5EfDm7cbyuACstnawWAFywe4siiaO1Ms3udy4ChugxIT\n pVKqRuIDLejw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9845\"; a=\"163248217\"",
            "E=Sophos;i=\"5.78,446,1599548400\"; d=\"scan'208\";a=\"163248217\"",
            "E=Sophos;i=\"5.78,446,1599548400\"; d=\"scan'208\";a=\"394141403\""
        ],
        "X-ExtLoop1": "1",
        "From": "Jiayu Hu <jiayu.hu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.coquelin@redhat.com, chenbo.xia@intel.com, cheng1.jiang@intel.com,\n yinan.wang@intel.com, jiayu.hu@intel.com",
        "Date": "Fri, 25 Dec 2020 03:28:53 -0500",
        "Message-Id": "<1608884934-106977-2-git-send-email-jiayu.hu@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1608884934-106977-1-git-send-email-jiayu.hu@intel.com>",
        "References": "<1608630365-131192-1-git-send-email-jiayu.hu@intel.com>\n <1608884934-106977-1-git-send-email-jiayu.hu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 1/2] vhost: cleanup async enqueue",
        "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 <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": "This patch removes unnecessary check and function calls, and it changes\nappropriate types for internal variables and fixes typos.\n\nSigned-off-by: Jiayu Hu <jiayu.hu@intel.com>\n---\n lib/librte_vhost/rte_vhost_async.h |  6 +++---\n lib/librte_vhost/virtio_net.c      | 16 ++++++++--------\n 2 files changed, 11 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/rte_vhost_async.h b/lib/librte_vhost/rte_vhost_async.h\nindex c73bd7c..3be4ee4 100644\n--- a/lib/librte_vhost/rte_vhost_async.h\n+++ b/lib/librte_vhost/rte_vhost_async.h\n@@ -147,8 +147,8 @@ __rte_experimental\n int rte_vhost_async_channel_unregister(int vid, uint16_t queue_id);\n \n /**\n- * This function submit enqueue data to async engine. This function has\n- * no guranttee to the transfer completion upon return. Applications\n+ * This function submits enqueue data to async engine. This function has\n+ * no guarantee to the transfer completion upon return. Applications\n  * should poll transfer status by rte_vhost_poll_enqueue_completed()\n  *\n  * @param vid\n@@ -167,7 +167,7 @@ uint16_t rte_vhost_submit_enqueue_burst(int vid, uint16_t queue_id,\n \t\tstruct rte_mbuf **pkts, uint16_t count);\n \n /**\n- * This function check async completion status for a specific vhost\n+ * This function checks async completion status for a specific vhost\n  * device queue. Packets which finish copying (enqueue) operation\n  * will be returned in an array.\n  *\ndiff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex 6c51286..fc654be 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -1128,8 +1128,11 @@ async_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t}\n \n out:\n-\tasync_fill_iter(src_it, tlen, src_iovec, tvec_idx);\n-\tasync_fill_iter(dst_it, tlen, dst_iovec, tvec_idx);\n+\tif (tlen) {\n+\t\tasync_fill_iter(src_it, tlen, src_iovec, tvec_idx);\n+\t\tasync_fill_iter(dst_it, tlen, dst_iovec, tvec_idx);\n+\t} else\n+\t\tsrc_it->count = 0;\n \n \treturn error;\n }\n@@ -1492,10 +1495,9 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,\n \tstruct rte_vhost_iov_iter *src_it = it_pool;\n \tstruct rte_vhost_iov_iter *dst_it = it_pool + 1;\n \tuint16_t n_free_slot, slot_idx = 0;\n-\tuint16_t pkt_err = 0;\n \tuint16_t segs_await = 0;\n \tstruct async_inflight_info *pkts_info = vq->async_pkts_info;\n-\tint n_pkts = 0;\n+\tuint32_t n_pkts = 0, pkt_err = 0;\n \n \tavail_head = __atomic_load_n(&vq->avail->idx, __ATOMIC_ACQUIRE);\n \n@@ -1553,11 +1555,9 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,\n \t\t/*\n \t\t * conditions to trigger async device transfer:\n \t\t * - buffered packet number reaches transfer threshold\n-\t\t * - this is the last packet in the burst enqueue\n \t\t * - unused async iov number is less than max vhost vector\n \t\t */\n \t\tif (pkt_burst_idx >= VHOST_ASYNC_BATCH_THRESHOLD ||\n-\t\t\t(pkt_idx == count - 1 && pkt_burst_idx) ||\n \t\t\t(VHOST_MAX_ASYNC_VEC / 2 - segs_await <\n \t\t\tBUF_VECTOR_MAX)) {\n \t\t\tn_pkts = vq->async_ops.transfer_data(dev->vid,\n@@ -1569,7 +1569,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,\n \t\t\tsegs_await = 0;\n \t\t\tvq->async_pkts_inflight_n += pkt_burst_idx;\n \n-\t\t\tif (unlikely(n_pkts < (int)pkt_burst_idx)) {\n+\t\t\tif (unlikely(n_pkts < pkt_burst_idx)) {\n \t\t\t\t/*\n \t\t\t\t * log error packets number here and do actual\n \t\t\t\t * error processing when applications poll\n@@ -1589,7 +1589,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,\n \t\t\t\tqueue_id, tdes, 0, pkt_burst_idx);\n \t\tvq->async_pkts_inflight_n += pkt_burst_idx;\n \n-\t\tif (unlikely(n_pkts < (int)pkt_burst_idx))\n+\t\tif (unlikely(n_pkts < pkt_burst_idx))\n \t\t\tpkt_err = pkt_burst_idx - n_pkts;\n \t}\n \n",
    "prefixes": [
        "v3",
        "1/2"
    ]
}