summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2018-10-24 15:12:32 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-26 22:14:06 +0200
commit336f20bc5ee26efa6495f697b743f1bba8778afc (patch)
tree7b519a92df24c05e91b230c0c5becd857575a8a7 /lib
parent140af04e63d77e8f57f5db1ffadfada38b677e53 (diff)
downloaddpdk-336f20bc5ee26efa6495f697b743f1bba8778afc.zip
dpdk-336f20bc5ee26efa6495f697b743f1bba8778afc.tar.gz
dpdk-336f20bc5ee26efa6495f697b743f1bba8778afc.tar.xz
ethdev: filter destroy event before probed
If a port is being created and rollbacked because of an error, the event RTE_ETH_EVENT_DESTROY should not be sent. It makes no sense to receive a destroy event for a port which was not yet announced via RTE_ETH_EVENT_NEW. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_ethdev/rte_ethdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 767fd8d..53d1a43 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -513,7 +513,9 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)
rte_eth_dev_shared_data_prepare();
- _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL);
+ if (eth_dev->state != RTE_ETH_DEV_UNUSED)
+ _rte_eth_dev_callback_process(eth_dev,
+ RTE_ETH_EVENT_DESTROY, NULL);
rte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock);