From patchwork Thu Sep 28 09:47:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiawen Wu X-Patchwork-Id: 132109 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 12DFF4265E; Thu, 28 Sep 2023 11:38:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E990F41141; Thu, 28 Sep 2023 11:37:41 +0200 (CEST) Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by mails.dpdk.org (Postfix) with ESMTP id 98AFA40C35; Thu, 28 Sep 2023 11:37:37 +0200 (CEST) X-QQ-mid: bizesmtp74t1695893849tljcwbc4 Received: from wxdbg.localdomain.com ( [115.200.229.121]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 28 Sep 2023 17:37:28 +0800 (CST) X-QQ-SSF: 01400000000000K0Z000000A0000000 X-QQ-FEAT: SRelCwPFry0Q+rreRU8yyJ+25C7ZRiODhcqHTwB/QYbjTeDpPP5M4wZdaJ8pQ bLzo/rdXl7Iy3SXznDE37n3SsK39fFigEY7mdfKSQGK/SGGkWj37KEnZsVLFIxEOu5ziz9d T9J90H3guDAb8SixCL9chhOi6Wy7XCMEdjb6bCVP45Wx8R24VJbuaO8K9U8Cua3mi1FUIIi UD4xl28h7IHImI9iIyW8cDvYDY6Hh9TEfV2SHEYiOVbDfShx6PEilxl07Zq2jSeskw3h7Zp 4Z4rL5jv9m+WKCPlswy/yTuMUdaIEw/cTgyAFrZaia2ZCxRB0yAgUyAqpBV6wipdG148SKu 5WzCzJJIlxeQRLS5y6hOAmTgwcEbNHuCXwBZ07RQ+0JxMeXaE1cuFkSVAs4Gbim5PaUVwUi dQyHk/WG/oU= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 3053443312212759993 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH 10/11] net/ngbe: check process type in close operation Date: Thu, 28 Sep 2023 17:47:57 +0800 Message-Id: <20230928094758.1076236-11-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: cc63194e89cb ("net/ngbe: support close and reset device") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- drivers/net/ngbe/ngbe_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c index 9a594a1db7..23daf306de 100644 --- a/drivers/net/ngbe/ngbe_ethdev.c +++ b/drivers/net/ngbe/ngbe_ethdev.c @@ -1262,6 +1262,9 @@ ngbe_dev_close(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; + ngbe_pf_reset_hw(hw); ngbe_dev_stop(dev);