Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/94674/?format=api
https://patches.dpdk.org/api/patches/94674/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1624365869-31872-1-git-send-email-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": "<1624365869-31872-1-git-send-email-wangyunjian@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1624365869-31872-1-git-send-email-wangyunjian@huawei.com", "date": "2021-06-22T12:44:29", "name": "[v3] kni: fix mbuf allocation for alloc FIFO", "commit_ref": null, "pull_url": null, "state": "accepted", "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/1624365869-31872-1-git-send-email-wangyunjian@huawei.com/mbox/", "series": [ { "id": 17438, "url": "https://patches.dpdk.org/api/series/17438/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17438", "date": "2021-06-22T12:44:29", "name": "[v3] kni: fix mbuf allocation for alloc FIFO", "version": 3, "mbox": "https://patches.dpdk.org/series/17438/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/94674/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/94674/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 1294AA0548;\n\tTue, 22 Jun 2021 14:44:59 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 00F0A40DDA;\n\tTue, 22 Jun 2021 14:44:59 +0200 (CEST)", "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 318B44003C;\n Tue, 22 Jun 2021 14:44:57 +0200 (CEST)", "from dggemv703-chm.china.huawei.com (unknown [172.30.72.57])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G8Qvj5qplzXjcM;\n Tue, 22 Jun 2021 20:39:45 +0800 (CST)", "from dggpemm500008.china.huawei.com (7.185.36.136) by\n dggemv703-chm.china.huawei.com (10.3.19.46) 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 20:44:55 +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 20:44:54 +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 20:44:29 +0800", "Message-ID": "<1624365869-31872-1-git-send-email-wangyunjian@huawei.com>", "X-Mailer": "git-send-email 1.9.5.msysgit.1", "In-Reply-To": "\n <4aebf99afe5bae2b25f2e5445a32243ffd6f7e97.1624359204.git.wangyunjian@huawei.com>", "References": "\n <4aebf99afe5bae2b25f2e5445a32243ffd6f7e97.1624359204.git.wangyunjian@huawei.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.174.243.60]", "X-ClientProxiedBy": "dggems701-chm.china.huawei.com (10.3.19.178) To\n dggpemm500008.china.huawei.com (7.185.36.136)", "X-CFilter-Loop": "Reflected", "Subject": "[dpdk-dev] [PATCH v3] kni: fix mbuf allocation for alloc FIFO", "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>\nAcked-by: Ferruh Yigit <ferruh.yigit@intel.com>\n---\nv3:\n update patch title\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": [ "v3" ] }{ "id": 94674, "url": "