From: Tim Shearer Date: Tue, 27 Oct 2015 21:38:55 +0000 (-0400) Subject: ethdev: fix link status race condition X-Git-Tag: spdx-start~8111 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d5790b03b3c440dbcf1a9951024af8b25916abb0;p=dpdk.git ethdev: fix link status race condition Calling the Ethernet driver's link_update function from rte_eth_dev_start can result in a race condition if the NIC raises the link interrupt at the same time. Depending on the interrupt handler implementation, the race can cause the it to think that it received two consecutive link up interrupts, and it exits without calling the user callback. Appears to impact E1000/IGB and virtio drivers only. Signed-off-by: Tim Shearer --- diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 83704bb077..e0e1dca34e 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1137,7 +1137,7 @@ rte_eth_dev_start(uint8_t port_id) rte_eth_dev_config_restore(port_id); - if (dev->data->dev_conf.intr_conf.lsc != 0) { + if (dev->data->dev_conf.intr_conf.lsc == 0) { FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update, -ENOTSUP); (*dev->dev_ops->link_update)(dev, 0); }