From patchwork Tue Jul 9 10:04:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vanshika Shukla X-Patchwork-Id: 142255 X-Patchwork-Delegate: david.marchand@redhat.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 62F56455E2; Tue, 9 Jul 2024 12:05:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E640B40E34; Tue, 9 Jul 2024 12:05:10 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id 42DF040156; Tue, 9 Jul 2024 12:05:08 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1E1651A192F; Tue, 9 Jul 2024 12:05:08 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id DAE951A1936; Tue, 9 Jul 2024 12:05:07 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id DE386183ACAF; Tue, 9 Jul 2024 18:05:06 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena , Gagandeep Singh Cc: stable@dpdk.org, Vanshika Shukla Subject: [v4 1/8] bus/dpaa: fix bus scan for DMA devices Date: Tue, 9 Jul 2024 15:34:58 +0530 Message-Id: <20240709100505.2476972-2-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240709100505.2476972-1-vanshika.shukla@nxp.com> References: <20240708072945.2376209-1-vanshika.shukla@nxp.com> <20240709100505.2476972-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Gagandeep Singh if there is no sec devices available, code is not scanning QDMA dev This patch fix this problem by adding a goto statement instead of return in case no sec device available. Fixes: 583f3732974f ("dma/dpaa: introduce DPAA DMA driver skeleton") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh Signed-off-by: Vanshika Shukla --- drivers/bus/dpaa/dpaa_bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 64b748626b..b8f41ec069 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -221,7 +221,7 @@ dpaa_create_device_list(void) if (dpaa_sec_available()) { DPAA_BUS_LOG(INFO, "DPAA SEC devices are not available"); - return 0; + goto qdma_dpaa; } /* Creating SEC Devices */ @@ -260,6 +260,7 @@ dpaa_create_device_list(void) rte_dpaa_bus.device_count += i; +qdma_dpaa: /* Creating QDMA Device */ for (i = 0; i < RTE_DPAA_QDMA_DEVICES; i++) { dev = calloc(1, sizeof(struct rte_dpaa_device)); From patchwork Tue Jul 9 10:04:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vanshika Shukla X-Patchwork-Id: 142256 X-Patchwork-Delegate: david.marchand@redhat.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 E05E7455E2; Tue, 9 Jul 2024 12:05:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B5DC427B3; Tue, 9 Jul 2024 12:05:12 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 0223940156; Tue, 9 Jul 2024 12:05:08 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id CB51820184A; Tue, 9 Jul 2024 12:05:08 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 93B0A201846; Tue, 9 Jul 2024 12:05:08 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 73D65183AD09; Tue, 9 Jul 2024 18:05:07 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena , Harman Kalra , David Marchand , Hyong Youb Kim Cc: stable@dpdk.org, Apeksha Gupta , Vanshika Shukla Subject: [v4 2/8] bus/dpaa: fix resource leak in variable dev Date: Tue, 9 Jul 2024 15:34:59 +0530 Message-Id: <20240709100505.2476972-3-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240709100505.2476972-1-vanshika.shukla@nxp.com> References: <20240708072945.2376209-1-vanshika.shukla@nxp.com> <20240709100505.2476972-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Apeksha Gupta Resource leak: variable dev is going out of scope leaks the storage. Coverity issue: CID 373703 Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle") Cc: hkalra@marvell.com Cc: stable@dpdk.org Signed-off-by: Apeksha Gupta Signed-off-by: Vanshika Shukla --- drivers/bus/dpaa/dpaa_bus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index b8f41ec069..1f6997c77e 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -188,6 +188,7 @@ dpaa_create_device_list(void) if (dev->intr_handle == NULL) { DPAA_BUS_LOG(ERR, "Failed to allocate intr handle"); ret = -ENOMEM; + free(dev); goto cleanup; } @@ -239,6 +240,7 @@ dpaa_create_device_list(void) if (dev->intr_handle == NULL) { DPAA_BUS_LOG(ERR, "Failed to allocate intr handle"); ret = -ENOMEM; + free(dev); goto cleanup; } From patchwork Tue Jul 9 10:05:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vanshika Shukla X-Patchwork-Id: 142257 X-Patchwork-Delegate: david.marchand@redhat.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 CA5EE455E2; Tue, 9 Jul 2024 12:05:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A2B442E64; Tue, 9 Jul 2024 12:05:13 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 2275A4026C; Tue, 9 Jul 2024 12:05:09 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 03E58201374; Tue, 9 Jul 2024 12:05:09 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BF141201847; Tue, 9 Jul 2024 12:05:08 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 19818183ACAC; Tue, 9 Jul 2024 18:05:08 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena , Shreyansh Jain Cc: stable@dpdk.org, Gagandeep Singh , Vanshika Shukla Subject: [v4 3/8] common/dpaax: fix IOVA table cleanup Date: Tue, 9 Jul 2024 15:35:00 +0530 Message-Id: <20240709100505.2476972-4-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240709100505.2476972-1-vanshika.shukla@nxp.com> References: <20240708072945.2376209-1-vanshika.shukla@nxp.com> <20240709100505.2476972-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Gagandeep Singh Fixes incorrect structure free Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh Signed-off-by: Vanshika Shukla --- drivers/common/dpaax/dpaax_iova_table.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c index 9daac4bc03..d2a78f4c19 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2023 NXP */ #include @@ -255,10 +255,7 @@ dpaax_iova_table_populate(void) void dpaax_iova_table_depopulate(void) { - if (dpaax_iova_table_p == NULL) - return; - - rte_free(dpaax_iova_table_p->entries); + rte_free(dpaax_iova_table_p); dpaax_iova_table_p = NULL; DPAAX_DEBUG("IOVA Table cleaned"); From patchwork Tue Jul 9 10:05:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vanshika Shukla X-Patchwork-Id: 142258 X-Patchwork-Delegate: david.marchand@redhat.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 C3D8F455E2; Tue, 9 Jul 2024 12:05:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB5FF432AA; Tue, 9 Jul 2024 12:05:14 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id A9A2340156; Tue, 9 Jul 2024 12:05:09 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8CBA8201850; Tue, 9 Jul 2024 12:05:09 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5176D201847; Tue, 9 Jul 2024 12:05:09 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 9E79A183ACAE; Tue, 9 Jul 2024 18:05:08 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena , Shreyansh Jain Cc: stable@dpdk.org, Apeksha Gupta , Vanshika Shukla Subject: [v4 4/8] common/dpaax: fix array overrun issue Date: Tue, 9 Jul 2024 15:35:01 +0530 Message-Id: <20240709100505.2476972-5-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240709100505.2476972-1-vanshika.shukla@nxp.com> References: <20240708072945.2376209-1-vanshika.shukla@nxp.com> <20240709100505.2476972-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Apeksha Gupta Out-of-bounds read, Overrunning dynamic array nodes at offset corresponding to index variable j. Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table") Cc: stable@dpdk.org Signed-off-by: Apeksha Gupta Signed-off-by: Vanshika Shukla --- drivers/common/dpaax/dpaax_iova_table.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c index d2a78f4c19..860e702333 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -139,10 +139,12 @@ read_memory_node(unsigned int *count) } DPAAX_DEBUG("Device-tree memory node data:"); - do { + + while (j > 0) { + --j; DPAAX_DEBUG(" %08" PRIx64 " %08zu", nodes[j].addr, nodes[j].len); - } while (--j); + } cleanup: close(fd); From patchwork Tue Jul 9 10:05:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vanshika Shukla X-Patchwork-Id: 142259 X-Patchwork-Delegate: david.marchand@redhat.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 9B28B455E2; Tue, 9 Jul 2024 12:05:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2ECAE432B8; Tue, 9 Jul 2024 12:05:16 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 47E6C40156; Tue, 9 Jul 2024 12:05:10 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1DB70201855; Tue, 9 Jul 2024 12:05:10 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D8F7320137E; Tue, 9 Jul 2024 12:05:09 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 31CD8181D0F9; Tue, 9 Jul 2024 18:05:09 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena , Shreyansh Jain Cc: stable@dpdk.org, Rohit Raj , Vanshika Shukla Subject: [v4 5/8] bus/dpaa: remove redundant file descriptor check Date: Tue, 9 Jul 2024 15:35:02 +0530 Message-Id: <20240709100505.2476972-6-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240709100505.2476972-1-vanshika.shukla@nxp.com> References: <20240708072945.2376209-1-vanshika.shukla@nxp.com> <20240709100505.2476972-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Rohit Raj This patch removes the redundant file descriptor check Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table") Cc: stable@dpdk.org Signed-off-by: Rohit Raj Signed-off-by: Vanshika Shukla --- drivers/bus/dpaa/base/qbman/process.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/process.c b/drivers/bus/dpaa/base/qbman/process.c index 59e0d641ce..2d805c5bd9 100644 --- a/drivers/bus/dpaa/base/qbman/process.c +++ b/drivers/bus/dpaa/base/qbman/process.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) * * Copyright 2011-2016 Freescale Semiconductor Inc. - * Copyright 2017,2020 NXP + * Copyright 2017,2020,2022,2024 NXP * */ #include @@ -28,15 +28,16 @@ static int check_fd(void) { int ret; - if (fd >= 0) - return 0; ret = pthread_mutex_lock(&fd_init_lock); assert(!ret); + /* check again with the lock held */ if (fd < 0) fd = open(PROCESS_PATH, O_RDWR); + ret = pthread_mutex_unlock(&fd_init_lock); assert(!ret); + return (fd >= 0) ? 0 : -ENODEV; } From patchwork Tue Jul 9 10:05:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vanshika Shukla X-Patchwork-Id: 142260 X-Patchwork-Delegate: david.marchand@redhat.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 A2293455E2; Tue, 9 Jul 2024 12:05:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20B764333C; Tue, 9 Jul 2024 12:05:17 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id E571840E09 for ; Tue, 9 Jul 2024 12:05:10 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BEC0420185C; Tue, 9 Jul 2024 12:05:10 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 4F48D200F89; Tue, 9 Jul 2024 12:05:10 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id B9585183AC99; Tue, 9 Jul 2024 18:05:09 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Gagandeep Singh , Vanshika Shukla Subject: [v4 6/8] bus/dpaa: remove unused code Date: Tue, 9 Jul 2024 15:35:03 +0530 Message-Id: <20240709100505.2476972-7-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240709100505.2476972-1-vanshika.shukla@nxp.com> References: <20240708072945.2376209-1-vanshika.shukla@nxp.com> <20240709100505.2476972-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Gagandeep Singh The slow poll code is not being used in DPDK DPAA driver sub-system. Signed-off-by: Gagandeep Singh Signed-off-by: Vanshika Shukla --- drivers/bus/dpaa/base/qbman/qman.c | 31 ----------------------------- drivers/bus/dpaa/include/fsl_qman.h | 31 ----------------------------- drivers/bus/dpaa/version.map | 1 - 3 files changed, 63 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index b1166fcb1f..cc10def861 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -69,7 +69,6 @@ struct qman_portal { /* interrupt sources processed by portal_isr(), configurable */ unsigned long irq_sources; u32 use_eqcr_ci_stashing; - u32 slowpoll; /* only used when interrupts are off */ /* only 1 volatile dequeue at a time */ struct qman_fq *vdqcr_owned; u32 sdqcr; @@ -569,7 +568,6 @@ qman_init_portal(struct qman_portal *portal, INIT_LIST_HEAD(&portal->cgr_cbs); spin_lock_init(&portal->cgr_lock); portal->bits = 0; - portal->slowpoll = 0; portal->sdqcr = QM_SDQCR_SOURCE_CHANNELS | QM_SDQCR_COUNT_UPTO3 | QM_SDQCR_DEDICATED_PRECEDENCE | QM_SDQCR_TYPE_PRIO_QOS | QM_SDQCR_TOKEN_SET(0xab) | QM_SDQCR_CHANNELS_DEDICATED; @@ -1370,35 +1368,6 @@ void qman_dqrr_consume(struct qman_fq *fq, qm_dqrr_next(&p->p); } -int qman_poll_dqrr(unsigned int limit) -{ - struct qman_portal *p = get_affine_portal(); - int ret; - - ret = __poll_portal_fast(p, limit); - return ret; -} - -void qman_poll(void) -{ - struct qman_portal *p = get_affine_portal(); - - if ((~p->irq_sources) & QM_PIRQ_SLOW) { - if (!(p->slowpoll--)) { - u32 is = qm_isr_status_read(&p->p) & ~p->irq_sources; - u32 active = __poll_portal_slow(p, is); - - if (active) { - qm_isr_status_clear(&p->p, active); - p->slowpoll = SLOW_POLL_BUSY; - } else - p->slowpoll = SLOW_POLL_IDLE; - } - } - if ((~p->irq_sources) & QM_PIRQ_DQRI) - __poll_portal_fast(p, FSL_QMAN_POLL_LIMIT); -} - void qman_stop_dequeues(void) { struct qman_portal *p = get_affine_portal(); diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index acdfb45ad6..c0677976e8 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1429,37 +1429,6 @@ __rte_internal void qman_dqrr_consume(struct qman_fq *fq, struct qm_dqrr_entry *dq); -/** - * qman_poll_dqrr - process DQRR (fast-path) entries - * @limit: the maximum number of DQRR entries to process - * - * Use of this function requires that DQRR processing not be interrupt-driven. - * Ie. the value returned by qman_irqsource_get() should not include - * QM_PIRQ_DQRI. If the current CPU is sharing a portal hosted on another CPU, - * this function will return -EINVAL, otherwise the return value is >=0 and - * represents the number of DQRR entries processed. - */ -__rte_internal -int qman_poll_dqrr(unsigned int limit); - -/** - * qman_poll - * - * Dispatcher logic on a cpu can use this to trigger any maintenance of the - * affine portal. There are two classes of portal processing in question; - * fast-path (which involves demuxing dequeue ring (DQRR) entries and tracking - * enqueue ring (EQCR) consumption), and slow-path (which involves EQCR - * thresholds, congestion state changes, etc). This function does whatever - * processing is not triggered by interrupts. - * - * Note, if DQRR and some slow-path processing are poll-driven (rather than - * interrupt-driven) then this function uses a heuristic to determine how often - * to run slow-path processing - as slow-path processing introduces at least a - * minimum latency each time it is run, whereas fast-path (DQRR) processing is - * close to zero-cost if there is no work to be done. - */ -void qman_poll(void); - /** * qman_stop_dequeues - Stop h/w dequeuing to the s/w portal * diff --git a/drivers/bus/dpaa/version.map b/drivers/bus/dpaa/version.map index 1a840fd1a5..3f547f75cf 100644 --- a/drivers/bus/dpaa/version.map +++ b/drivers/bus/dpaa/version.map @@ -82,7 +82,6 @@ INTERNAL { qman_irqsource_remove; qman_modify_cgr; qman_oos_fq; - qman_poll_dqrr; qman_portal_dequeue; qman_portal_poll_rx; qman_query_fq_frm_cnt; From patchwork Tue Jul 9 10:05:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vanshika Shukla X-Patchwork-Id: 142261 X-Patchwork-Delegate: david.marchand@redhat.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 63621455E2; Tue, 9 Jul 2024 12:05:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A3BE43338; Tue, 9 Jul 2024 12:05:18 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id 318E3410F9; Tue, 9 Jul 2024 12:05:11 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 132471A1936; Tue, 9 Jul 2024 12:05:11 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id CF50C1A0CCB; Tue, 9 Jul 2024 12:05:10 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 2F1F8181D0F9; Tue, 9 Jul 2024 18:05:10 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena , Jun Yang Cc: stable@dpdk.org, Rohit Raj , Vanshika Shukla Subject: [v4 7/8] net/dpaa: restrict MTU config for shared intf Date: Tue, 9 Jul 2024 15:35:04 +0530 Message-Id: <20240709100505.2476972-8-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240709100505.2476972-1-vanshika.shukla@nxp.com> References: <20240708072945.2376209-1-vanshika.shukla@nxp.com> <20240709100505.2476972-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Rohit Raj Since DPDK was able to configure mtu in VSP/Shared interface mode, it was causing misconfiguration of the hw which further caused crashes. This patch allow only kernel to config MTU in such cases Fixes: e4abd4ff183c ("net/dpaa: support virtual storage profile") Cc: jun.yang@nxp.com Cc: stable@dpdk.org Signed-off-by: Rohit Raj Signed-off-by: Vanshika Shukla --- drivers/net/dpaa/dpaa_ethdev.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 44bac67803..060b8c678f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -165,9 +166,15 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) uint32_t frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE; uint32_t buffsz = dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM; + struct fman_if *fif = dev->process_private; PMD_INIT_FUNC_TRACE(); + if (fif->is_shared_mac) { + DPAA_PMD_ERR("Cannot configure mtu from DPDK in VSP mode."); + return -ENOTSUP; + } + /* * Refuse mtu that requires the support of scattered packets * when this feature has not been enabled before. @@ -206,7 +213,8 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) struct rte_intr_handle *intr_handle; uint32_t max_rx_pktlen; int speed, duplex; - int ret, rx_status; + int ret, rx_status, socket_fd; + struct ifreq ifr; PMD_INIT_FUNC_TRACE(); @@ -222,6 +230,26 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) dpaa_intf->name); return -EHOSTDOWN; } + + socket_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); + if (socket_fd == -1) { + DPAA_PMD_ERR("Cannot open IF socket"); + return -errno; + } + + strncpy(ifr.ifr_name, dpaa_intf->name, IFNAMSIZ - 1); + + if (ioctl(socket_fd, SIOCGIFMTU, &ifr) < 0) { + DPAA_PMD_ERR("Cannot get interface mtu"); + close(socket_fd); + return -errno; + } + + close(socket_fd); + DPAA_PMD_INFO("Using kernel configured mtu size(%u)", + ifr.ifr_mtu); + + eth_conf->rxmode.mtu = ifr.ifr_mtu; } /* Rx offloads which are enabled by default */ @@ -249,7 +277,8 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) max_rx_pktlen = DPAA_MAX_RX_PKT_LEN; } - fman_if_set_maxfrm(dev->process_private, max_rx_pktlen); + if (!fif->is_shared_mac) + fman_if_set_maxfrm(dev->process_private, max_rx_pktlen); if (rx_offloads & RTE_ETH_RX_OFFLOAD_SCATTER) { DPAA_PMD_DEBUG("enabling scatter mode"); From patchwork Tue Jul 9 10:05:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vanshika Shukla X-Patchwork-Id: 142262 X-Patchwork-Delegate: david.marchand@redhat.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 05FB2455E2; Tue, 9 Jul 2024 12:05:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8ABCD43351; Tue, 9 Jul 2024 12:05:19 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id D12E1410F9 for ; Tue, 9 Jul 2024 12:05:11 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B6671200F89; Tue, 9 Jul 2024 12:05:11 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7CDF0201855; Tue, 9 Jul 2024 12:05:11 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id ED6A7183AC99; Tue, 9 Jul 2024 18:05:10 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Vanshika Shukla Subject: [v4 8/8] mempool/dpaax: cache free optimization Date: Tue, 9 Jul 2024 15:35:05 +0530 Message-Id: <20240709100505.2476972-9-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240709100505.2476972-1-vanshika.shukla@nxp.com> References: <20240708072945.2376209-1-vanshika.shukla@nxp.com> <20240709100505.2476972-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Sachin Saxena - Updates the cache threshold value as per the platform specific optimal value. Signed-off-by: Sachin Saxena Signed-off-by: Vanshika Shukla --- drivers/mempool/dpaa/dpaa_mempool.c | 16 +++++++++++++++- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c index 21e8938cc6..74bfcab509 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.c +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * - * Copyright 2017,2019 NXP + * Copyright 2017,2019,2023 NXP * */ @@ -51,6 +51,8 @@ dpaa_mbuf_create_pool(struct rte_mempool *mp) struct bman_pool_params params = { .flags = BMAN_POOL_FLAG_DYNAMIC_BPID }; + unsigned int lcore_id; + struct rte_mempool_cache *cache; MEMPOOL_INIT_FUNC_TRACE(); @@ -118,6 +120,18 @@ dpaa_mbuf_create_pool(struct rte_mempool *mp) rte_memcpy(bp_info, (void *)&rte_dpaa_bpid_info[bpid], sizeof(struct dpaa_bp_info)); mp->pool_data = (void *)bp_info; + /* Update per core mempool cache threshold to optimal value which is + * number of buffers that can be released to HW buffer pool in + * a single API call. + */ + for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { + cache = &mp->local_cache[lcore_id]; + DPAA_MEMPOOL_DEBUG("lCore %d: cache->flushthresh %d -> %d", + lcore_id, cache->flushthresh, + (uint32_t)(cache->size + DPAA_MBUF_MAX_ACQ_REL)); + if (cache->flushthresh) + cache->flushthresh = cache->size + DPAA_MBUF_MAX_ACQ_REL; + } DPAA_MEMPOOL_INFO("BMAN pool created for bpid =%d", bpid); return 0; diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index 4c9245cb81..fe82475b10 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -44,6 +44,8 @@ rte_hw_mbuf_create_pool(struct rte_mempool *mp) struct dpaa2_bp_info *bp_info; struct dpbp_attr dpbp_attr; uint32_t bpid; + unsigned int lcore_id; + struct rte_mempool_cache *cache; int ret; avail_dpbp = dpaa2_alloc_dpbp_dev(); @@ -132,6 +134,19 @@ rte_hw_mbuf_create_pool(struct rte_mempool *mp) DPAA2_MEMPOOL_DEBUG("BP List created for bpid =%d", dpbp_attr.bpid); h_bp_list = bp_list; + /* Update per core mempool cache threshold to optimal value which is + * number of buffers that can be released to HW buffer pool in + * a single API call. + */ + for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { + cache = &mp->local_cache[lcore_id]; + DPAA2_MEMPOOL_DEBUG("lCore %d: cache->flushthresh %d -> %d\n", + lcore_id, cache->flushthresh, + (uint32_t)(cache->size + DPAA2_MBUF_MAX_ACQ_REL)); + if (cache->flushthresh) + cache->flushthresh = cache->size + DPAA2_MBUF_MAX_ACQ_REL; + } + return 0; err3: rte_free(bp_info);