* [dpdk-stable] [PATCH v5] net/bonding: fix slave add for mode 4
[not found] <1525867586-23328-1-git-send-email-radu.nicolau@intel.com>
@ 2018-07-18 13:21 ` Radu Nicolau
2018-08-02 13:42 ` Doherty, Declan
0 siblings, 1 reply; 3+ messages in thread
From: Radu Nicolau @ 2018-07-18 13:21 UTC (permalink / raw)
To: dev; +Cc: declan.doherty, chas3, ferruh.yigit, Radu Nicolau, stable
Moved the link status validity check from the slave add to the slave
activation step. Otherwise slave add will fail for mode 4 if
the ports are all stopped but only one of them checked.
Removed activate slave call from slave add function.
Fixes: b77d21cc2364 ("ethdev: add link status get/set helper functions")
Bugzilla ID: 52
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
v5: removed activate_slave call from slave add
v4: reworked patch
v3: updated commit msg
v2: add fix and Bugzilla references
drivers/net/bonding/rte_eth_bond_api.c | 13 -------------
drivers/net/bonding/rte_eth_bond_pmd.c | 11 +++++++++++
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 49fa2d7..8bc04cf 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -345,14 +345,6 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
internals->tx_queue_offload_capa &= dev_info.tx_queue_offload_capa;
internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads;
- if (link_properties_valid(bonded_eth_dev,
- &slave_eth_dev->data->dev_link) != 0) {
- RTE_BOND_LOG(ERR, "Invalid link properties for slave %d"
- " in bonding mode %d", slave_port_id,
- internals->mode);
- return -1;
- }
-
/* RETA size is GCD of all slaves RETA sizes, so, if all sizes will be
* the power of 2, the lower one is GCD
*/
@@ -412,11 +404,6 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
!internals->user_defined_primary_port)
bond_ethdev_primary_set(internals,
slave_port_id);
-
- if (find_slave_by_id(internals->active_slaves,
- internals->active_slave_count,
- slave_port_id) == internals->active_slave_count)
- activate_slave(bonded_eth_dev, slave_port_id);
}
}
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index fc4d4fd..c156888 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2732,6 +2732,17 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
mac_address_slaves_update(bonded_eth_dev);
}
+ /* check link state properties if bonded link is up*/
+ if (bonded_eth_dev->data->dev_link.link_status == ETH_LINK_UP) {
+ if (link_properties_valid(bonded_eth_dev, &link) != 0)
+ RTE_BOND_LOG(ERR, "Invalid link properties "
+ "for slave %d in bonding mode %d",
+ port_id, internals->mode);
+ } else {
+ /* inherit slave link properties */
+ link_properties_set(bonded_eth_dev, &link);
+ }
+
activate_slave(bonded_eth_dev, port_id);
/* If user has defined the primary port then default to using it */
--
2.7.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH v5] net/bonding: fix slave add for mode 4
2018-07-18 13:21 ` [dpdk-stable] [PATCH v5] net/bonding: fix slave add for mode 4 Radu Nicolau
@ 2018-08-02 13:42 ` Doherty, Declan
2018-08-05 0:15 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Doherty, Declan @ 2018-08-02 13:42 UTC (permalink / raw)
To: Radu Nicolau, dev; +Cc: chas3, ferruh.yigit, stable
On 18/07/2018 2:21 PM, Radu Nicolau wrote:
> Moved the link status validity check from the slave add to the slave
> activation step. Otherwise slave add will fail for mode 4 if
> the ports are all stopped but only one of them checked.
>
> Removed activate slave call from slave add function.
>
> Fixes: b77d21cc2364 ("ethdev: add link status get/set helper functions")
> Bugzilla ID: 52
> Cc: stable@dpdk.org
>
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
> v5: removed activate_slave call from slave add
> v4: reworked patch
> v3: updated commit msg
> v2: add fix and Bugzilla references
>
...
>
Acked-by: Declan Doherty <declan.doherty@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH v5] net/bonding: fix slave add for mode 4
2018-08-02 13:42 ` Doherty, Declan
@ 2018-08-05 0:15 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-08-05 0:15 UTC (permalink / raw)
To: Radu Nicolau; +Cc: dev, Doherty, Declan, chas3, ferruh.yigit, stable
02/08/2018 15:42, Doherty, Declan:
> On 18/07/2018 2:21 PM, Radu Nicolau wrote:
> > Moved the link status validity check from the slave add to the slave
> > activation step. Otherwise slave add will fail for mode 4 if
> > the ports are all stopped but only one of them checked.
> >
> > Removed activate slave call from slave add function.
> >
> > Fixes: b77d21cc2364 ("ethdev: add link status get/set helper functions")
> > Bugzilla ID: 52
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> > ---
> > v5: removed activate_slave call from slave add
> > v4: reworked patch
> > v3: updated commit msg
> > v2: add fix and Bugzilla references
> >
> ...
> >
>
> Acked-by: Declan Doherty <declan.doherty@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-05 0:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1525867586-23328-1-git-send-email-radu.nicolau@intel.com>
2018-07-18 13:21 ` [dpdk-stable] [PATCH v5] net/bonding: fix slave add for mode 4 Radu Nicolau
2018-08-02 13:42 ` Doherty, Declan
2018-08-05 0:15 ` [dpdk-stable] [dpdk-dev] " 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).