net/af_xdp: remove resources when port is closed
authorXiaolong Ye <xiaolong.ye@intel.com>
Tue, 30 Apr 2019 08:39:46 +0000 (16:39 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 3 May 2019 16:45:23 +0000 (18:45 +0200)
commitf0ce7af0e182a59569927b094a2534104f320adb
treea3c456ff57148035e6e22b6bfde999836062cad4
parent0b083fe41cac6bed70018e13bb33b0a072ea8fca
net/af_xdp: remove resources when port is closed

Since 18.11, it is suggested that driver should release all its private
resources at the dev_close routine. So all resources previously released
in remove routine are now released at the dev_close routine, and the
dev_close routine will be called in driver remove routine in order to
support removing a device without closing its ports.

Above behavior changes are supported by setting RTE_ETH_DEV_CLOSE_REMOVE
flag during probe stage.

Also as af_xdp pmd doesn't allocate MAC addresses dynamically, it needs
to be set as NULL, so it won't be released by rte_eth_dev_release_port()
otherwise, there would be "EAL: Error: Invalid memory" error.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/af_xdp/rte_eth_af_xdp.c