[dpdk-dev] [PATCH v3 4/4] ethdev: complete closing of port

Thomas Monjalon thomas at monjalon.net
Wed Oct 17 04:12:26 CEST 2018


17/10/2018 03:54, Thomas Monjalon:
> 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 blindly removing the associated rte_device, the driver should
> check if no more port (ethdev, cryptodev, etc) is open for the device.
> 
> The last ethdev freeing which were done by rte_eth_dev_detach(),
> are now done at the end of rte_eth_dev_close().
[...]
>  /**
>   * Close a stopped Ethernet device. The device cannot be restarted!
> - * The function frees all resources except for needed by the
> - * closed state. To free these resources, call rte_eth_dev_detach().
> + * The function frees all port resources.
[...]
> @@ -1384,12 +1386,7 @@ rte_eth_dev_close(uint16_t port_id)
> +	rte_eth_dev_release_port(dev);

After more thoughts, I think I should add a release note to explain that
a closed port has its data freed and its state to RTE_ETH_DEV_UNUSED.





More information about the dev mailing list