From patchwork Mon Apr 19 13:34:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91762 X-Patchwork-Delegate: thomas@monjalon.net 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 49851A0524; Mon, 19 Apr 2021 15:35:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA5B54131E; Mon, 19 Apr 2021 15:35:01 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 01293412F4 for ; Mon, 19 Apr 2021 15:34:50 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FP7623rNtzqTm9; Mon, 19 Apr 2021 21:32:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 21:34:37 +0800 From: "Min Hu (Connor)" To: CC: , , , , , , , , Date: Mon, 19 Apr 2021 21:34:40 +0800 Message-ID: <1618839289-33224-2-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com> References: <1618839289-33224-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 01/10] net/pfe: check 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" Variable 'fd', which may receive negative value when open "/dev/mem" file. This patch added checking return value process. Fixes: 67fc3ff97c39 ("net/pfe: introduce basic functions") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) --- drivers/net/pfe/pfe_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c index 8cf59e2..b4f5591 100644 --- a/drivers/net/pfe/pfe_ethdev.c +++ b/drivers/net/pfe/pfe_ethdev.c @@ -1049,6 +1049,12 @@ pmd_pfe_probe(struct rte_vdev_device *vdev) g_pfe->cbus_size = cbus_size; fd = open("/dev/mem", O_RDWR); + if (fd < 0) { + PFE_PMD_ERR("Can not open /dev/mem"); + rc = -EIO; + goto err; + } + g_pfe->cbus_baseaddr = mmap(NULL, cbus_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, cbus_addr); close(fd); From patchwork Mon Apr 19 13:34:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91763 X-Patchwork-Delegate: thomas@monjalon.net 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 30EC2A0524; Mon, 19 Apr 2021 15:35:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C523E41325; Mon, 19 Apr 2021 15:35:02 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 033EE412F5 for ; Mon, 19 Apr 2021 15:34:50 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FP76244mczqTnT; Mon, 19 Apr 2021 21:32:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 21:34:37 +0800 From: "Min Hu (Connor)" To: CC: , , , , , , , , Date: Mon, 19 Apr 2021 21:34:41 +0800 Message-ID: <1618839289-33224-3-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com> References: <1618839289-33224-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 02/10] common/sfc_efx/base: delete redundant handling 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" the default case in 'rhead_nic_get_bar_region' is unreachable. This patch fixed that. Fixes: 3c1c5cc4a786 ("common/sfc_efx/base: add Riverhead support to NIC module") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) --- drivers/common/sfc_efx/base/rhead_nic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/common/sfc_efx/base/rhead_nic.c b/drivers/common/sfc_efx/base/rhead_nic.c index f2c18c1..b9af348 100644 --- a/drivers/common/sfc_efx/base/rhead_nic.c +++ b/drivers/common/sfc_efx/base/rhead_nic.c @@ -483,8 +483,7 @@ rhead_nic_get_bar_region( break; default: - rc = EINVAL; - goto fail1; + break; } return (0); From patchwork Mon Apr 19 13:34:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91755 X-Patchwork-Delegate: thomas@monjalon.net 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 53033A0524; Mon, 19 Apr 2021 15:34:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D4933412F4; Mon, 19 Apr 2021 15:34:51 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id B1BE0412E6 for ; Mon, 19 Apr 2021 15:34:49 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FP7622g50zqTg4; Mon, 19 Apr 2021 21:32:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 21:34:38 +0800 From: "Min Hu (Connor)" To: CC: , , , , , , , , Date: Mon, 19 Apr 2021 21:34:42 +0800 Message-ID: <1618839289-33224-4-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com> References: <1618839289-33224-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 03/10] bus/dpaa: fix management command init calling 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" 'bm_mc_init' only return 0, but the function whicl calls int check the negative ret, and this is redundant. This patch fixed it by not checking the return value. Fixes: f38f61e982f8 ("bus/dpaa: add BMAN hardware interfaces") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) --- drivers/bus/dpaa/base/qbman/bman.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/bman.c b/drivers/bus/dpaa/base/qbman/bman.c index 8a62907..e1ba2a8 100644 --- a/drivers/bus/dpaa/base/qbman/bman.c +++ b/drivers/bus/dpaa/base/qbman/bman.c @@ -70,10 +70,8 @@ struct bman_portal *bman_create_portal(struct bman_portal *portal, pr_err("Bman RCR initialisation failed\n"); return NULL; } - if (bm_mc_init(p)) { - pr_err("Bman MC initialisation failed\n"); - goto fail_mc; - } + (void)bm_mc_init(p); + portal->pools = kmalloc(2 * sizeof(*pools), GFP_KERNEL); if (!portal->pools) goto fail_pools; From patchwork Mon Apr 19 13:34:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91756 X-Patchwork-Delegate: thomas@monjalon.net 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 0E48FA0524; Mon, 19 Apr 2021 15:35:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A5FA412FB; Mon, 19 Apr 2021 15:34:54 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 0C87D412EB for ; Mon, 19 Apr 2021 15:34:49 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FP762385XzqTjs; Mon, 19 Apr 2021 21:32:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 21:34:38 +0800 From: "Min Hu (Connor)" To: CC: , , , , , , , , Date: Mon, 19 Apr 2021 21:34:43 +0800 Message-ID: <1618839289-33224-5-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com> References: <1618839289-33224-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 04/10] app/regex: fix division by zero 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" Variable nb_jobs, which may be zero, is used as a denominator. This patch fixed it. Fixes: f5cffb7eb7fb ("app/regex: read data file once at startup") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) Acked-by: Ori Kam --- app/test-regex/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/test-regex/main.c b/app/test-regex/main.c index 8e665df..b49fa88 100644 --- a/app/test-regex/main.c +++ b/app/test-regex/main.c @@ -725,9 +725,11 @@ main(int argc, char **argv) if (data_len <= 0) rte_exit(EXIT_FAILURE, "Error, can't read file, or file is empty.\n"); - job_len = data_len / nb_jobs; - if (job_len == 0) - rte_exit(EXIT_FAILURE, "Error, To many jobs, for the given input.\n"); + if (!nb_jobs) { + job_len = data_len / nb_jobs; + if (job_len == 0) + rte_exit(EXIT_FAILURE, "Error, To many jobs, for the given input.\n"); + } if (job_len > nb_max_payload) rte_exit(EXIT_FAILURE, "Error, not enough jobs to cover input.\n"); From patchwork Mon Apr 19 13:34:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91758 X-Patchwork-Delegate: thomas@monjalon.net 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 1944EA0524; Mon, 19 Apr 2021 15:35:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9AAC341309; Mon, 19 Apr 2021 15:34:56 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 11278412ED for ; Mon, 19 Apr 2021 15:34:49 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FP7623cYnzqTm4; Mon, 19 Apr 2021 21:32:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 21:34:38 +0800 From: "Min Hu (Connor)" To: CC: , , , , , , , , Date: Mon, 19 Apr 2021 21:34:44 +0800 Message-ID: <1618839289-33224-6-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com> References: <1618839289-33224-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 05/10] app/test: add null pointer check of memory allocation 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" From: HongBo Zheng The rte_zmalloc is called in test_crc_calc without null pointer check. This patch adds null pointer checks on return value of rte_zmalloc. Fixes: 9c77b848b1c1 ("test: add CRC computation") Cc: stable@dpdk.org Signed-off-by: HongBo Zheng Signed-off-by: Min Hu (Connor) --- app/test/test_crc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test/test_crc.c b/app/test/test_crc.c index bf1d344..8231f81 100644 --- a/app/test/test_crc.c +++ b/app/test/test_crc.c @@ -80,6 +80,8 @@ test_crc_calc(void) /* 32-bit ethernet CRC: Test 2 */ test_data = rte_zmalloc(NULL, CRC32_VEC_LEN1, 0); + if (test_data == NULL) + return -7; for (i = 0; i < CRC32_VEC_LEN1; i += 12) rte_memcpy(&test_data[i], crc32_vec1, 12); From patchwork Mon Apr 19 13:34:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91760 X-Patchwork-Delegate: thomas@monjalon.net 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 5A275A0524; Mon, 19 Apr 2021 15:35:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 379B2412F2; Mon, 19 Apr 2021 15:34:59 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id D02FC412F2 for ; Mon, 19 Apr 2021 15:34:50 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FP7622Qg6zqTg0; Mon, 19 Apr 2021 21:32:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 21:34:39 +0800 From: "Min Hu (Connor)" To: CC: , , , , , , , , Date: Mon, 19 Apr 2021 21:34:45 +0800 Message-ID: <1618839289-33224-7-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com> References: <1618839289-33224-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 06/10] lib/librte_pipeline: fix the use of unsafe strcpy 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" From: HongBo Zheng 'strcpy' is called in rte_swx_ctl_table_info_get, this function is unsafe, use 'strncpy' instead. Fixes: 393b96e2aa2a ("pipeline: add SWX pipeline query API") Cc: stable@dpdk.org Signed-off-by: HongBo Zheng Signed-off-by: Min Hu (Connor) --- lib/librte_pipeline/rte_swx_pipeline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c index 4455d91..d4db4dd 100644 --- a/lib/librte_pipeline/rte_swx_pipeline.c +++ b/lib/librte_pipeline/rte_swx_pipeline.c @@ -9447,8 +9447,8 @@ rte_swx_ctl_table_info_get(struct rte_swx_pipeline *p, if (!t) return -EINVAL; - strcpy(table->name, t->name); - strcpy(table->args, t->args); + strncpy(table->name, t->name, RTE_SWX_CTL_NAME_SIZE); + strncpy(table->args, t->args, RTE_SWX_CTL_NAME_SIZE); table->n_match_fields = t->n_fields; table->n_actions = t->n_actions; table->default_action_is_const = t->default_action_is_const; From patchwork Mon Apr 19 13:34:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91759 X-Patchwork-Delegate: thomas@monjalon.net 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 81170A0524; Mon, 19 Apr 2021 15:35:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D33CB41310; Mon, 19 Apr 2021 15:34:57 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id CD4FD412ED for ; Mon, 19 Apr 2021 15:34:50 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FP7621xshzqTWG; Mon, 19 Apr 2021 21:32:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 21:34:39 +0800 From: "Min Hu (Connor)" To: CC: , , , , , , , , Date: Mon, 19 Apr 2021 21:34:46 +0800 Message-ID: <1618839289-33224-8-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com> References: <1618839289-33224-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 07/10] examples/l3fwd: add function return value check 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" From: HongBo Zheng Return value of a function 'rte_eth_macaddr_get' called at l3fwd_eth_dev_port_setup is not checked, but it is usually checked for this function. This patch fix this problem. Fixes: a65bf3d724df ("examples/l3fwd: add ethdev setup based on eventdev") Cc: stable@dpdk.org Signed-off-by: HongBo Zheng Signed-off-by: Min Hu (Connor) Acked-by: Stephen Hemminger --- examples/l3fwd/l3fwd_event.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c index 4d31593..7f704f9 100644 --- a/examples/l3fwd/l3fwd_event.c +++ b/examples/l3fwd/l3fwd_event.c @@ -105,7 +105,11 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf) "Cannot adjust number of descriptors: err=%d, " "port=%d\n", ret, port_id); - rte_eth_macaddr_get(port_id, &ports_eth_addr[port_id]); + ret = rte_eth_macaddr_get(port_id, &ports_eth_addr[port_id]); + if (ret < 0) + rte_exit(EXIT_FAILURE, + "Cannot get MAC address: err=%d, port=%d\n", + ret, port_id); print_ethaddr(" Address:", &ports_eth_addr[port_id]); printf(", "); print_ethaddr("Destination:", From patchwork Mon Apr 19 13:34:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91764 X-Patchwork-Delegate: thomas@monjalon.net 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 CA780A0524; Mon, 19 Apr 2021 15:35:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D199C4132C; Mon, 19 Apr 2021 15:35:03 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 25314412F6 for ; Mon, 19 Apr 2021 15:34:51 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FP7622vN9zqTh1; Mon, 19 Apr 2021 21:32:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 21:34:40 +0800 From: "Min Hu (Connor)" To: CC: , , , , , , , , Date: Mon, 19 Apr 2021 21:34:47 +0800 Message-ID: <1618839289-33224-9-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com> References: <1618839289-33224-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 08/10] crypto/virtio: fix return values check error 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" From: HongBo Zheng In virtio_crypto_pkt_tx_burst, we check the return values of virtqueue_crypto_enqueue_xmit, which may returns -ENOSPC/-EMSGSIZE, but we only check ENOSPC/EMSGSIZE, and cause the result of checks is always false. This patch fix this problem. Fixes: 82adb12a1fce ("crypto/virtio: support burst enqueue/dequeue") Cc: stable@dpdk.org Signed-off-by: HongBo Zheng Signed-off-by: Min Hu (Connor) Acked-by: Stephen Hemminger --- drivers/crypto/virtio/virtio_rxtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c index e1cb4ad..a35a5b0 100644 --- a/drivers/crypto/virtio/virtio_rxtx.c +++ b/drivers/crypto/virtio/virtio_rxtx.c @@ -500,10 +500,10 @@ virtio_crypto_pkt_tx_burst(void *tx_queue, struct rte_crypto_op **tx_pkts, /* Enqueue Packet buffers */ error = virtqueue_crypto_enqueue_xmit(txvq, tx_pkts[nb_tx]); if (unlikely(error)) { - if (error == ENOSPC) + if (error == -ENOSPC) VIRTIO_CRYPTO_TX_LOG_ERR( "virtqueue_enqueue Free count = 0"); - else if (error == EMSGSIZE) + else if (error == -EMSGSIZE) VIRTIO_CRYPTO_TX_LOG_ERR( "virtqueue_enqueue Free count < 1"); else From patchwork Mon Apr 19 13:34:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91761 X-Patchwork-Delegate: thomas@monjalon.net 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 37B07A0524; Mon, 19 Apr 2021 15:35:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C02E41319; Mon, 19 Apr 2021 15:35:00 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 2689D412F7 for ; Mon, 19 Apr 2021 15:34:51 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FP7623NHfzqTlV; Mon, 19 Apr 2021 21:32:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 21:34:40 +0800 From: "Min Hu (Connor)" To: CC: , , , , , , , , Date: Mon, 19 Apr 2021 21:34:48 +0800 Message-ID: <1618839289-33224-10-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com> References: <1618839289-33224-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 09/10] net/e1000: add function return value check 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" From: HongBo Zheng Return value of a function 'e1000_phy_has_link_generic' called at e1000_kmrn_lock_loss_workaround_ich8lan is not checked, but it is usually checked for this function. This patch fix this problem. Fixes: 5a32a257f957 ("e1000: more NICs in base driver") Cc: stable@dpdk.org Signed-off-by: HongBo Zheng Signed-off-by: Min Hu (Connor) --- drivers/net/e1000/base/e1000_ich8lan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/e1000/base/e1000_ich8lan.c b/drivers/net/e1000/base/e1000_ich8lan.c index 14f86b7..67adc46 100644 --- a/drivers/net/e1000/base/e1000_ich8lan.c +++ b/drivers/net/e1000/base/e1000_ich8lan.c @@ -5406,6 +5406,8 @@ STATIC s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw) * stability */ ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link); + if (ret_val) + return ret_val; if (!link) return E1000_SUCCESS; From patchwork Mon Apr 19 13:34:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91757 X-Patchwork-Delegate: thomas@monjalon.net 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 ABFA3A0524; Mon, 19 Apr 2021 15:35:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5941741301; Mon, 19 Apr 2021 15:34:55 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 0C999412EC for ; Mon, 19 Apr 2021 15:34:49 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FP7621hhdzqTPS; Mon, 19 Apr 2021 21:32:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 21:34:41 +0800 From: "Min Hu (Connor)" To: CC: , , , , , , , , Date: Mon, 19 Apr 2021 21:34:49 +0800 Message-ID: <1618839289-33224-11-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com> References: <1618839289-33224-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 10/10] net/bonding: fix configuration assignment overflow 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" From: Chengchang Tang The expression may cause an overflow. This patch fix the codeDEX static check warning "INTEGER_OVERFLOW". Fixes: 46fb43683679 ("bond: add mode 4") Cc: stable@dpdk.org Signed-off-by: Chengchang Tang Signed-off-by: Min Hu (Connor) Acked-by: Stephen Hemminger --- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 128754f..483f082 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -1237,7 +1237,7 @@ bond_mode_8023ad_conf_assign(struct mode8023ad_private *mode4, mode4->aggregate_wait_timeout = conf->aggregate_wait_timeout_ms * ms_ticks; mode4->tx_period_timeout = conf->tx_period_ms * ms_ticks; mode4->rx_marker_timeout = conf->rx_marker_period_ms * ms_ticks; - mode4->update_timeout_us = conf->update_timeout_ms * 1000; + mode4->update_timeout_us = (uint64_t)conf->update_timeout_ms * 1000; mode4->dedicated_queues.enabled = 0; mode4->dedicated_queues.rx_qid = UINT16_MAX;