get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 94670,
    "url": "https://patches.dpdk.org/api/patches/94670/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/4aebf99afe5bae2b25f2e5445a32243ffd6f7e97.1624359204.git.wangyunjian@huawei.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": "<4aebf99afe5bae2b25f2e5445a32243ffd6f7e97.1624359204.git.wangyunjian@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/4aebf99afe5bae2b25f2e5445a32243ffd6f7e97.1624359204.git.wangyunjian@huawei.com",
    "date": "2021-06-22T10:57:52",
    "name": "[v2] kni: fix wrong mbuf alloc count in kni_allocate_mbufs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8c17ceb7b0cd762a0241e82070abd7e86d1a9825",
    "submitter": {
        "id": 551,
        "url": "https://patches.dpdk.org/api/people/551/?format=api",
        "name": "Yunjian Wang",
        "email": "wangyunjian@huawei.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/4aebf99afe5bae2b25f2e5445a32243ffd6f7e97.1624359204.git.wangyunjian@huawei.com/mbox/",
    "series": [
        {
            "id": 17435,
            "url": "https://patches.dpdk.org/api/series/17435/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17435",
            "date": "2021-06-22T10:57:52",
            "name": "[v2] kni: fix wrong mbuf alloc count in kni_allocate_mbufs",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/17435/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/94670/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/94670/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 381D0A0547;\n\tTue, 22 Jun 2021 12:58:18 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EDD7D4003F;\n\tTue, 22 Jun 2021 12:58:17 +0200 (CEST)",
            "from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255])\n by mails.dpdk.org (Postfix) with ESMTP id EF9704003C;\n Tue, 22 Jun 2021 12:58:15 +0200 (CEST)",
            "from dggemv704-chm.china.huawei.com (unknown [172.30.72.57])\n by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4G8NXc26dQz1BQ6J;\n Tue, 22 Jun 2021 18:53:04 +0800 (CST)",
            "from dggpemm500008.china.huawei.com (7.185.36.136) by\n dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2176.2; Tue, 22 Jun 2021 18:58:13 +0800",
            "from localhost (10.174.243.60) by dggpemm500008.china.huawei.com\n (7.185.36.136) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 22 Jun\n 2021 18:58:12 +0800"
        ],
        "From": "wangyunjian <wangyunjian@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <thomas@monjalon.net>,\n <gowrishankar.m@linux.vnet.ibm.com>, <dingxiaoxiong@huawei.com>, Yunjian Wang\n <wangyunjian@huawei.com>, <stable@dpdk.org>, Cheng Liu\n <liucheng11@huawei.com>",
        "Date": "Tue, 22 Jun 2021 18:57:52 +0800",
        "Message-ID": "\n <4aebf99afe5bae2b25f2e5445a32243ffd6f7e97.1624359204.git.wangyunjian@huawei.com>",
        "X-Mailer": "git-send-email 1.9.5.msysgit.1",
        "In-Reply-To": "\n <4ebfe0d38b335a437edc9c58368153d005f562ce.1622460655.git.wangyunjian@huawei.com>",
        "References": "\n <4ebfe0d38b335a437edc9c58368153d005f562ce.1622460655.git.wangyunjian@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.174.243.60]",
        "X-ClientProxiedBy": "dggems702-chm.china.huawei.com (10.3.19.179) To\n dggpemm500008.china.huawei.com (7.185.36.136)",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH v2] kni: fix wrong mbuf alloc count in\n kni_allocate_mbufs",
        "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": "From: Yunjian Wang <wangyunjian@huawei.com>\n\nIn kni_allocate_mbufs(), we alloc mbuf for alloc_q as this code.\nallocq_free = (kni->alloc_q->read - kni->alloc_q->write - 1) \\\n\t\t& (MAX_MBUF_BURST_NUM - 1);\nThe value of allocq_free maybe zero, for example :\nThe ring size is 1024. After init, write = read = 0. Then we fill\nkni->alloc_q to full. At this time, write = 1023, read = 0.\n\nThen the kernel send 32 packets to userspace. At this time, write\n= 1023, read = 32. And then the userspace receive this 32 packets.\nThen fill the kni->alloc_q, (32 - 1023 - 1) & 31 = 0, fill nothing.\n...\nThen the kernel send 32 packets to userspace. At this time, write\n= 1023, read = 992. And then the userspace receive this 32 packets.\nThen fill the kni->alloc_q, (992 - 1023 - 1) & 31 = 0, fill nothing.\n\nThen the kernel send 32 packets to userspace. The kni->alloc_q only\nhas 31 mbufs and will drop one packet.\n\nAbsolutely, this is a special scene. Normally, it will fill some\nmbufs everytime, but may not enough for the kernel to use.\n\nIn this patch, we always keep the kni->alloc_q to full for the kernel\nto use.\n\nFixes: 49da4e82cf94 (\"kni: allocate no more mbuf than empty slots in queue\")\nCc: stable@dpdk.org\n\nSigned-off-by: Cheng Liu <liucheng11@huawei.com>\nSigned-off-by: Yunjian Wang <wangyunjian@huawei.com>\n---\nv2:\n   add fixes tag and update commit log\n---\n lib/kni/rte_kni.c | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c\nindex 9dae6a8d7c..eb24b0d0ae 100644\n--- a/lib/kni/rte_kni.c\n+++ b/lib/kni/rte_kni.c\n@@ -677,8 +677,9 @@ kni_allocate_mbufs(struct rte_kni *kni)\n \t\treturn;\n \t}\n \n-\tallocq_free = (kni->alloc_q->read - kni->alloc_q->write - 1)\n-\t\t\t& (MAX_MBUF_BURST_NUM - 1);\n+\tallocq_free = kni_fifo_free_count(kni->alloc_q);\n+\tallocq_free = (allocq_free > MAX_MBUF_BURST_NUM) ?\n+\t\tMAX_MBUF_BURST_NUM : allocq_free;\n \tfor (i = 0; i < allocq_free; i++) {\n \t\tpkts[i] = rte_pktmbuf_alloc(kni->pktmbuf_pool);\n \t\tif (unlikely(pkts[i] == NULL)) {\n",
    "prefixes": [
        "v2"
    ]
}