Skip to contentSkip to conversation

ethdev: filter destroy event before probed

PATCH Applied Thomas Monjalon 2 participants 3 messages Oct 24, 2018 – Oct 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 lib/librte_ethdev/rte_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/librte_ethdev/rte_ethdev.c +3 -1
index 1c04f95ea..9c7d82575 100644
@@ -512,7 +512,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);
 
Signature · 1 line
2.19.0
Applied
#2 lore raw
Quoted 9 lines · Ferruh Yigit
Quoted 6 lines · Thomas Monjalon

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.

Applied to dpdk-next-net/master, thanks.