get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 85733,
    "url": "https://patches.dpdk.org/api/patches/85733/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201225080712.36177-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": "<20201225080712.36177-2-Cheng1.jiang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201225080712.36177-2-Cheng1.jiang@intel.com",
    "date": "2020-12-25T08:07:11",
    "name": "[v4,1/2] examples/vhost: add ioat ring space count and check",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "21bfdddd957564e1c1bea47e9fdf26fa6fec351b",
    "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/20201225080712.36177-2-Cheng1.jiang@intel.com/mbox/",
    "series": [
        {
            "id": 14465,
            "url": "https://patches.dpdk.org/api/series/14465/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14465",
            "date": "2020-12-25T08:07:11",
            "name": "examples/vhost: sample code refactor",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/14465/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/85733/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/85733/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 C4CC4A052A;\n\tFri, 25 Dec 2020 09:18:50 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 42941C9C8;\n\tFri, 25 Dec 2020 09:18:48 +0100 (CET)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by dpdk.org (Postfix) with ESMTP id 45A4DC9C0\n for <dev@dpdk.org>; Fri, 25 Dec 2020 09:18:46 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 25 Dec 2020 00:18:42 -0800",
            "from dpdk_jiangcheng.sh.intel.com ([10.67.119.112])\n by FMSMGA003.fm.intel.com with ESMTP; 25 Dec 2020 00:18:41 -0800"
        ],
        "IronPort-SDR": [
            "\n ppJEENoooHsv/ZudxBIfqkcsuktXKF9aSFk9LUYZWLTJyOaQjDCheyF0G6dX9BLaJ7d9IMcrii\n bH2vV5mLs8GA==",
            "\n dxKQ9v/bjx67uyVbDiNLwvK1dj0nW2n2SPQuLISFVrkMIOPDtQbJZDgp/zdZ/ciifxvia2YKKi\n gwe2x5qi2EKg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9845\"; a=\"237762705\"",
            "E=Sophos;i=\"5.78,447,1599548400\"; d=\"scan'208\";a=\"237762705\"",
            "E=Sophos;i=\"5.78,447,1599548400\"; d=\"scan'208\";a=\"399144543\""
        ],
        "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 Cheng Jiang <Cheng1.jiang@intel.com>",
        "Date": "Fri, 25 Dec 2020 08:07:11 +0000",
        "Message-Id": "<20201225080712.36177-2-Cheng1.jiang@intel.com>",
        "X-Mailer": "git-send-email 2.29.2",
        "In-Reply-To": "<20201225080712.36177-1-Cheng1.jiang@intel.com>",
        "References": "<20201218113327.70528-1-Cheng1.jiang@intel.com>\n <20201225080712.36177-1-Cheng1.jiang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v4 1/2] examples/vhost: add ioat ring space count\n\tand check",
        "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": "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.\n\nSigned-off-by: Cheng Jiang <Cheng1.jiang@intel.com>\n---\n examples/vhost/ioat.c | 15 +++++++--------\n 1 file changed, 7 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c\nindex 71d8a1f1f..b0b04aa45 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@@ -186,6 +184,7 @@ ioat_check_completed_copies_cb(int vid, uint16_t queue_id,\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\tcb_tracker[dev_id].ioat_space += n_seg;\n \t\tn_seg += cb_tracker[dev_id].last_remain;\n \t\tif (!n_seg)\n \t\t\treturn 0;\n",
    "prefixes": [
        "v4",
        "1/2"
    ]
}