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 2C39541E13; Thu, 9 Mar 2023 16:10:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1789A410EE; Thu, 9 Mar 2023 16:10:28 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 9375640ED7 for ; Thu, 9 Mar 2023 16:10:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678374626; x=1709910626; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=BZg8ZY9xEjODN06yV21AJ25H6lC2fMLULbB/Rz5OSq4=; b=b+rrKl9MNGDnh4Q8zk9tOt1A+2ubwv5LWpZP50WhV5PF000pFONuTv/3 ZrnBMy4JhT81Y1lwnxpKLPkavKDuDx9pHsEl+kNEFfXxSvqjLiu3XZweG hZAPXa5BCGNjlksTH0Rjdu3iVodDEvhPf27Z6NS5HCaji0Hzij9aHR6fo RDdQ/Mw6+CvGDFf3S0VNLNws2xBiApZggQJrVyOYhHrPU2cj9uNqtHZ1j xCNCKf8BuGOQS5IDUW3SrY5qw7blJuB6oG07X6bx3wB9qMdMAD5nHweOj ng9477AYmamxMiT12nmdq6V6lfA6qw/a5lgO2Bvy/yVlCvAHyNE6hQWpy g==; X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="338818793" X-IronPort-AV: E=Sophos;i="5.98,246,1673942400"; d="scan'208";a="338818793" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 06:44:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="923262920" X-IronPort-AV: E=Sophos;i="5.98,246,1673942400"; d="scan'208";a="923262920" Received: from ena4.iind.intel.com ([10.190.200.224]) by fmsmga006.fm.intel.com with ESMTP; 09 Mar 2023 06:44:24 -0800 From: Yogesh Jangra To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, yogesh.jangra@intel.com, kamalakannan.r@intel.com, harshad.suresh.narayane@intel.com Subject: [PATCH] app/testpmd: fix closing softnic port before ethdev ports Date: Thu, 9 Mar 2023 14:42:49 +0000 Message-Id: <20230309144249.1199517-1-yogesh.jangra@intel.com> X-Mailer: git-send-email 2.25.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 SoftNIC runs on the sevice 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 result 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..aa831b2389 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 sevice 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 result 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