[dpdk-dev] Make bond_ethdev_stop iterate only over active slaves

Message ID 1435179683-10180-1-git-send-email-jblunck@infradead.org (mailing list archive)
State Accepted, archived
Headers

Commit Message

Jan Blunck June 24, 2015, 9:01 p.m. UTC
  When stopping the bond device we don't need to try and free up the LACPDU's
from deactivated devices since this is covered by
bond_mode_8023ad_deactivate_slave().

This fixes the following:
[    0.100569] PANIC in bond_ethdev_stop():
[    0.100589] line 1172        assert "port->rx_ring != NULL" failed

Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Doherty, Declan June 26, 2015, 7:33 a.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jan Blunck
> Sent: Wednesday, June 24, 2015 2:01 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] Make bond_ethdev_stop iterate only over active
> slaves
> 
> When stopping the bond device we don't need to try and free up the LACPDU's
> from deactivated devices since this is covered by
> bond_mode_8023ad_deactivate_slave().
> 
> This fixes the following:
> [    0.100569] PANIC in bond_ethdev_stop():
> [    0.100589] line 1172        assert "port->rx_ring != NULL" failed
> 
> Signed-off-by: Jan Blunck <jblunck@infradead.org>
> ---
>  drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c
> b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 5a2fbef..1fd1321 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -1520,8 +1520,8 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
>  		bond_mode_8023ad_stop(eth_dev);
> 
>  		/* Discard all messages to/from mode 4 state machines */
> -		for (i = 0; i < internals->slave_count; i++) {
> -			port = &mode_8023ad_ports[internals->slaves[i].port_id];
> +		for (i = 0; i < internals->active_slave_count; i++) {
> +			port = &mode_8023ad_ports[internals->active_slaves[i]];
> 
>  			RTE_VERIFY(port->rx_ring != NULL);
>  			while (rte_ring_dequeue(port->rx_ring, &pkt) != -
> ENOENT)
> --
> 2.1.4

Acked-by : Declan Doherty <declan.doherty@intel.com>
  
Thomas Monjalon June 28, 2015, 10:32 p.m. UTC | #2
> > When stopping the bond device we don't need to try and free up the LACPDU's
> > from deactivated devices since this is covered by
> > bond_mode_8023ad_deactivate_slave().
> > 
> > This fixes the following:
> > [    0.100569] PANIC in bond_ethdev_stop():
> > [    0.100589] line 1172        assert "port->rx_ring != NULL" failed
> > 
> > Signed-off-by: Jan Blunck <jblunck@infradead.org>
> 
> Acked-by : Declan Doherty <declan.doherty@intel.com>

Applied, thanks
  

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 5a2fbef..1fd1321 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1520,8 +1520,8 @@  bond_ethdev_stop(struct rte_eth_dev *eth_dev)
 		bond_mode_8023ad_stop(eth_dev);
 
 		/* Discard all messages to/from mode 4 state machines */
-		for (i = 0; i < internals->slave_count; i++) {
-			port = &mode_8023ad_ports[internals->slaves[i].port_id];
+		for (i = 0; i < internals->active_slave_count; i++) {
+			port = &mode_8023ad_ports[internals->active_slaves[i]];
 
 			RTE_VERIFY(port->rx_ring != NULL);
 			while (rte_ring_dequeue(port->rx_ring, &pkt) != -ENOENT)