get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 85947,
    "url": "https://patches.dpdk.org/api/patches/85947/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210104045753.62487-2-Cheng1.jiang@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": "<20210104045753.62487-2-Cheng1.jiang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210104045753.62487-2-Cheng1.jiang@intel.com",
    "date": "2021-01-04T04:57:52",
    "name": "[v6,1/2] examples/vhost: add ioat ring space count and check",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "865f6fcac9a0440c8daf8d6fc1730b3979ed9a2b",
    "submitter": {
        "id": 1530,
        "url": "https://patches.dpdk.org/api/people/1530/?format=api",
        "name": "Jiang, Cheng1",
        "email": "Cheng1.jiang@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/20210104045753.62487-2-Cheng1.jiang@intel.com/mbox/",
    "series": [
        {
            "id": 14517,
            "url": "https://patches.dpdk.org/api/series/14517/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14517",
            "date": "2021-01-04T04:57:51",
            "name": "examples/vhost: sample code refactor",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/14517/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/85947/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/85947/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 (xvm-189-124.dc0.ghst.net [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 72C0AA09E4;\n\tMon,  4 Jan 2021 06:12:58 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5A93E1606D2;\n\tMon,  4 Jan 2021 06:12:57 +0100 (CET)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 75E221606D1\n for <dev@dpdk.org>; Mon,  4 Jan 2021 06:12:56 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 03 Jan 2021 21:12:55 -0800",
            "from dpdk_jiangcheng.sh.intel.com ([10.67.119.112])\n by orsmga003.jf.intel.com with ESMTP; 03 Jan 2021 21:12:53 -0800"
        ],
        "IronPort-SDR": [
            "\n qObGNErpMlleHhzvhUF6/SFg5Xl74OD05r7E2c3kUo0jaDVs812RGkHhqJg8HbAcLhTwAsydIz\n Auw7mzKjJeQA==",
            "\n cgs3OEXk6npO0QMpFm31dF+eF+xz/F+q2WRmjvi7/FItptAHcidYy0otIBdgNcbOav36hysQvh\n xveA0O/DS4ow=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9853\"; a=\"261670860\"",
            "E=Sophos;i=\"5.78,473,1599548400\"; d=\"scan'208\";a=\"261670860\"",
            "E=Sophos;i=\"5.78,473,1599548400\"; d=\"scan'208\";a=\"345786038\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cheng Jiang <Cheng1.jiang@intel.com>",
        "To": "maxime.coquelin@redhat.com,\n\tchenbo.xia@intel.com",
        "Cc": "dev@dpdk.org, Jiayu.Hu@intel.com, YvonneX.Yang@intel.com,\n yinan.wang@intel.com, Cheng Jiang <Cheng1.jiang@intel.com>",
        "Date": "Mon,  4 Jan 2021 04:57:52 +0000",
        "Message-Id": "<20210104045753.62487-2-Cheng1.jiang@intel.com>",
        "X-Mailer": "git-send-email 2.29.2",
        "In-Reply-To": "<20210104045753.62487-1-Cheng1.jiang@intel.com>",
        "References": "<20201218113327.70528-1-Cheng1.jiang@intel.com>\n <20210104045753.62487-1-Cheng1.jiang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 1/2] examples/vhost: add ioat ring space count\n and check",
        "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": "Add ioat ring space count and check, if ioat ring space is not enough\nfor the next async vhost packet enqueue, then just return to prevent\nenqueue failure. Add rte_ioat_completed_ops() fail handler.\n\nSigned-off-by: Cheng Jiang <Cheng1.jiang@intel.com>\n---\n examples/vhost/ioat.c | 22 ++++++++++++----------\n 1 file changed, 12 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c\nindex 71d8a1f1f5..679d1e2f58 100644\n--- a/examples/vhost/ioat.c\n+++ b/examples/vhost/ioat.c\n@@ -17,6 +17,7 @@ struct packet_tracker {\n \tunsigned short next_read;\n \tunsigned short next_write;\n \tunsigned short last_remain;\n+\tunsigned short ioat_space;\n };\n \n struct packet_tracker cb_tracker[MAX_VHOST_DEVICE];\n@@ -113,7 +114,7 @@ open_ioat(const char *value)\n \t\t\tgoto out;\n \t\t}\n \t\trte_rawdev_start(dev_id);\n-\n+\t\tcb_tracker[dev_id].ioat_space = IOAT_RING_SIZE;\n \t\tdma_info->nr++;\n \t\ti++;\n \t}\n@@ -140,13 +141,9 @@ ioat_transfer_data_cb(int vid, uint16_t queue_id,\n \t\t\tsrc = descs[i_desc].src;\n \t\t\tdst = descs[i_desc].dst;\n \t\t\ti_seg = 0;\n+\t\t\tif (cb_tracker[dev_id].ioat_space < src->nr_segs)\n+\t\t\t\tbreak;\n \t\t\twhile (i_seg < src->nr_segs) {\n-\t\t\t\t/*\n-\t\t\t\t * TODO: Assuming that the ring space of the\n-\t\t\t\t * IOAT device is large enough, so there is no\n-\t\t\t\t * error here, and the actual error handling\n-\t\t\t\t * will be added later.\n-\t\t\t\t */\n \t\t\t\trte_ioat_enqueue_copy(dev_id,\n \t\t\t\t\t(uintptr_t)(src->iov[i_seg].iov_base)\n \t\t\t\t\t\t+ src->offset,\n@@ -158,7 +155,8 @@ ioat_transfer_data_cb(int vid, uint16_t queue_id,\n \t\t\t\ti_seg++;\n \t\t\t}\n \t\t\twrite &= mask;\n-\t\t\tcb_tracker[dev_id].size_track[write] = i_seg;\n+\t\t\tcb_tracker[dev_id].size_track[write] = src->nr_segs;\n+\t\t\tcb_tracker[dev_id].ioat_space -= src->nr_segs;\n \t\t\twrite++;\n \t\t}\n \t} else {\n@@ -178,17 +176,21 @@ ioat_check_completed_copies_cb(int vid, uint16_t queue_id,\n {\n \tif (!opaque_data) {\n \t\tuintptr_t dump[255];\n-\t\tunsigned short n_seg;\n+\t\tint n_seg;\n \t\tunsigned short read, write;\n \t\tunsigned short nb_packet = 0;\n \t\tunsigned short mask = MAX_ENQUEUED_SIZE - 1;\n \t\tunsigned short i;\n+\n \t\tint dev_id = dma_bind[vid].dmas[queue_id * 2\n \t\t\t\t+ VIRTIO_RXQ].dev_id;\n \t\tn_seg = rte_ioat_completed_ops(dev_id, 255, dump, dump);\n-\t\tn_seg += cb_tracker[dev_id].last_remain;\n \t\tif (!n_seg)\n \t\t\treturn 0;\n+\n+\t\tcb_tracker[dev_id].ioat_space += n_seg;\n+\t\tn_seg += cb_tracker[dev_id].last_remain;\n+\n \t\tread = cb_tracker[dev_id].next_read;\n \t\twrite = cb_tracker[dev_id].next_write;\n \t\tfor (i = 0; i < max_packets; i++) {\n",
    "prefixes": [
        "v6",
        "1/2"
    ]
}