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 2855E42CAD; Wed, 14 Jun 2023 07:14:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C39FC40DDB; Wed, 14 Jun 2023 07:14:33 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 07BB040A7D; Wed, 14 Jun 2023 07:14:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686719672; x=1718255672; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=BePV7NMt8U+4CD+o2rE0xlOcoBavcGwGJpIOWlP2OSc=; b=WifZmqIBtkRJUT+w9mGGK+4MKIgNQXDOz/JvlATnwbEEpFuMF2BGHi+A oSGsHtu84geVX4ynjmB6XZzsBBijJ3lmysTljbwOx11FtBXsXbs18fLUH B5rciaxMWiLUcFt3NR0/j0DY0cVwFbytGjyqJZPPyt1XklDY43nFiP0U9 3u2VWxt46tI8Dkr21irGgmY3Zuu3/nlEq7zh0tRp2JHNlikC4XECCmMKX +Al+lA2IBLwCMPqe8y4pMNH0yPy0UXwkDHhd06fLv3AlvTNGBbe5IDa7U JlsN9fAx27cVjkATO/Yw7ea5axNKbGe6Y63mEQLEu//kVZ7tn5gcOMVJN w==; X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="361895301" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="361895301" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 22:14:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="1042052155" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="1042052155" Received: from dpdk-jf-ntb-one.sh.intel.com ([10.67.111.149]) by fmsmga005.fm.intel.com with ESMTP; 13 Jun 2023 22:14:28 -0700 From: Junfeng Guo To: jingjing.wu@intel.com Cc: dev@dpdk.org, stable@dpdk.org, xingguang.he@intel.com, kevin.laatz@intel.com, Junfeng Guo Subject: [PATCH] examples/ntb: remove redundant logic for dev close Date: Wed, 14 Jun 2023 13:14:23 +0800 Message-Id: <20230614051423.176572-1-junfeng.guo@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 During EAL cleanup stage, all bus devices are cleaned up properly. Based on this, there is no need to do extra device close process, which may call the dev ops '*dev->dev_ops->dev_close' twice. If this dev ops for ntb was called twice, the interrupt handle for EAL will be disabled twice and will lead to error for the seconde time. Like this: "EAL: Error disabling MSI-X interrupts for fd xx" Thus, this patch just remove the redundant logic for device close. Ports will be closed at rte_eal_cleanup() in the main loop. Fixes: 1cab1a40ea9b ("bus: cleanup devices on shutdown") Cc: stable@dpdk.org Signed-off-by: Junfeng Guo --- examples/ntb/ntb_fwd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c index 585aad9d70..3385b4b73c 100644 --- a/examples/ntb/ntb_fwd.c +++ b/examples/ntb/ntb_fwd.c @@ -177,13 +177,11 @@ cmd_quit_parsed(__rte_unused void *parsed_result, rte_eal_mp_wait_lcore(); in_test = 0; - /* Stop traffic and Close port. */ + /* Stop traffic only. */ rte_rawdev_stop(dev_id); - rte_rawdev_close(dev_id); - if (eth_port_id < RTE_MAX_ETHPORTS && fwd_mode == IOFWD) { + if (eth_port_id < RTE_MAX_ETHPORTS && fwd_mode == IOFWD) rte_eth_dev_stop(eth_port_id); - rte_eth_dev_close(eth_port_id); - } + /* Ports will be closed at rte_eal_cleanup() in the main loop. */ cmdline_quit(cl); } -- 2.34.1