DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/bonding: export mode 4 slave info routine
@ 2018-05-17 23:22 Chas Williams
  2018-05-17 23:22 ` [dpdk-dev] [PATCH 2/2] net/bonding: always update bonding link status Chas Williams
  2018-05-22 10:05 ` [dpdk-dev] [dpdk-stable] [PATCH 1/2] net/bonding: export mode 4 slave info routine Ferruh Yigit
  0 siblings, 2 replies; 4+ messages in thread
From: Chas Williams @ 2018-05-17 23:22 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, Chas Williams, stable

From: Chas Williams <chas3@att.com>

rte_eth_bond_8023ad_slave_info() wasn't exported in the original work.
Useful to extract information about the current 802.3ad state.

Fixes: 46fb43683679 ("bond: add mode 4")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/bonding/rte_pmd_bond_version.map b/drivers/net/bonding/rte_pmd_bond_version.map
index ec3374b0f..cdd77df84 100644
--- a/drivers/net/bonding/rte_pmd_bond_version.map
+++ b/drivers/net/bonding/rte_pmd_bond_version.map
@@ -52,3 +52,10 @@ DPDK_17.08 {
 
 
 } DPDK_16.07;
+
+DPDK_18.08 {
+	global:
+
+	rte_eth_bond_8023ad_slave_info;
+
+}:
-- 
2.14.3

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

* [dpdk-dev] [PATCH 2/2] net/bonding: always update bonding link status
  2018-05-17 23:22 [dpdk-dev] [PATCH 1/2] net/bonding: export mode 4 slave info routine Chas Williams
@ 2018-05-17 23:22 ` Chas Williams
  2018-06-14 17:05   ` Ferruh Yigit
  2018-05-22 10:05 ` [dpdk-dev] [dpdk-stable] [PATCH 1/2] net/bonding: export mode 4 slave info routine Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: Chas Williams @ 2018-05-17 23:22 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, Chas Williams, stable

From: Chas Williams <chas3@att.com>

When the first ETH_LINK_UP slave is added to a bonding device, it is
immediately activated.  If these are polling slaves, there will be a
later link state event, when last_link_status doesn't match link_status.
But because this slave is already activated, the bonding device's link
status isn't updated.

To fix this, we always attempt to update the bonding device's link status
in the link state change callback.

Fixes: 46fb43683679 ("bond: add mode 4")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 02d94b1b1..f155ff779 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2664,10 +2664,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
 
 	rte_eth_link_get_nowait(port_id, &link);
 	if (link.link_status) {
-		if (active_pos < internals->active_slave_count) {
-			rte_spinlock_unlock(&internals->lsc_lock);
-			return rc;
-		}
+		if (active_pos < internals->active_slave_count)
+			goto link_update;
 
 		/* if no active slave ports then set this port to be primary port */
 		if (internals->active_slave_count < 1) {
@@ -2686,10 +2684,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
 				internals->primary_port == port_id)
 			bond_ethdev_primary_set(internals, port_id);
 	} else {
-		if (active_pos == internals->active_slave_count) {
-			rte_spinlock_unlock(&internals->lsc_lock);
-			return rc;
-		}
+		if (active_pos == internals->active_slave_count)
+			goto link_update;
 
 		/* Remove from active slave list */
 		deactivate_slave(bonded_eth_dev, port_id);
@@ -2708,6 +2704,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
 		}
 	}
 
+link_update:
 	/**
 	 * Update bonded device link properties after any change to active
 	 * slaves
@@ -2745,7 +2742,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
 
 	rte_spinlock_unlock(&internals->lsc_lock);
 
-	return 0;
+	return rc;
 }
 
 static int
-- 
2.14.3

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 1/2] net/bonding: export mode 4 slave info routine
  2018-05-17 23:22 [dpdk-dev] [PATCH 1/2] net/bonding: export mode 4 slave info routine Chas Williams
  2018-05-17 23:22 ` [dpdk-dev] [PATCH 2/2] net/bonding: always update bonding link status Chas Williams
@ 2018-05-22 10:05 ` Ferruh Yigit
  1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-05-22 10:05 UTC (permalink / raw)
  To: Chas Williams, dev; +Cc: declan.doherty, Chas Williams, stable

On 5/18/2018 12:22 AM, Chas Williams wrote:
> From: Chas Williams <chas3@att.com>
> 
> rte_eth_bond_8023ad_slave_info() wasn't exported in the original work.
> Useful to extract information about the current 802.3ad state.
> 
> Fixes: 46fb43683679 ("bond: add mode 4")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chas Williams <chas3@att.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

(Note, not get whole patch, only this one!)

The API seems added in 2014, not used in any internal tool and nobody complained
up until now, it seems not a popular one...

> ---
>  drivers/net/bonding/rte_pmd_bond_version.map | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/bonding/rte_pmd_bond_version.map b/drivers/net/bonding/rte_pmd_bond_version.map
> index ec3374b0f..cdd77df84 100644
> --- a/drivers/net/bonding/rte_pmd_bond_version.map
> +++ b/drivers/net/bonding/rte_pmd_bond_version.map
> @@ -52,3 +52,10 @@ DPDK_17.08 {
>  
>  
>  } DPDK_16.07;
> +
> +DPDK_18.08 {
> +	global:
> +
> +	rte_eth_bond_8023ad_slave_info;
> +
> +}:
s/}:/ DPDK_17.08;/

Fixed while applying.

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

* Re: [dpdk-dev] [PATCH 2/2] net/bonding: always update bonding link status
  2018-05-17 23:22 ` [dpdk-dev] [PATCH 2/2] net/bonding: always update bonding link status Chas Williams
@ 2018-06-14 17:05   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-06-14 17:05 UTC (permalink / raw)
  To: Chas Williams, dev; +Cc: declan.doherty, Chas Williams, stable

On 5/18/2018 12:22 AM, Chas Williams wrote:
> From: Chas Williams <chas3@att.com>
> 
> When the first ETH_LINK_UP slave is added to a bonding device, it is
> immediately activated.  If these are polling slaves, there will be a
> later link state event, when last_link_status doesn't match link_status.
> But because this slave is already activated, the bonding device's link
> status isn't updated.
> 
> To fix this, we always attempt to update the bonding device's link status
> in the link state change callback.
> 
> Fixes: 46fb43683679 ("bond: add mode 4")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chas Williams <chas3@att.com>

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

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

end of thread, other threads:[~2018-06-14 17:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 23:22 [dpdk-dev] [PATCH 1/2] net/bonding: export mode 4 slave info routine Chas Williams
2018-05-17 23:22 ` [dpdk-dev] [PATCH 2/2] net/bonding: always update bonding link status Chas Williams
2018-06-14 17:05   ` Ferruh Yigit
2018-05-22 10:05 ` [dpdk-dev] [dpdk-stable] [PATCH 1/2] net/bonding: export mode 4 slave info routine 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).