Bonding Overriding Configuration logic restored.
Subsystems (3)
PATCH 1/1 Bonding Overriding Configuration logic restored.
Before commit 3900f29021f0bc7fe9815aa32f1a993b7dfdd402 ("bonding: slight optimizztion for bond_slave_override()") the override logic was to send packets with non-zero queue_id through the slave with corresponding queue_id, under two conditions only - if the slave can transmit and it's up.
The above mentioned commit changed this logic by introducing an additional condition - whether the bond is active (indirectly, using the slave_can_tx and later - bond_is_active_slave), that prevents the user from implementing more complex policies according to the Documentation/networking/bonding.txt.
--- drivers/net/bonding/bond_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/bonding/bond_main.c +2 -1
@@ -3797,7 +3797,8 @@ static inline int bond_slave_override(struct bonding *bond,/* Find out if any slaves have the same mapping as this skb. */ bond_for_each_slave_rcu (bond, slave, iter) {if (slave->queue_id == skb->queue_mapping) { -if (bond_slave_can_tx (slave)) { +if (bond_slave_is_up (slave) && + slave->link ==BOND_LINK_UP ) {bond_dev_queue_xmit (bond, skb, slave->dev);return 0 ; }
Signature · 1 line
1.9.1
Quoted 9 lines · Anton Nayshtut
Before commit
3900f29021f0bc7fe9815aa32f1a993b7dfdd402("bonding: slight optimizztion forbond_slave_override()") the override logic was to send packets with non-zeroqueue_idthrough the slave with correspondingqueue_id, under two conditions only - if the slave can transmit and it's up.The above mentioned commit changed this logic by introducing an additional condition - whether the bond is active (indirectly, using the
slave_can_txand later -bond_is_active_slave), that prevents the user from implementing more complex policies according to theDocumentation/networking/bonding.txt.
Yes, this does. Good catch.
Quoted 2 lines
Signed-off-by Anton Nayshtut <[email protected]>Signed-off-by Alexey Bogoslavsky <[email protected]>
Quoted 21 lines
--- drivers/net/bonding/bond_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/bonding/bond_main.c +2
-1@@ -3797,7 +3797,8 @@ static inline int bond_slave_override(struct bonding *bond,/* Find out if any slaves have the same mapping as this skb. */ bond_for_each_slave_rcu (bond, slave, iter) {if (slave->queue_id == skb->queue_mapping) { -if (bond_slave_can_tx (slave)) { +if (bond_slave_is_up (slave) && + slave->link ==BOND_LINK_UP ) {bond_dev_queue_xmit (bond, skb, slave->dev);return 0 ; }Signature · 1 line
1.9.1
David Miller
maintainerFrom: Anton Nayshtut <[email protected]>
Date: Sun, 29 Mar 2015 14:20:25 +0300
Quoted 5 lines
Before commit
3900f29021f0bc7fe9815aa32f1a993b7dfdd402("bonding: slight optimizztion forbond_slave_override()") the override logic was to send packets with non-zeroqueue_idthrough the slave with correspondingqueue_id, under two conditions only - if the slave can transmit and it's up.
Quoted 7 lines
The above mentioned commit changed this logic by introducing an additional condition - whether the bond is active (indirectly, using the
slave_can_txand later -bond_is_active_slave), that prevents the user from implementing more complex policies according to theDocumentation/networking/bonding.txt.Signed-off-by Anton Nayshtut <[email protected]>Signed-off-by Alexey Bogoslavsky <[email protected]>
Applied and queued up for -stable, thanks.