get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 84993,
    "url": "https://patches.dpdk.org/api/patches/84993/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1607678500-172518-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": "<1607678500-172518-2-git-send-email-jiayu.hu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1607678500-172518-2-git-send-email-jiayu.hu@intel.com",
    "date": "2020-12-11T09:21:39",
    "name": "[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/1607678500-172518-2-git-send-email-jiayu.hu@intel.com/mbox/",
    "series": [
        {
            "id": 14248,
            "url": "https://patches.dpdk.org/api/series/14248/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14248",
            "date": "2020-12-11T09:21:38",
            "name": "Enhance Async Enqueue for Small Packets",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/14248/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/84993/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/84993/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 D8D30A04DB;\n\tFri, 11 Dec 2020 03:50:11 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9BE6EC940;\n\tFri, 11 Dec 2020 03:49:55 +0100 (CET)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id 19B95AC9E\n for <dev@dpdk.org>; Fri, 11 Dec 2020 03:49:52 +0100 (CET)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Dec 2020 18:49:51 -0800",
            "from npg_dpdk_virtio_jiayuhu_07.sh.intel.com ([10.67.118.193])\n by fmsmga008.fm.intel.com with ESMTP; 10 Dec 2020 18:49:50 -0800"
        ],
        "IronPort-SDR": [
            "\n f+X1eDR+7efKz2YMOdmxVjPgHV2/ufekxtTS8sYdHAKRbJeF1yvrzeRspgeTBflyUfO0nb394w\n tb5iDw7qt4fQ==",
            "\n uZ3YY2UcJuVP1Pzzx8mrmE/NCrbF+RlD3GQ81NFQA9y62o6xKdooZ5ATHTBfQ/3/Kjgr798Cqt\n ffs20NOnrANA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9831\"; a=\"162126936\"",
            "E=Sophos;i=\"5.78,409,1599548400\"; d=\"scan'208\";a=\"162126936\"",
            "E=Sophos;i=\"5.78,409,1599548400\"; d=\"scan'208\";a=\"321082503\""
        ],
        "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 <jiayu.hu@intel.com>",
        "Date": "Fri, 11 Dec 2020 04:21:39 -0500",
        "Message-Id": "<1607678500-172518-2-git-send-email-jiayu.hu@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1607678500-172518-1-git-send-email-jiayu.hu@intel.com>",
        "References": "<1607678500-172518-1-git-send-email-jiayu.hu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 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 unncessary 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": [
        "1/2"
    ]
}