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 C322C43C60 for ; Thu, 7 Mar 2024 02:36:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B0FFC42F02; Thu, 7 Mar 2024 02:36:40 +0100 (CET) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id 57B6942EE3 for ; Thu, 7 Mar 2024 02:36:39 +0100 (CET) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-41307c29eaaso3370215e9.2 for ; Wed, 06 Mar 2024 17:36:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709775399; x=1710380199; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BEOVvlaFnSZKrfjSFF6aW0Jf+ijF12rzl+rdMCPKMRs=; b=Hjv9QCfrGcvxHtNW8q92QTQRjBKKKtvsDgWvkbVMa2Y7VWNv+IbIpeQmDF4TDMqESq ftHQDjKxTe9RyYYlUyc7bpmwSpMGP1z+j8fhnJGlUvs9KUJaXK9MXFWX8NXHiOxet3/I ZOigEQXd1l5SrL7ZLG3rXCk4rmK3Mz7GhROc08s8IQW4KYAndCgv5oYzITlc8WhnRpuO mRtVzsNUWar/kfe5H+ry+z1fsuwbG2AWR0Fmyyiu1bhT6uMbaB+nBe/vjsFSBdlLlZox VF1xRl3gk+CIuoM5MwwzcAKonWU3LUxMGTbkrNNNwLhT5RCuan3/K0ckKDetUsrV95rZ iIUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775399; x=1710380199; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BEOVvlaFnSZKrfjSFF6aW0Jf+ijF12rzl+rdMCPKMRs=; b=ZJWJ5GWJwOUVPQti0gJwaaJfckUmWbI+S+ffVceizwEi/v/XHtR6T2Q6w+tuthuapG 912IlDLPGseZSkkLXcp8MRYjHiKwGD0j195HMCnD/HzRGqj/mwkSqrAYRivz94tDT9Ib lUfLTjOcKbDVDZY053nbC/j3MA0sSV3EAOZTxdwsiHGD1r6Bi2NmsiE5fpMAXARo+Lc2 XRz2hhchf38xvkdNvieXei0vV4rOD8vMoyBqeDXs7qKdpSHTY6OgM2zRKruymlcfwS+z t1WS6c2Enow7dYzBK5AeZ0SV8dlv31r5HoVXeF+DyCupRseQ/kTLI/Y8RnuQHHGwn44Q RiPQ== X-Gm-Message-State: AOJu0YxlOWkO4RGSymCTr2dSkqihxmm4Irg3N2sXO2oCECFTszvP5TFM zvzcmT26Acbmuv76S1o070BpptZkFaPc/7LzT3Uj55p7NbANhA0D X-Google-Smtp-Source: AGHT+IGWM/yXtpirHErlZ7Pxew3Inye1V6edmXY5CUXiLS7K54/LiVLy19aR0KBXsWdJKv6ZcElaWA== X-Received: by 2002:a05:600c:a019:b0:412:e290:3dd1 with SMTP id jg25-20020a05600ca01900b00412e2903dd1mr7824052wmb.9.1709775399002; Wed, 06 Mar 2024 17:36:39 -0800 (PST) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id g25-20020adfa499000000b0033d6c928a95sm18994348wrb.63.2024.03.06.17.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:36:38 -0800 (PST) From: luca.boccassi@gmail.com To: Andrew Boyer Cc: dpdk stable Subject: patch 'net/ionic: fix device close' has been queued to stable release 22.11.5 Date: Thu, 7 Mar 2024 01:31:34 +0000 Message-Id: <20240307013159.1735343-77-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307013159.1735343-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.5 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/09/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/3bd12069ce2c4a9e7bbd9d3daebbd8fceb213286 Thanks. Luca Boccassi --- >From 3bd12069ce2c4a9e7bbd9d3daebbd8fceb213286 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 [ 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; + if (eth_dev->state != RTE_ETH_DEV_UNUSED) + ionic_dev_close(eth_dev); - ionic_lif_deinit(lif); - ionic_lif_free(lif); - - 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.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-07 01:05:41.341895742 +0000 +++ 0077-net-ionic-fix-device-close.patch 2024-03-07 01:05:34.930942818 +0000 @@ -1 +1 @@ -From 73028be3b4d4d52f5d73becfd22bff3f57a81252 Mon Sep 17 00:00:00 2001 +From 3bd12069ce2c4a9e7bbd9d3daebbd8fceb213286 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 73028be3b4d4d52f5d73becfd22bff3f57a81252 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 7c55a26956..bedcf958e2 100644 +index 008e50e0b9..4ec9598b8e 100644 @@ -25 +26 @@ -@@ -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 +52 @@ -@@ -1098,21 +1100,18 @@ err: +@@ -1059,21 +1061,18 @@ err: @@ -79 +80 @@ -@@ -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)