Skip to contentSkip to conversation

drivers/net/bonding: fix updating the slave link status

PATCH New wang wei 1 participant 1 message Apr 25, 2017

Subsystems (2)
lore
Share & tools
lore

wang wei

author
#0 lore raw

PATCH 1/1 drivers/net/bonding: fix updating the slave link status

we need to update dev->data->dev_link before handling lsc event. Otherwise it will still have the initial value after the startup of the program before interrupt callback was executed.

---
 drivers/net/bonding/rte_eth_bond_pmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +3 -1
index c94071ffb..57b1012c4 100644
@@ -1435,9 +1435,11 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 	}
 
 	/* If lsc interrupt is set, check initial slave's link status */
-	if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
+	if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
+        slave_eth_dev->dev_ops->link_update(slave_eth_dev, 0);
 		bond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id,
 			RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id);
+    }
 
 	return 0;
 }
Signature · 1 line
2.11.0 (Apple Git-81)