net/bonding: don't clear active slave count
Subsystems (2)
PATCH 1/1 net/bonding: don't clear active slave count
From: "Charles (Chas) Williams" <[email protected]>
When the bond PMD is stopped, the active slave count is reset. For 802.3ad mode this potentially leaks memory and clears state since a second sequential activate_slave() will occur when the bond PMD is restarted and the LSC callback is triggered while the active slave count is 0. To fix this, don't clear the active slave count when stopping. Only deactivate_slave() should be used to clear the slaves.
--- drivers/net/bonding/rte_eth_bond_pmd.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +0 -1
@@ -2173,7 +2173,6 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) tlb_last_obytets[internals->active_slaves[i]] =0 ; } - 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 ;
Signature · 1 line
2.14.3
Hi Chas
From: Chas Williams
Quoted 9 lines
From: "Charles (Chas) Williams" <[email protected]>
When the bond PMD is stopped, the active slave count is reset.
For 802.3ad mode this potentially leaks memory and clears state since a second sequentialactivate_slave()will occur when the bond PMD is restarted and the LSC callback is triggered while the active slave count is 0. To fix this, don't clear the active slave count when stopping. Onlydeactivate_slave()should be used to clear the slaves.
Looks like it is a fix, so need fix title, CC stable and fixes line, no?
Quoted 11 lines
Signed-off-by Chas Williams <[email protected]>--- drivers/net/bonding/rte_eth_bond_pmd.c | 1 - 1 file changed, 1 deletion(-)drivers/net/bonding/rte_eth_bond_pmd.c +0
-0
drivers/net/bonding/rte_eth_bond_pmd.c bond_ethdev_stop(struct rte_eth_dev *eth_dev) · line 2176
Quoted 4 lines
drivers/net/bonding/rte_eth_bond_pmd.c +0
-1@@ -2173,7 +2173,6 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) tlb_last_obytets[internals->active_slaves[i]] =0 ; } - internals->active_slave_count =0 ;
But why not to call deactivate_slave() for all the active slaves?
Quoted 5 lines
drivers/net/bonding/rte_eth_bond_pmd.c +0
-1internals->link_status_polling_enabled =0 ;for (i =0 ; i < internals->slave_count; i++) internals->slaves[i].last_link_status =0 ; --2.14.3
Quoted 10 lines · Matan Azrad
Hi Chas
From: Chas Williams
Quoted 4 lines
From: "Charles (Chas) Williams" <[email protected]>
When the bond PMD is stopped, the active slave count is reset. For 802.3ad mode this potentially leaks memory and clears state since a
second
Quoted 1 line
sequential
activate_slave()will occur when the bond PMD is restartedand the
Quoted 9 lines
Quoted 1 line
LSC callback is triggered while the active slave count is 0. To fix
this, don't clear
Quoted 1 line
the active slave count when stopping. Only
deactivate_slave()should beused to
Quoted 2 lines
clear the slaves.
Looks like it is a fix, so need fix title, CC stable and fixes line, no?
Yes, I forgot to add those. Let's call it an RFC for now. It's not completely clear to
me what is the right thing to do here. The activate state of slaves is really dependent
on the link status of the slaves. Does a PMD have a link status outside of a start/stop
sequence? Or, since we clear the last_status on stop, the start will just get all the
activate/deactivate states corrected. Since we might stop/start for a short interval,
it seems like we might not want to break what 802.3ad has negotiated?
Quoted 27 lines
Quoted 12 lines
Signed-off-by Chas Williams <[email protected]>--- drivers/net/bonding/rte_eth_bond_pmd.c | 1 - 1 file changed, 1 deletion(-)drivers/net/bonding/rte_eth_bond_pmd.c +0
-0drivers/net/bonding/rte_eth_bond_pmd.c bond_ethdev_stop(struct rte_eth_dev *eth_dev) · line 2176
Quoted 4 lines
drivers/net/bonding/rte_eth_bond_pmd.c +0
-1@@ -2173,7 +2173,6 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) tlb_last_obytets[internals->active_slaves[i]] =0 ; } - internals->active_slave_count =0 ;But why not to call
deactivate_slave()for all the active slaves?Quoted 5 lines
drivers/net/bonding/rte_eth_bond_pmd.c +0
-1internals->link_status_polling_enabled =0 ;for (i =0 ; i < internals->slave_count; i++) internals->slaves[i].last_link_status =0 ; --2.14.3
PATCH v2 1/1 net/bonding: don't clear active slave count
In reply to Chas WilliamsFrom: "Charles (Chas) Williams" <[email protected]>
When the bond PMD is stopped, the active slave count is reset. For 802.3ad mode this potentially leaks memory and clears state since a second sequential activate_slave() will occur when the bond PMD is restarted and the LSC callback is triggered while the active slave count is 0. To fix this, don't clear the active slave count when stopping. Only deactivate_slave() should be used to clear the slaves.
--- drivers/net/bonding/rte_eth_bond_pmd.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +0 -1
@@ -2229,7 +2229,6 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) tlb_last_obytets[internals->active_slaves[i]] =0 ; } - 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 ;
Signature · 1 line
2.14.4
Ferruh Yigit
AppliedQuoted 9 lines · Chas Williams
From: "Charles (Chas) Williams" <[email protected]>
When the bond PMD is stopped, the active slave count is reset. For 802.3ad mode this potentially leaks memory and clears state since a second sequential
activate_slave()will occur when the bond PMD is restarted and the LSC callback is triggered while the active slave count is 0. To fix this, don't clear the active slave count when stopping. Onlydeactivate_slave()should be used to clear the slaves.
Quoted 4 lines
Fixes 2efb58cbab6e ("bond: new link bonding library")Signed-off-by Chas Williams <[email protected]>
Applied to dpdk-next-net/master, thanks.