From patchwork Fri Jul 5 07:42:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vanshika.shukla@nxp.com X-Patchwork-Id: 142128 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 654A645593; Fri, 5 Jul 2024 09:42:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47B4A42F99; Fri, 5 Jul 2024 09:42:14 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id C58DD4029C; Fri, 5 Jul 2024 09:42:12 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 62FD51A0566; Fri, 5 Jul 2024 09:42:12 +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 2C6A81A055E; Fri, 5 Jul 2024 09:42:12 +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 318F8183487B; Fri, 5 Jul 2024 15:42:11 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena , Gagandeep Singh Cc: stable@dpdk.org, Vanshika Shukla Subject: [v2 1/7] bus/dpaa: fix bus scan for DMA devices Date: Fri, 5 Jul 2024 13:12:02 +0530 Message-Id: <20240705074208.1902771-2-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074208.1902771-1-vanshika.shukla@nxp.com> References: <20240703111644.1523242-1-vanshika.shukla@nxp.com> <20240705074208.1902771-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 5d4352bb3c..de190eb569 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 Fri Jul 5 07:42:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vanshika.shukla@nxp.com X-Patchwork-Id: 142129 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 CADA745593; Fri, 5 Jul 2024 09:42:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C3E543267; Fri, 5 Jul 2024 09:42:16 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id DCC0040EE2; Fri, 5 Jul 2024 09:42:12 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BA775200570; Fri, 5 Jul 2024 09:42:12 +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 81C77200128; Fri, 5 Jul 2024 09:42:12 +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 BB2BE180226C; Fri, 5 Jul 2024 15:42:11 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena , David Marchand , Harman Kalra , Hyong Youb Kim Cc: stable@dpdk.org, Apeksha Gupta , Vanshika Shukla Subject: [v2 2/7] bus/dpaa: fix resource leak in variable dev Date: Fri, 5 Jul 2024 13:12:03 +0530 Message-Id: <20240705074208.1902771-3-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074208.1902771-1-vanshika.shukla@nxp.com> References: <20240703111644.1523242-1-vanshika.shukla@nxp.com> <20240705074208.1902771-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. 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 de190eb569..6ea27d8fb6 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 Fri Jul 5 07:42:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vanshika.shukla@nxp.com X-Patchwork-Id: 142130 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 E666D45593; Fri, 5 Jul 2024 09:42:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9601D43274; Fri, 5 Jul 2024 09:42:17 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id BFEA140EE2; Fri, 5 Jul 2024 09:42:13 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A1AE11A0566; Fri, 5 Jul 2024 09:42:13 +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 6A6431A1D7C; Fri, 5 Jul 2024 09:42:13 +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 618A91820F57; Fri, 5 Jul 2024 15:42:12 +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: [v2 3/7] common/dpaax: fix IOVA table cleanup Date: Fri, 5 Jul 2024 13:12:04 +0530 Message-Id: <20240705074208.1902771-4-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074208.1902771-1-vanshika.shukla@nxp.com> References: <20240703111644.1523242-1-vanshika.shukla@nxp.com> <20240705074208.1902771-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 Fri Jul 5 07:42:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vanshika.shukla@nxp.com X-Patchwork-Id: 142131 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 37B4045593; Fri, 5 Jul 2024 09:42:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF14043269; Fri, 5 Jul 2024 09:42:18 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 6809442FC5; Fri, 5 Jul 2024 09:42:14 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3C519201D20; Fri, 5 Jul 2024 09:42:14 +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 0303D200608; Fri, 5 Jul 2024 09:42:14 +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 E8F5F180226C; Fri, 5 Jul 2024 15:42:12 +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: [v2 4/7] common/dpaax: fix array overrun issue Date: Fri, 5 Jul 2024 13:12:05 +0530 Message-Id: <20240705074208.1902771-5-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074208.1902771-1-vanshika.shukla@nxp.com> References: <20240703111644.1523242-1-vanshika.shukla@nxp.com> <20240705074208.1902771-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 Fri Jul 5 07:42:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vanshika.shukla@nxp.com X-Patchwork-Id: 142132 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 AE1DD45593; Fri, 5 Jul 2024 09:42:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 962F2432A2; Fri, 5 Jul 2024 09:42:20 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 8D60E42FCD; Fri, 5 Jul 2024 09:42:14 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6B44E2005CE; Fri, 5 Jul 2024 09:42:14 +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 33AA42005F8; Fri, 5 Jul 2024 09:42:14 +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 815B7180222B; Fri, 5 Jul 2024 15:42:13 +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: [v2 5/7] bus/dpaa: remove redundant file descriptor check Date: Fri, 5 Jul 2024 13:12:06 +0530 Message-Id: <20240705074208.1902771-6-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074208.1902771-1-vanshika.shukla@nxp.com> References: <20240703111644.1523242-1-vanshika.shukla@nxp.com> <20240705074208.1902771-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 3504ec97db..3e4622f606 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 @@ -27,15 +27,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 Fri Jul 5 07:42:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vanshika.shukla@nxp.com X-Patchwork-Id: 142133 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 8E26D45593; Fri, 5 Jul 2024 09:42:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71F00432C8; Fri, 5 Jul 2024 09:42:22 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 2EA9D42FC5 for ; Fri, 5 Jul 2024 09:42:15 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0DB632005CE; Fri, 5 Jul 2024 09:42:15 +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 9D1AF2005D3; Fri, 5 Jul 2024 09:42:14 +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 14355183ACAE; Fri, 5 Jul 2024 15:42:14 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Gagandeep Singh , Vanshika Shukla Subject: [v2 6/7] bus/dpaa: remove unused code Date: Fri, 5 Jul 2024 13:12:07 +0530 Message-Id: <20240705074208.1902771-7-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074208.1902771-1-vanshika.shukla@nxp.com> References: <20240703111644.1523242-1-vanshika.shukla@nxp.com> <20240705074208.1902771-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 6d2fbdcf02..d3e236b333 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 Fri Jul 5 07:42:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vanshika.shukla@nxp.com X-Patchwork-Id: 142134 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 6614B45593; Fri, 5 Jul 2024 09:42:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0B55432D2; Fri, 5 Jul 2024 09:42:23 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 5C83642FCD for ; Fri, 5 Jul 2024 09:42:15 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3E56C2005D3; Fri, 5 Jul 2024 09:42:15 +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 100D4200DA5; Fri, 5 Jul 2024 09:42:15 +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 7B522180222B; Fri, 5 Jul 2024 15:42:14 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Rohit Raj , Vanshika Shukla Subject: [v2 7/7] net/dpaa: restrict MTU config for shared intf Date: Fri, 5 Jul 2024 13:12:08 +0530 Message-Id: <20240705074208.1902771-8-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074208.1902771-1-vanshika.shukla@nxp.com> References: <20240703111644.1523242-1-vanshika.shukla@nxp.com> <20240705074208.1902771-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 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 935a4f2ada..c25576b7c7 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); + + 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");