DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix closing softnic port before ethdev ports
@ 2023-03-09 14:42 Yogesh Jangra
  2023-03-09 16:02 ` [PATCH v2] " Yogesh Jangra
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Yogesh Jangra @ 2023-03-09 14:42 UTC (permalink / raw)
  To: dev
  Cc: cristian.dumitrescu, yogesh.jangra, kamalakannan.r,
	harshad.suresh.narayane

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 <yogesh.jangra@intel.com>
Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-03-17  7:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 14:42 [PATCH] app/testpmd: fix closing softnic port before ethdev ports Yogesh Jangra
2023-03-09 16:02 ` [PATCH v2] " Yogesh Jangra
2023-03-09 16:31 ` [PATCH] " Stephen Hemminger
2023-03-09 17:19   ` Dumitrescu, Cristian
2023-03-09 19:09     ` Dumitrescu, Cristian
2023-03-09 20:22     ` Stephen Hemminger
2023-03-10  9:09       ` Singh, Aman Deep
2023-03-10 13:45         ` Dumitrescu, Cristian
2023-03-10 12:00     ` Ferruh Yigit
2023-03-10 13:47       ` David Marchand
2023-03-10 13:47       ` Dumitrescu, Cristian
2023-03-10 13:49         ` David Marchand
2023-03-10 14:36           ` Dumitrescu, Cristian
2023-03-10 14:39             ` David Marchand
2023-03-10 14:58             ` Thomas Monjalon
2023-03-10 13:58         ` Ferruh Yigit
2023-03-10 16:44           ` Stephen Hemminger
2023-03-17  7:11             ` Jangra, Yogesh
2023-03-09 19:08 ` Dumitrescu, Cristian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).