DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode
@ 2016-03-26  0:44 John Daley
  2016-03-30 16:15 ` Thomas Monjalon
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: John Daley @ 2016-03-26  0:44 UTC (permalink / raw)
  To: dev; +Cc: Nelson Escobar, John Daley

From: Nelson Escobar <neescoba@cisco.com>

Stopping then re-starting a bond interface containing slaves that
used polling for link detection caused the bond to think all slave
links were down and inactive.

Move the start of the polling for link from slave_add() to
bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
the last_link_status of the slaves.

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index fb26d35..f0960c6 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1454,18 +1454,11 @@ slave_add(struct bond_dev_private *internals,
 	slave_details->port_id = slave_eth_dev->data->port_id;
 	slave_details->last_link_status = 0;
 
-	/* If slave device doesn't support interrupts then we need to enabled
-	 * polling to monitor link status */
+	/* Mark slave devices that don't support interrupts so we can
+	 * compensate when we start the bond
+	 */
 	if (!(slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)) {
 		slave_details->link_status_poll_enabled = 1;
-
-		if (!internals->link_status_polling_enabled) {
-			internals->link_status_polling_enabled = 1;
-
-			rte_eal_alarm_set(internals->link_status_polling_interval_ms * 1000,
-					bond_ethdev_slave_link_status_change_monitor,
-					(void *)&rte_eth_devices[internals->port_id]);
-		}
 	}
 
 	slave_details->link_status_wait_to_complete = 0;
@@ -1550,6 +1543,18 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
 					eth_dev->data->port_id, internals->slaves[i].port_id);
 			return -1;
 		}
+		/* We will need to poll for link status if any slave doesn't
+		 * support interrupts
+		 */
+		if (internals->slaves[i].link_status_poll_enabled)
+			internals->link_status_polling_enabled = 1;
+	}
+	/* start polling if needed */
+	if (internals->link_status_polling_enabled) {
+		rte_eal_alarm_set(
+			internals->link_status_polling_interval_ms * 1000,
+			bond_ethdev_slave_link_status_change_monitor,
+			(void *)&rte_eth_devices[internals->port_id]);
 	}
 
 	if (internals->user_defined_primary_port)
@@ -1622,6 +1627,8 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
 
 	internals->active_slave_count = 0;
 	internals->link_status_polling_enabled = 0;
+	for (i = 0; i < internals->slave_count; i++)
+		internals->slaves[i].last_link_status = 0;
 
 	eth_dev->data->dev_link.link_status = 0;
 	eth_dev->data->dev_started = 0;
-- 
2.7.0

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

* Re: [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode
  2016-03-26  0:44 [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode John Daley
@ 2016-03-30 16:15 ` Thomas Monjalon
  2016-03-31 13:40 ` Thomas Monjalon
  2016-04-01 13:35 ` Declan Doherty
  2 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2016-03-30 16:15 UTC (permalink / raw)
  To: dev; +Cc: John Daley, Nelson Escobar, declan.doherty

Anyone to review, please?

2016-03-25 17:44, John Daley:
> From: Nelson Escobar <neescoba@cisco.com>
> 
> Stopping then re-starting a bond interface containing slaves that
> used polling for link detection caused the bond to think all slave
> links were down and inactive.
> 
> Move the start of the polling for link from slave_add() to
> bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
> the last_link_status of the slaves.
> 
> Signed-off-by: Nelson Escobar <neescoba@cisco.com>
> Signed-off-by: John Daley <johndale@cisco.com>
> ---
>  drivers/net/bonding/rte_eth_bond_pmd.c | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)

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

* Re: [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode
  2016-03-26  0:44 [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode John Daley
  2016-03-30 16:15 ` Thomas Monjalon
@ 2016-03-31 13:40 ` Thomas Monjalon
  2016-03-31 17:33   ` Nelson Escobar
  2016-04-01 13:35 ` Declan Doherty
  2 siblings, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2016-03-31 13:40 UTC (permalink / raw)
  To: John Daley, Nelson Escobar; +Cc: dev

2016-03-25 17:44, John Daley:
> From: Nelson Escobar <neescoba@cisco.com>
> 
> Stopping then re-starting a bond interface containing slaves that
> used polling for link detection caused the bond to think all slave
> links were down and inactive.
> 
> Move the start of the polling for link from slave_add() to
> bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
> the last_link_status of the slaves.
> 
> Signed-off-by: Nelson Escobar <neescoba@cisco.com>
> Signed-off-by: John Daley <johndale@cisco.com>

A "Fixes:" line would be appreciated to know the origin of the bug.
Thanks

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

* Re: [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode
  2016-03-31 13:40 ` Thomas Monjalon
@ 2016-03-31 17:33   ` Nelson Escobar
  0 siblings, 0 replies; 7+ messages in thread
From: Nelson Escobar @ 2016-03-31 17:33 UTC (permalink / raw)
  To: Thomas Monjalon, John Daley (johndale); +Cc: dev

Thomas,

Sorry, I should have included the following fixes line:

Fixes: a45b288ef21a("bond: support link status polling")

Please add it to the commit message when applying if there are no other
problems with the patch.

Nelson.
On 3/31/2016 6:40 AM, Thomas Monjalon wrote:
> 2016-03-25 17:44, John Daley:
>> From: Nelson Escobar <neescoba@cisco.com>
>>
>> Stopping then re-starting a bond interface containing slaves that
>> used polling for link detection caused the bond to think all slave
>> links were down and inactive.
>>
>> Move the start of the polling for link from slave_add() to
>> bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
>> the last_link_status of the slaves.
>>
>> Signed-off-by: Nelson Escobar <neescoba@cisco.com>
>> Signed-off-by: John Daley <johndale@cisco.com>
> 
> A "Fixes:" line would be appreciated to know the origin of the bug.
> Thanks
> 

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

* Re: [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode
  2016-03-26  0:44 [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode John Daley
  2016-03-30 16:15 ` Thomas Monjalon
  2016-03-31 13:40 ` Thomas Monjalon
@ 2016-04-01 13:35 ` Declan Doherty
  2 siblings, 0 replies; 7+ messages in thread
From: Declan Doherty @ 2016-04-01 13:35 UTC (permalink / raw)
  To: dev; +Cc: John Daley, Nelson Escobar

On 26/03/16 00:44, John Daley wrote:
> From: Nelson Escobar <neescoba@cisco.com>
>
> Stopping then re-starting a bond interface containing slaves that
> used polling for link detection caused the bond to think all slave
> links were down and inactive.
>
> Move the start of the polling for link from slave_add() to
> bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
> the last_link_status of the slaves.
>
> Signed-off-by: Nelson Escobar <neescoba@cisco.com>
> Signed-off-by: John Daley <johndale@cisco.com>
> ---

Acked-by: Declan Doherty <declan.doherty@intel.com>

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

* Re: [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode
  2016-04-01  8:00 Doherty, Declan
@ 2016-04-01 13:15 ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2016-04-01 13:15 UTC (permalink / raw)
  To: Nelson Escobar; +Cc: dev, Doherty, Declan, John Daley

> > From: Nelson Escobar <neescoba@cisco.com>
> > 
> > Stopping then re-starting a bond interface containing slaves that
> > used polling for link detection caused the bond to think all slave
> > links were down and inactive.
> > 
> > Move the start of the polling for link from slave_add() to
> > bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
> > the last_link_status of the slaves.
> > 
> > Signed-off-by: Nelson Escobar <neescoba@cisco.com>
> > Signed-off-by: John Daley <johndale@cisco.com>
> 
> Acked-by: Declan Doherty <declan.doherty@intel.com>

Applied, thanks

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

* Re: [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode
@ 2016-04-01  8:00 Doherty, Declan
  2016-04-01 13:15 ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Doherty, Declan @ 2016-04-01  8:00 UTC (permalink / raw)
  To: John Daley, dev; +Cc: Nelson Escobar

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of John Daley
> Sent: Saturday, March 26, 2016 12:45 AM
> To: dev@dpdk.org
> Cc: Nelson Escobar <neescoba@cisco.com>; John Daley <johndale@cisco.com>
> Subject: [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode
> 
> From: Nelson Escobar <neescoba@cisco.com>
> 
> Stopping then re-starting a bond interface containing slaves that
> used polling for link detection caused the bond to think all slave
> links were down and inactive.
> 
> Move the start of the polling for link from slave_add() to
> bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
> the last_link_status of the slaves.
> 
> Signed-off-by: Nelson Escobar <neescoba@cisco.com>
> Signed-off-by: John Daley <johndale@cisco.com>
> ---
.....
> --
> 2.7.0

Acked-by: Declan Doherty <declan.doherty@intel.com>

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

end of thread, other threads:[~2016-04-01 13:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-26  0:44 [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode John Daley
2016-03-30 16:15 ` Thomas Monjalon
2016-03-31 13:40 ` Thomas Monjalon
2016-03-31 17:33   ` Nelson Escobar
2016-04-01 13:35 ` Declan Doherty
2016-04-01  8:00 Doherty, Declan
2016-04-01 13:15 ` Thomas Monjalon

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).