> -----Original Message----- > From: Jangra, Yogesh <yogesh.jan...@intel.com> > Sent: Thursday, March 9, 2023 2:43 PM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian <cristian.dumitre...@intel.com>; Jangra, Yogesh > <yogesh.jan...@intel.com>; R, Kamalakannan <kamalakanna...@intel.com>; > Suresh Narayane, Harshad <harshad.suresh.naray...@intel.com> > 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 <yogesh.jan...@intel.com> > Signed-off-by: Kamalakannan R <kamalakanna...@intel.com> > Acked-by: Cristian Dumitrescu <cristian.dumitre...@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
Adding Aman and Yuying, the test-pmd maintainers. Aman and Yuying, can you please review this patch when you get a chance, thank you!