> -----Original Message----- > From: Jangra, Yogesh <[email protected]> > Sent: Thursday, March 9, 2023 2:43 PM > To: [email protected] > Cc: Dumitrescu, Cristian <[email protected]>; Jangra, Yogesh > <[email protected]>; R, Kamalakannan <[email protected]>; > Suresh Narayane, Harshad <[email protected]> > Subject: [PATCH] app/testpmd: fix closing softnic port before ethdev ports > > 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 <[email protected]> > Signed-off-by: Kamalakannan R <[email protected]> > Acked-by: Cristian Dumitrescu <[email protected]> > --- > 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
Adding Aman and Yuying, the test-pmd maintainers. Aman and Yuying, can you please review this patch when you get a chance, thank you!

