Skip to contentSkip to conversation

net/bonding: don't early mark eth device as bonded

PATCH Applied Chas Williams 3 participants 3 messages Jan 17, 2018 – Jan 25, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bonding: don't early mark eth device as bonded

From: "Charles (Chas) Williams" <[email protected]>

bonding immediately marks the incoming eth device as bonded and doesn't clear this in later error paths. Delay marking the dev until we are certain that we are going to add this eth device to the bond group.

---
 drivers/net/bonding/rte_eth_bond_api.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +7 -7
index 534a890..e9c446b 100644
@@ -242,9 +242,6 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
 		return -1;
 	}
 
-	/* Add slave details to bonded device */
-	slave_eth_dev->data->dev_flags |= RTE_ETH_DEV_BONDED_SLAVE;
-
 	rte_eth_dev_info_get(slave_port_id, &dev_info);
 	if (dev_info.max_rx_pktlen < internals->max_rx_pktlen) {
 		RTE_BOND_LOG(ERR, "Slave (port %u) max_rx_pktlen too small",
@@ -316,18 +313,21 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
 
 	internals->slave_count++;
 
-	/* Update all slave devices MACs*/
-	mac_address_slaves_update(bonded_eth_dev);
-
 	if (bonded_eth_dev->data->dev_started) {
 		if (slave_configure(bonded_eth_dev, slave_eth_dev) != 0) {
-			slave_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDED_SLAVE);
+			internals->slave_count--;
 			RTE_BOND_LOG(ERR, "rte_bond_slaves_configure: port=%d",
 					slave_port_id);
 			return -1;
 		}
 	}
 
+	/* Add slave details to bonded device */
+	slave_eth_dev->data->dev_flags |= RTE_ETH_DEV_BONDED_SLAVE;
+
+	/* Update all slave devices MACs*/
+	mac_address_slaves_update(bonded_eth_dev);
+
 	/* Register link status change callback with bonded device pointer as
 	 * argument*/
 	rte_eth_dev_callback_register(slave_port_id, RTE_ETH_EVENT_INTR_LSC,
Signature · 1 line
2.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Chas Williams
Sent: Wednesday, January 17, 2018 4:45 PM
To: [email protected]
Cc: Doherty, Declan <[email protected]>; Charles (Chas) Williams <[email protected]>; Chas Williams <[email protected]>
Subject: [dpdk-dev] [PATCH] net/bonding: don't early mark eth device as bonded

Quoted 8 lines

From: "Charles (Chas) Williams" <[email protected]>

bonding immediately marks the incoming eth device as bonded and doesn't clear this in later error paths. Delay marking the dev until we are certain that we are going to add this eth device to the bond group.

---

Applied
#2 lore raw
Quoted 12 lines · Radu
Quoted 12 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Chas Williams
Sent: Wednesday, January 17, 2018 4:45 PM
To: [email protected]
Cc: Doherty, Declan <[email protected]>; Charles (Chas) Williams <[email protected]>; Chas Williams <[email protected]>
Subject: [dpdk-dev] [PATCH] net/bonding: don't early mark eth device as bonded

From: "Charles (Chas) Williams" <[email protected]>

Quoted 8 lines
Quoted 6 lines

bonding immediately marks the incoming eth device as bonded and doesn't clear this in later error paths. Delay marking the dev until we are certain that we are going to add this eth device to the bond group.

---

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