[dpdk-dev] [RFC] ethdev: complete closing to free all resources

Thomas Monjalon thomas at monjalon.net
Mon Sep 10 10:42:43 CEST 2018


10/09/2018 10:03, Andrew Rybchenko:
> On 09/08/2018 02:39 AM, Thomas Monjalon wrote:
> > After closing a port, it cannot be restarted.
> > So there is no reason to not free all associated resources.
> >
> > The last step was done with rte_eth_dev_detach() which is deprecated.
> > Instead of removing the associated rte_device, the driver should check
> > if no more port (ethdev, cryptodev, etc) is still open for the device.
> > Then the device resources can be freed by the driver inside the
> > dev_close() driver callback operation.
> >
> > The last ethdev freeing (dev_private and final release), which were done
> > by rte_eth_dev_detach(), are now done at the end of rte_eth_dev_close().
> 
> For me, it sounds more logical to kill dev_close and keep detach.
> IMHO, dev_close is artificial and hardly useful. detach is a local pair 
> to attach.

I don't get your point.

In order to free a port, we need close + detach.
We can keep only one.
I choose close because:
	1) attach/detach are deprecated
	2) probe/close is a more obvious pair
	3) we need the driver to free the lower level resources

> Anyway it requires update of all drivers as I understand.

Yes if we want to free all resources.
But close operation in drivers can be completed in later steps.





More information about the dev mailing list