DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bonding: don't early mark eth device as bonded
@ 2018-01-17 16:44 Chas Williams
  2018-01-25 12:28 ` Nicolau, Radu
  0 siblings, 1 reply; 3+ messages in thread
From: Chas Williams @ 2018-01-17 16:44 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, Charles (Chas) Williams, Chas Williams

From: "Charles (Chas) Williams" <ciwillia@mail.eng.vyatta.net>

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.

Signed-off-by: Chas Williams <chas3@att.com>
---
 drivers/net/bonding/rte_eth_bond_api.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 534a890..e9c446b 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -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,
-- 
2.9.5

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bonding: don't early mark eth device as bonded
  2018-01-17 16:44 [dpdk-dev] [PATCH] net/bonding: don't early mark eth device as bonded Chas Williams
@ 2018-01-25 12:28 ` Nicolau, Radu
  2018-01-25 13:23   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolau, Radu @ 2018-01-25 12:28 UTC (permalink / raw)
  To: Chas Williams, dev
  Cc: Doherty, Declan, Charles (Chas) Williams, Chas Williams


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Chas Williams
> Sent: Wednesday, January 17, 2018 4:45 PM
> To: dev@dpdk.org
> Cc: Doherty, Declan <declan.doherty@intel.com>; Charles (Chas) Williams
> <ciwillia@mail.eng.vyatta.net>; Chas Williams <chas3@att.com>
> Subject: [dpdk-dev] [PATCH] net/bonding: don't early mark eth device as
> bonded
> 
> From: "Charles (Chas) Williams" <ciwillia@mail.eng.vyatta.net>
> 
> 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.
> 
> Signed-off-by: Chas Williams <chas3@att.com>
> ---

Acked-by: Radu Nicolau <radu.nicolau@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bonding: don't early mark eth device as bonded
  2018-01-25 12:28 ` Nicolau, Radu
@ 2018-01-25 13:23   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-01-25 13:23 UTC (permalink / raw)
  To: Nicolau, Radu, Chas Williams, dev
  Cc: Doherty, Declan, Charles (Chas) Williams, Chas Williams

On 1/25/2018 12:28 PM, Nicolau, Radu wrote:
> 
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Chas Williams
>> Sent: Wednesday, January 17, 2018 4:45 PM
>> To: dev@dpdk.org
>> Cc: Doherty, Declan <declan.doherty@intel.com>; Charles (Chas) Williams
>> <ciwillia@mail.eng.vyatta.net>; Chas Williams <chas3@att.com>
>> Subject: [dpdk-dev] [PATCH] net/bonding: don't early mark eth device as
>> bonded
>>
>> From: "Charles (Chas) Williams" <ciwillia@mail.eng.vyatta.net>
>>
>> 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.
>>
>> Signed-off-by: Chas Williams <chas3@att.com>
>> ---
> 
> Acked-by: Radu Nicolau <radu.nicolau@intel.com>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-25 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17 16:44 [dpdk-dev] [PATCH] net/bonding: don't early mark eth device as bonded Chas Williams
2018-01-25 12:28 ` Nicolau, Radu
2018-01-25 13:23   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).