numam-dpdk/drivers/net
Thomas Monjalon fbd1913561 ethdev: remove old close behaviour
The temporary flag RTE_ETH_DEV_CLOSE_REMOVE is removed.
It was introduced in DPDK 18.11 in order to give time for PMDs to migrate.

The old behaviour was to free only queues when closing a port.
The new behaviour is calling rte_eth_dev_release_port() which does
three more tasks:
	- trigger event callback
	- reset state and few pointers
	- free all generic port resources

The private port resources must be released in the .dev_close callback.

The .remove callback should:
	- call .dev_close callback
	- call rte_eth_dev_release_port()
	- free multi-port device shared resources

Despite waiting two years, some drivers have not migrated,
so they may hit issues with the incompatible new behaviour.
After sending emails, adding logs, and announcing the deprecation,
the only last solution is to declare these drivers as unmaintained:
	ionic, liquidio, nfp
Below is a summary of what to implement in those drivers.

* The freeing of private port resources must be moved
from the ".remove(device)" function to the ".dev_close(port)" function.

* If a generic resource (.mac_addrs or .hash_mac_addrs) cannot be freed,
it must be set to NULL in ".dev_close" function to protect from
subsequent rte_eth_dev_release_port() freeing.

* Note 1:
The generic resources are freed in rte_eth_dev_release_port(),
after ".dev_close" is called in rte_eth_dev_close(), but not when
calling ".dev_close" directly from the ".remove" PMD function.
That's why rte_eth_dev_release_port() must still be called explicitly
from ".remove(device)" after calling the ".dev_close" PMD function.

* Note 2:
If a device can have multiple ports, the common resources must be freed
only in the ".remove(device)" function.

* Note 3:
The port is supposed to be in a stopped state when it is closed.
If it is not the case, it is free to the PMD implementation
how to react when trying to close a non-stopped port:
either try to stop it automatically or just return an error.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2020-09-30 19:19:14 +02:00
..
af_packet ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
af_xdp ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
ark ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
atlantic ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
avp ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
axgbe ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
bnx2x ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
bnxt ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
bonding ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
cxgbe ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
dpaa ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
dpaa2 ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
e1000 ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
ena ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
enetc ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
enic ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
failsafe ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
fm10k ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
hinic ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
hns3 ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
i40e ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
iavf ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
ice ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
igc ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
ionic ethdev: allow drivers to return error on close 2020-09-30 19:19:13 +02:00
ipn3ke ethdev: allow drivers to return error on close 2020-09-30 19:19:13 +02:00
ixgbe ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
kni ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
liquidio ethdev: allow drivers to return error on close 2020-09-30 19:19:13 +02:00
memif ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
mlx4 ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
mlx5 ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
mvneta ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
mvpp2 ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
netvsc ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
nfb ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
nfp ethdev: allow drivers to return error on close 2020-09-30 19:19:13 +02:00
null ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
octeontx ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
octeontx2 ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
pcap ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
pfe ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
qede ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
ring ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
sfc ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
softnic ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
szedata2 ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
tap ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
thunderx ethdev: allow drivers to return error on close 2020-09-30 19:19:13 +02:00
vdev_netvsc build: remove makefiles 2020-09-08 00:09:50 +02:00
vhost ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
virtio ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
vmxnet3 ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
meson.build bus/pci: introduce Windows support with stubs 2020-06-30 00:02:54 +02:00