From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36FA0C5DF81 for ; Thu, 20 Aug 2026 14:43:23 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 675F340696; Thu, 20 Aug 2026 16:43:19 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id 7C51040685; Thu, 20 Aug 2026 16:43:18 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5D4291A01A5; Thu, 20 Aug 2026 16:43:18 +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 26EA81A0105; Thu, 20 Aug 2026 16:43:18 +0200 (CEST) Received: from lsv03583.swis.in-blr01.nxp.com (lsv03583.swis.in-blr01.nxp.com [92.120.146.12]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 6BBF718000B1; Thu, 20 Aug 2026 22:43:16 +0800 (+08) From: Hemant Agrawal To: stephen@networkplumber.org, thomas@monjalon.net, dev@dpdk.org Cc: stable@dpdk.org, Gagandeep Singh Subject: [PATCH v14 01/23] net/dpaa: fix device remove Date: Thu, 20 Aug 2026 20:12:50 +0530 Message-Id: <20260820144312.3922316-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260820144312.3922316-1-hemant.agrawal@nxp.com> References: <20260819105004.2272880-1-hemant.agrawal@nxp.com> <20260820144312.3922316-1-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Adds a check to not to close device if already closed. Fixes: 78ea4b4fcb52 ("bus/dpaa: improve cleanup") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh --- drivers/net/dpaa/dpaa_ethdev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 4dc4d1f10c..77730f16e3 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -2677,9 +2677,12 @@ rte_dpaa_remove(struct rte_dpaa_device *dpaa_dev) PMD_INIT_FUNC_TRACE(); eth_dev = rte_eth_dev_allocated(dpaa_dev->device.name); - ret = dpaa_eth_dev_close(eth_dev); - if (eth_dev->state != RTE_ETH_DEV_UNUSED) { - dpaa_eth_dev_close(eth_dev); + if (eth_dev && eth_dev->state != RTE_ETH_DEV_UNUSED) { + int close_ret = dpaa_eth_dev_close(eth_dev); + + if (close_ret) + DPAA_PMD_WARN("%s: close failed (%d), releasing port anyway", + dpaa_dev->device.name, close_ret); ret = rte_eth_dev_release_port(eth_dev); } dpaa_valid_dev--; -- 2.25.1