numam-dpdk/lib
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
..
librte_acl build: remove deprecated cpuflag macros 2020-09-25 11:13:57 +02:00
librte_bbdev bbdev: use C11 atomics for device processing counter 2020-09-25 15:37:55 +02:00
librte_bitratestats build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_bpf bpf: promote library as stable 2020-09-16 18:52:55 +02:00
librte_cfgfile build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_cmdline build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_compressdev build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_cryptodev build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_distributor build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_eal eal: use C11 atomics for initialization check 2020-09-25 15:36:17 +02:00
librte_efd build: remove deprecated cpuflag macros 2020-09-25 11:13:57 +02:00
librte_ethdev ethdev: remove old close behaviour 2020-09-30 19:19:14 +02:00
librte_eventdev build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_fib build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_flow_classify build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_graph build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_gro build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_gso gso: fix payload unit size for UDP 2020-09-18 18:55:12 +02:00
librte_hash build: remove deprecated cpuflag macros 2020-09-25 11:13:57 +02:00
librte_ip_frag build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_ipsec build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_jobstats build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_kni mem: remove physical address aliases 2020-09-19 00:25:35 +02:00
librte_kvargs build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_latencystats build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_lpm build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_mbuf mbuf: remove physical address alias 2020-09-19 00:25:37 +02:00
librte_member build: remove deprecated cpuflag macros 2020-09-25 11:13:57 +02:00
librte_mempool mempool: remove physical address aliases 2020-09-19 00:25:37 +02:00
librte_meter build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_metrics build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_net build: remove deprecated cpuflag macros 2020-09-25 11:13:57 +02:00
librte_node build: remove deprecated cpuflag macros 2020-09-25 11:13:57 +02:00
librte_pci net/qede: define PCI config space specific osals 2020-09-30 19:19:11 +02:00
librte_pdump build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_pipeline pipeline: add SWX pipeline specification file 2020-10-01 18:43:08 +02:00
librte_port port: add source and sink SWX ports 2020-10-01 18:43:10 +02:00
librte_power power: use C11 atomics for power state 2020-09-25 15:42:29 +02:00
librte_rawdev rawdev: mark start and stop functions optional 2020-09-11 11:51:16 +02:00
librte_rcu build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_regexdev build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_reorder build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_rib build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_ring config: remove default configs used with make 2020-09-08 00:11:30 +02:00
librte_sched build: remove deprecated cpuflag macros 2020-09-25 11:13:57 +02:00
librte_security build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_stack stack: fix uninitialized variable 2020-09-30 21:08:39 +02:00
librte_table table: add exact match SWX table 2020-10-01 18:43:10 +02:00
librte_telemetry telemetry: build stubs on Windows 2020-09-11 01:55:35 +02:00
librte_timer build: remove makefiles 2020-09-08 00:09:50 +02:00
librte_vhost vhost/crypto: fix possible TOCTOU attack 2020-09-28 13:19:13 +02:00
meson.build ethdev: build on Windows 2020-09-11 01:55:39 +02:00