From patchwork Thu Apr 22 03:56:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91992 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id B2B59A0547; Thu, 22 Apr 2021 05:56:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E86141C55; Thu, 22 Apr 2021 05:56:27 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 4EC2241C48 for ; Thu, 22 Apr 2021 05:56:24 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FQk795kH2zrg8l for ; Thu, 22 Apr 2021 11:53:57 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Thu, 22 Apr 2021 11:56:16 +0800 From: "Min Hu (Connor)" To: CC: Date: Thu, 22 Apr 2021 11:56:27 +0800 Message-ID: <1619063789-60922-2-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619063789-60922-1-git-send-email-humin29@huawei.com> References: <1619063789-60922-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH 1/3] kni: fix wrong comments X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch changed 'subsytem' to 'subsystem'. Fixes: 0c6bc8ef70ba ("kni: memzone pool for alloc and release") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) Reviewed-by: Ferruh Yigit --- app/test/test_kni.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_kni.c b/app/test/test_kni.c index f53a53e..3470005 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -562,7 +562,7 @@ test_kni(void) } closedir(dir); - /* Initialize KNI subsytem */ + /* Initialize KNI subsystem */ rte_kni_init(KNI_TEST_MAX_PORTS); if (test_kni_allocate_lcores() < 0) { From patchwork Thu Apr 22 03:56:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91991 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 748B1A0547; Thu, 22 Apr 2021 05:56:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5687941C4F; Thu, 22 Apr 2021 05:56:26 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 2C19B413FA for ; Thu, 22 Apr 2021 05:56:24 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FQk795FBnzrg6M for ; Thu, 22 Apr 2021 11:53:57 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Thu, 22 Apr 2021 11:56:17 +0800 From: "Min Hu (Connor)" To: CC: Date: Thu, 22 Apr 2021 11:56:28 +0800 Message-ID: <1619063789-60922-3-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619063789-60922-1-git-send-email-humin29@huawei.com> References: <1619063789-60922-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH 2/3] net/kni: fix rewritten return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Return value of function 'eth_kni_dev_stop' passed to 'ret' is rewritten later, and this is unreasonable. This patch fixes it. Fixes: 62024eb82756 ("ethdev: change stop operation callback to return int") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) --- drivers/net/kni/rte_eth_kni.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c index 9ce74e5..067584c 100644 --- a/drivers/net/kni/rte_eth_kni.c +++ b/drivers/net/kni/rte_eth_kni.c @@ -211,6 +211,11 @@ eth_kni_close(struct rte_eth_dev *eth_dev) return 0; ret = eth_kni_dev_stop(eth_dev); + if (ret) { + PMD_LOG(WARNING, "Not able to stop kni for %s", + eth_dev->data->name); + return ret; + } /* mac_addrs must not be freed alone because part of dev_private */ eth_dev->data->mac_addrs = NULL; From patchwork Thu Apr 22 03:56:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91993 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id E928AA0547; Thu, 22 Apr 2021 05:56:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2BC541C5B; Thu, 22 Apr 2021 05:56:28 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 510FE41C49 for ; Thu, 22 Apr 2021 05:56:24 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FQk795Z4Mzrg8k for ; Thu, 22 Apr 2021 11:53:57 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Thu, 22 Apr 2021 11:56:17 +0800 From: "Min Hu (Connor)" To: CC: Date: Thu, 22 Apr 2021 11:56:29 +0800 Message-ID: <1619063789-60922-4-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619063789-60922-1-git-send-email-humin29@huawei.com> References: <1619063789-60922-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH 3/3] kni: fix unchecked return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Return value 'rte_kni_init' of a function is not checked. If it fails, error handling (logging and return) should be done. This patch fixed it. Fixes: 0c6bc8ef70ba ("kni: memzone pool for alloc and release") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) Reviewed-by: Ferruh Yigit --- app/test/test_kni.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/test/test_kni.c b/app/test/test_kni.c index 3470005..9673355 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -563,7 +563,11 @@ test_kni(void) closedir(dir); /* Initialize KNI subsystem */ - rte_kni_init(KNI_TEST_MAX_PORTS); + ret = rte_kni_init(KNI_TEST_MAX_PORTS); + if (ret < 0) { + printf("fail to initialize KNI subsystem\n"); + return -1; + } if (test_kni_allocate_lcores() < 0) { printf("No enough lcores for kni processing\n");