[dpdk-dev] [PATCH v3 2/4] ethdev: free all common data when releasing port
Thomas Monjalon
thomas at monjalon.net
Wed Oct 17 10:22:34 CEST 2018
17/10/2018 09:13, Andrew Rybchenko:
> On 10/17/18 4:54 AM, Thomas Monjalon wrote:
> > This is a clean-up of common ethdev data freeing.
> > All data freeing are moved to rte_eth_dev_release_port()
> > and done only in case of primary process.
> >
> > It is probably fixing some memory leaks for PMDs which were
> > not freeing all data.
> >
> > Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
>
> [...]
>
> > diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h
> > index ca31b5777..a1398a80c 100644
> > --- a/lib/librte_ethdev/rte_ethdev_driver.h
> > +++ b/lib/librte_ethdev/rte_ethdev_driver.h
> > @@ -58,7 +58,16 @@ struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
> >
> > /**
> > * @internal
> > - * Release the specified ethdev port.
> > + * Notify RTE_ETH_EVENT_DESTROY and release the specified ethdev port.
> > + *
> > + * The following data fields will be freed:
> > + * - rx_queues
> > + * - tx_queues
>
> I think rx_queues and tx_queues from should not be mentioned here.
> They are managed by ethdev and there is no options here.
>
> > + * - mac_addrs
> > + * - hash_mac_addrs
> > + * - dev_private
> > + * If one of these fields should not be freed,
> > + * it must be reset to NULL by the caller.
>
> I'm afraid nobody will find it here. Let's add
> @see rte_eth_dev_release_port()
> to these members description in rte_ethdev_core.h
> struct rte_eth_dev_data.
>
> Also I think "by the caller" is misleading here.
> Let's highlight that it is PMD responsibility, i.e.
> "by the PMD" may be with
> "typically in dev_close method implementation".
OK, thanks for the feedback.
More information about the dev
mailing list