[PATCH] examples/multi_process: fix cleanup on exit
Thomas Monjalon
thomas at monjalon.net
Thu Jul 17 21:50:06 CEST 2025
09/07/2025 17:01, Stephen Hemminger:
> On Tue, 8 Jul 2025 10:09:54 +0300
> Maayan Kashani <mkashani at nvidia.com> wrote:
>
> > +static void
> > +exit_cleanup(void)
> > +{
> > + unsigned int i;
> > +
> > + RTE_LOG(INFO, APP, "Close ports.\n");
> > + for (i = 0; i < num_ports; i++) {
> > + if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> > + if (rte_eth_dev_stop(ports[i]))
> > + rte_exit(EXIT_FAILURE, "Error stopping ports\n");
> > + if (rte_eth_dev_close(ports[i]))
> > + rte_exit(EXIT_FAILURE, "Error closing ports\n");
> > + }
> > + }
>
> Could the ethdev cleanup be integrated into eal_cleanup() so applications
> don't have to care?
It would be a layer violation.
We could have a list of callbacks maybe.
More information about the dev
mailing list