From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 434C243B7D for ; Tue, 5 Mar 2024 10:57:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39C8E4026B; Tue, 5 Mar 2024 10:57:35 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2066.outbound.protection.outlook.com [40.107.93.66]) by mails.dpdk.org (Postfix) with ESMTP id 1F65E4014F for ; Tue, 5 Mar 2024 10:57:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AE0GGnnsRWclW/O3I/X1xHZuFENQy23XJ3vl5t2JigAkMYDGnOXwydzIocWJlZX25wRjZazzlpF123jvAFT3T5MjqZ7GrSikIUNwTIygUkhnpBiNjVo869BZoscCQ3m2oHnZ/x7jKIrmScqzpbHMjjdsJSWhpPKInq0SszUS6TZ53vafOFuZmcHNl5LG4fYtia4StIin/+DdTyxj+j6ybgrIJrVeKTxLFVTmnR+6fOGKmB66sMpex/O1q0GKju2e9cTtk3IGS8GcvdLiZyal18aQ4UECTdgj4BwxM66R5NeWEBBBBODtDueFeqURD6oPkuLHlxSnaslrzF4D/GRZIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EjkLURAk8vujFmfcmLOvQg2q/0cmFzi74rtfeYl04Vc=; b=Re+SWRwmsThi70KKmqEEtAxoALY3v5RIPUapvpWJuN3kkqUn6LWfdRgQB+h+VrDsfOdlI1BGQII050EJBw/cWlaTnw4UeBDHmbLXcdq45k1e2PLhy/rLiEA28CZexRvFe6kHNGEUKzPaVA5Px1kOQD9tHQay7WboYONFNxV7/Zzdq/QZOaaZzmCn5Xl1TdZ0zzGn8/e84wHCcLr3EEPRgXzMIY2JPWZkavFdpOfznDgykITnO7II+7j3w/D2PaCu7VNrWkFYRjkarzdXVc/68vufyJNv+HgcEYW9/8gQQ5plqj29eNB4zsfhuzRpfsXS0jw3TL7cMd/hdHHhN6PYOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=amd.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EjkLURAk8vujFmfcmLOvQg2q/0cmFzi74rtfeYl04Vc=; b=FgEUgoJeFkxWGUjUh63nj0wg1s/bGuIexHeJSbjvIcHT9Fd/DbbCpZdmExkOxEixZszN2xut+6FyodIlPRxqdnpOMkRWX0ycCH5K69Yghg8XqpufgdjG3PLaBOTohUNnB0TWnZjZ5t8/mtbU2lyffrLyXstEh2NqddjFL/llbY8/EHDKrmpi4teC7riNThlb2HvsDht4/46DbQdoJJ3QSGe1GtV0kIP2ocEIF13VJJNLCpfKUcEGeSH1KdvSsbUCdjiy6oNjaSR+m6blE8zW5s5dnhFNj7yW1qLompTmPMHINNsKnR0c4LTqedaZzLehqKjnz7Qmw2l8Hllo53BnUA== Received: from MWH0EPF00056D0A.namprd21.prod.outlook.com (2603:10b6:30f:fff2:0:1:0:a) by CH3PR12MB9394.namprd12.prod.outlook.com (2603:10b6:610:1cf::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Tue, 5 Mar 2024 09:57:29 +0000 Received: from CO1PEPF000042A8.namprd03.prod.outlook.com (2a01:111:f403:c903::) by MWH0EPF00056D0A.outlook.office365.com (2603:1036:d20::b) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.4 via Frontend Transport; Tue, 5 Mar 2024 09:57:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000042A8.mail.protection.outlook.com (10.167.243.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 09:57:28 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 5 Mar 2024 01:57:11 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Tue, 5 Mar 2024 01:57:10 -0800 From: Xueming Li To: Andrew Boyer CC: dpdk stable Subject: patch 'net/ionic: fix device close' has been queued to stable release 23.11.1 Date: Tue, 5 Mar 2024 17:47:24 +0800 Message-ID: <20240305094757.439387-104-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042A8:EE_|CH3PR12MB9394:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b81f250-eaa7-49a1-c36a-08dc3cfaaac6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gzllppenlYi3Y6YVPrSbHcLsMOmoKNT3nvXO5pGdfhn470u/+p6Iyw39YPiC/rA0n4nPHcha/MXsoM8QbTrJ4w//STgFsJiE9fTqCXNwMGzYwMdjzwPGEGKM9OxrJQIjQo5SexdMNjEkHQqholJzUi3MMAlxbsTyCHCzyRP70zhYpDiPav3zNpInB/ePrFPtf2xy92yuk32cvlTfWT521qvJQxqHH5j06f9CeSMRWkNdwKE9DTfIal1Y3PKjnaT7BefekF+weKAeLg7k7osp4Y0cEmJBX5D0GgDAxxCF3Sf7Nfbr/5vdsQrwViBSLnPDTVFHZFDHdgvi+OBGIqUUpNtjX49Mv3NL19IbQRUx2rJ88K3qPGooVriCJDxazPAu2Ca+RdKprsElCTG2QJ3WP7/gqD2xMcTm998X8ebVI3LR03PQ3Yzjstvxjiz1XT26jCxZ2EYS4wEL8mPCMppnTJY0RQ/wq9flxUs+mkO9m/M6KUjGvN0wk1JM6O1HflX63Yn1Q45jHknCpKoO0A4TTfVd9w/7s2WYnoqSuDgWvX/N5DPM67HmuoDbzzhd1xGEY96tQ6goOIKjGldcF51WLY78A7bbWXeX40kibGgLetxyfiCeM7JlqamQD9qX7t8tceMoTE42OZ4Oq4RZ/p8ZwtUtQoTxX6tYoxqSRsNIbrDBvWsfzDUydmyW4iU33a+wHTbi3rV716b9yLp5By7HgG2DxlklvhG7W2JYIwvy5Q9mAMyGTI80o8QWe6XMpcTL X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(376005)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 09:57:28.2848 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b81f250-eaa7-49a1-c36a-08dc3cfaaac6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042A8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9394 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 23.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/31/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1ce60b941d17ee06fec8c363f8e58a6db0616af0 Thanks. Xueming Li --- >From 1ce60b941d17ee06fec8c363f8e58a6db0616af0 Mon Sep 17 00:00:00 2001 From: Andrew Boyer Date: Tue, 6 Feb 2024 19:13:14 -0800 Subject: [PATCH] net/ionic: fix device close Cc: Xueming Li [ upstream commit 73028be3b4d4d52f5d73becfd22bff3f57a81252 ] The close routine should release all resources, but not call rte_eth_dev_destroy(). As written this code will call rte_eth_dev_release_port() twice and segfault. Instead, move rte_eth_dev_destroy() to the remove routine. eth_ionic_dev_uninit() will call close if necessary. Fixes: 175e4e7ed760 ("net/ionic: complete release on close") Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_ethdev.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index 008e50e0b9..4ec9598b8e 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -970,19 +970,21 @@ ionic_dev_close(struct rte_eth_dev *eth_dev) ionic_lif_stop(lif); - ionic_lif_free_queues(lif); - IONIC_PRINT(NOTICE, "Removing device %s", eth_dev->device->name); if (adapter->intf->unconfigure_intr) (*adapter->intf->unconfigure_intr)(adapter); - rte_eth_dev_destroy(eth_dev, eth_ionic_dev_uninit); - ionic_port_reset(adapter); ionic_reset(adapter); + + ionic_lif_free_queues(lif); + ionic_lif_deinit(lif); + ionic_lif_free(lif); /* Does not free LIF object */ + if (adapter->intf->unmap_bars) (*adapter->intf->unmap_bars)(adapter); + lif->adapter = NULL; rte_free(adapter); return 0; @@ -1059,21 +1061,18 @@ err: static int eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev) { - struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev); - struct ionic_adapter *adapter = lif->adapter; - IONIC_PRINT_CALL(); if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - adapter->lif = NULL; - - ionic_lif_deinit(lif); - ionic_lif_free(lif); + if (eth_dev->state != RTE_ETH_DEV_UNUSED) + ionic_dev_close(eth_dev); - if (!(lif->state & IONIC_LIF_F_FW_RESET)) - ionic_lif_reset(lif); + eth_dev->dev_ops = NULL; + eth_dev->rx_pkt_burst = NULL; + eth_dev->tx_pkt_burst = NULL; + eth_dev->tx_pkt_prepare = NULL; return 0; } @@ -1228,17 +1227,18 @@ eth_ionic_dev_remove(struct rte_device *rte_dev) { char name[RTE_ETH_NAME_MAX_LEN]; struct rte_eth_dev *eth_dev; + int ret = 0; /* Adapter lookup is using the eth_dev name */ snprintf(name, sizeof(name), "%s_lif", rte_dev->name); eth_dev = rte_eth_dev_allocated(name); if (eth_dev) - ionic_dev_close(eth_dev); + ret = rte_eth_dev_destroy(eth_dev, eth_ionic_dev_uninit); else IONIC_PRINT(DEBUG, "Cannot find device %s", rte_dev->name); - return 0; + return ret; } RTE_LOG_REGISTER_DEFAULT(ionic_logtype, NOTICE); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 17:39:34.091610403 +0800 +++ 0103-net-ionic-fix-device-close.patch 2024-03-05 17:39:30.883566497 +0800 @@ -1 +1 @@ -From 73028be3b4d4d52f5d73becfd22bff3f57a81252 Mon Sep 17 00:00:00 2001 +From 1ce60b941d17ee06fec8c363f8e58a6db0616af0 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 73028be3b4d4d52f5d73becfd22bff3f57a81252 ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -22 +24 @@ -index 7c55a26956..bedcf958e2 100644 +index 008e50e0b9..4ec9598b8e 100644 @@ -25 +27 @@ -@@ -1009,19 +1009,21 @@ ionic_dev_close(struct rte_eth_dev *eth_dev) +@@ -970,19 +970,21 @@ ionic_dev_close(struct rte_eth_dev *eth_dev) @@ -51 +53 @@ -@@ -1098,21 +1100,18 @@ err: +@@ -1059,21 +1061,18 @@ err: @@ -79 +81 @@ -@@ -1267,17 +1266,18 @@ eth_ionic_dev_remove(struct rte_device *rte_dev) +@@ -1228,17 +1227,18 @@ eth_ionic_dev_remove(struct rte_device *rte_dev)