net/af_xdp: fix remove path
authorWilliam Tu <u9012063@gmail.com>
Fri, 31 May 2019 16:52:42 +0000 (09:52 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Jun 2019 14:54:29 +0000 (23:54 +0900)
commitbf2644cd38734c42431a8d6cef3ab99b5e464065
tree631e20ece20f9d8c6c8e7a2503561105520ce925
parentd812a3c21edaa48c6d5d43aa6d1ce95bd972f3fe
net/af_xdp: fix remove path

When users call rte_eth_dev_close() and rte_dev_remove(), the af_xdp
pmd return -1 (EPERM) due to eth_dev == NULL.

Since the af_xdp pmd driver advertises RTE_ETH_DEV_CLOSE_REMOVE, all
the resources are freed on rte_eth_dev_close().  rte_dev_remove() tries
to detach device and subsequently calls rte_pmd_af_xdp_remove() that
tries to free already freed resources and fails.
Fix it by return success.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
Cc: stable@dpdk.org
Reported-at: https://patchwork.ozlabs.org/patch/1106528/
Suggested-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: William Tu <u9012063@gmail.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/af_xdp/rte_eth_af_xdp.c