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 3FC0541E1C; Thu, 9 Mar 2023 17:05:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 206A240ED7; Thu, 9 Mar 2023 17:05:37 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id C403040695 for ; Thu, 9 Mar 2023 17:05:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678377936; x=1709913936; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4r8hdIYW0gpmmqkTZDooVBCpEj3qoJbedBv857/cb58=; b=hB56GTbeWjQHVtRkbgBAIL52MgSZ/Pj/74cgnt22RCRrf4GeLwqzw6SJ nN8PYMsanQZYBfYkUadOfuX3ne8Jzt6okxpm99rgulsIkO4UkHTgRo1JE H4sLRTFIrNA677cCUFPf1BZ2Y7foDvwqC6CGJtlAAeYHNcrjy29TvjX33 hNjQC6W4FvM1fO627XWzUjP3XAd5kZNrAWz+5q9vTNe0WzM5FzAEYbTMD S8M0GdESZesIqSoKL47EoCv27w28rJHkNQaap+sgv4m+q0ejlaPzbGBJE akD4RP0YL1N6VcUe2zHX61OUufPngro8ygnAOExPL/M8Ep9fSHsyuWhcV A==; X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="422752333" X-IronPort-AV: E=Sophos;i="5.98,246,1673942400"; d="scan'208";a="422752333" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 08:03:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="670784555" X-IronPort-AV: E=Sophos;i="5.98,246,1673942400"; d="scan'208";a="670784555" Received: from ena4.iind.intel.com ([10.190.200.224]) by orsmga007.jf.intel.com with ESMTP; 09 Mar 2023 08:03:48 -0800 From: Yogesh Jangra To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, kamalakannan.r@intel.com, harshad.suresh.narayane@intel.com, yogesh.jangra@intel.com Subject: [PATCH v2] app/testpmd: fix closing softnic port before ethdev ports Date: Thu, 9 Mar 2023 16:02:12 +0000 Message-Id: <20230309160212.1200403-1-yogesh.jangra@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309144249.1199517-1-yogesh.jangra@intel.com> References: <20230309144249.1199517-1-yogesh.jangra@intel.com> 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 SoftNIC runs on the service core, it uses the resources from the testpmd application. When we run quit command, the testpmd application stops ethdev ports first, SoftNIC will try to access the port and sometimes that results in segmentation error. This fix will first close the SoftNIC port. Signed-off-by: Yogesh Jangra Signed-off-by: Kamalakannan R Acked-by: Cristian Dumitrescu --- app/test-pmd/testpmd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 0032696608..88464ea582 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3767,6 +3767,21 @@ pmd_test_exit(void) #endif if (ports != NULL) { no_link_check = 1; + + /* + * SoftNIC runs on the service core, it uses the resources from + * the testpmd application. When we run quit command, the testpmd + * application stops ethdev ports first, SoftNIC will try to + * access the port and sometimes that results in segmentation + * error. So first closing the SoftNIC port. + */ + RTE_ETH_FOREACH_DEV(pt_id) { + if (!strcmp(ports[pt_id].dev_info.driver_name, "net_softnic")) { + stop_port(pt_id); + close_port(pt_id); + } + } + RTE_ETH_FOREACH_DEV(pt_id) { printf("\nStopping port %d...\n", pt_id); fflush(stdout); -- 2.25.1