[dpdk-stable] [dpdk-dev] [PATCH] examples/l2fwd/main.c: free resources in case of error

Jerin Jacob jerinjacobk at gmail.com
Tue May 12 07:44:42 CEST 2020


On Tue, May 12, 2020 at 10:20 AM Varghese, Vipin
<vipin.varghese at intel.com> wrote:
>
> snipped
> > Subject: [PATCH] examples/l2fwd/main.c: free resources in case of error
> >
> > Bugzilla ID: 437
> > Cc: dev at dpdk.org
> > Cc: stable at dpdk.org
> > Cc: bruce.richardson at intel.com
> > Cc: vipin.varghese at intel.com
> > Cc: jgrajcia at cisco.com
> > Signed-off-by: Muhammad Bilal <m.bilal at 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())


>


More information about the stable mailing list