From patchwork Thu Sep 28 09:47:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiawen Wu X-Patchwork-Id: 132108 X-Patchwork-Delegate: ferruh.yigit@amd.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 5DB5A4265E; Thu, 28 Sep 2023 11:38:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68F1A40EE7; Thu, 28 Sep 2023 11:37:40 +0200 (CEST) Received: from smtpbg153.qq.com (smtpbg153.qq.com [13.245.218.24]) by mails.dpdk.org (Postfix) with ESMTP id 89C0040F35; Thu, 28 Sep 2023 11:37:35 +0200 (CEST) X-QQ-mid: bizesmtp74t1695893846t80g2j6d Received: from wxdbg.localdomain.com ( [115.200.229.121]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 28 Sep 2023 17:37:25 +0800 (CST) X-QQ-SSF: 01400000000000K0Z000000A0000000 X-QQ-FEAT: WjKIxUDuZHQRVPH9LD+q/NCEC113hkYDBHHoG3YTycrUpG1UU6xy0gsnfqNK1 Zs/2W+1caXFojNIvDr/i8PosNfPbNQ2E6sah7NVdd9m2I0ZGoe5n9nN0pw1vnkmDO42aw7J MIRziEvGhBNqM7KF8lchiMtGuAa3Dkv4YKhXxR9wcOMvVae3uqAvXUDPr70T2u+ePOKdx1v IOuV9SEIz4uIz+Hb/v4AgCTEzsbbfhg12oBBhDKWdQ7COXMw7gnsLlTOnGYrhaw7DQYUZLu UwzvWv4Ru5oftFyDLobny9I+aqiP+14g8PlJHrjMyYXEPCgY/0m7/4TaoBCO0h8HPJmZwmf aErgy8s5mhB29iGbRTZVJr0g6j+9PgKvTqZZk6D9lJ8+inem0ZhkZYltgsq4kpdWOsDqJRu ryOJoc5m0Ds= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 5825822319979746048 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH 09/11] net/txgbe: check process type in close operation Date: Thu, 28 Sep 2023 17:47:56 +0800 Message-Id: <20230928094758.1076236-10-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230928094758.1076236-1-jiawenwu@trustnetic.com> References: <20230928094758.1076236-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz5a-1 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 The secondary processes are not allowed to release shared resources. Only process-private resources should be freed in a secondary process. Most of the time, there is no process-private resource, so the close operation is just forbidden in a secondary process. Fixes: e1698e383c2a ("net/txgbe: add device init and uninit") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- drivers/net/txgbe/txgbe_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index 2dad820cb5..6bc231a130 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -2052,6 +2052,9 @@ txgbe_dev_close(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; + txgbe_pf_reset_hw(hw); ret = txgbe_dev_stop(dev);