get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 86365,
    "url": "http://patches.dpdk.org/api/patches/86365/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210112043857.19826-2-Cheng1.jiang@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": "<20210112043857.19826-2-Cheng1.jiang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210112043857.19826-2-Cheng1.jiang@intel.com",
    "date": "2021-01-12T04:38:56",
    "name": "[v9,1/2] examples/vhost: add ioat ring space count and check",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a3a4d3da7d15ef8d5615d60dc4feb301df5a2a0c",
    "submitter": {
        "id": 1530,
        "url": "http://patches.dpdk.org/api/people/1530/?format=api",
        "name": "Jiang, Cheng1",
        "email": "Cheng1.jiang@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/20210112043857.19826-2-Cheng1.jiang@intel.com/mbox/",
    "series": [
        {
            "id": 14653,
            "url": "http://patches.dpdk.org/api/series/14653/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14653",
            "date": "2021-01-12T04:38:55",
            "name": "examples/vhost: sample code refactor",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/14653/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/86365/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/86365/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 0BF4DA04B5;\n\tTue, 12 Jan 2021 05:49:48 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E6B16140D1D;\n\tTue, 12 Jan 2021 05:49:47 +0100 (CET)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id 4E947140D1C\n for <dev@dpdk.org>; Tue, 12 Jan 2021 05:49:45 +0100 (CET)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Jan 2021 20:49:43 -0800",
            "from dpdk_jiangcheng.sh.intel.com ([10.67.119.112])\n by orsmga006.jf.intel.com with ESMTP; 11 Jan 2021 20:49:41 -0800"
        ],
        "IronPort-SDR": [
            "\n pw33Z8DChdnF2rS59uUeRzTOH4OqOBeyef0LPTQ2BkI8j4p7g7e2SelDrA1XXSgYMBzMUq/eUz\n VjdjqC3stYJQ==",
            "\n /IT+Bibfo4lnpYGmoKMZj2A4avRfnS+v9A4AljyaWVH1R0KSyuBdxP/ABMhXihYIEV0iJae5tE\n ZCkqU3TFGWzA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9861\"; a=\"242053526\"",
            "E=Sophos;i=\"5.79,340,1602572400\"; d=\"scan'208\";a=\"242053526\"",
            "E=Sophos;i=\"5.79,340,1602572400\"; d=\"scan'208\";a=\"351768128\""
        ],
        "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>,\n Jiayu Hu <jiayu.hu@intel.com>",
        "Date": "Tue, 12 Jan 2021 04:38:56 +0000",
        "Message-Id": "<20210112043857.19826-2-Cheng1.jiang@intel.com>",
        "X-Mailer": "git-send-email 2.29.2",
        "In-Reply-To": "<20210112043857.19826-1-Cheng1.jiang@intel.com>",
        "References": "<20201218113327.70528-1-Cheng1.jiang@intel.com>\n <20210112043857.19826-1-Cheng1.jiang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v9 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>\nReviewed-by: Jiayu Hu <jiayu.hu@intel.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n examples/vhost/ioat.c | 24 +++++++++++++-----------\n 1 file changed, 13 insertions(+), 11 deletions(-)\n\n--\n2.29.2",
    "diff": "diff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c\nindex 71d8a1f1f..dbad28d43 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\tif (n_seg <= 0)\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": [
        "v9",
        "1/2"
    ]
}