On Tue, May 12, 2020 at 10:20 AM Varghese, Vipin <vipin.vargh...@intel.com> wrote: > > snipped > > Subject: [PATCH] examples/l2fwd/main.c: free resources in case of error > > > > Bugzilla ID: 437 > > Cc: dev@dpdk.org > > Cc: sta...@dpdk.org > > Cc: bruce.richard...@intel.com > > Cc: vipin.vargh...@intel.com > > Cc: jgraj...@cisco.com > > Signed-off-by: Muhammad Bilal <m.bi...@emumba.com> > > --- > > examples/l2fwd/main.c | 72 ++++++++++++++++++++++++++++++++++--------- > > 1 file changed, 57 insertions(+), 15 deletions(-) > > > > diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index > > 88ddfe589..dbaa457e2 100644 > > --- a/examples/l2fwd/main.c > > +++ b/examples/l2fwd/main.c > > @@ -517,6 +517,17 @@ signal_handler(int signum) > > } > > } > > > > +static void > > +stop_and_close_eth_dev(uint16_t portid) { > > + RTE_ETH_FOREACH_DEV(portid) { > > + printf("Closing port %d...", portid); > > + rte_eth_dev_stop(portid); > > + rte_eth_dev_close(portid); > > + printf(" Done\n"); > > + } > > +} > > + > If the solution is to cleanup in application, then all application needs to > do cleanup. Hence `+1` for updating this to all examples in DPDK.
When updating the examples, Add the rte_eal_cleanup() as well(it is the counterpart of rte_eal_init()) >