linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bonding Overriding Configuration logic restored.
@ 2015-03-29 11:20 Anton Nayshtut
  2015-03-30 13:59 ` Andy Gospodarek
  2015-03-31 17:50 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Anton Nayshtut @ 2015-03-29 11:20 UTC (permalink / raw)
  To: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek
  Cc: netdev, linux-kernel, Anton Nayshtut, Alexey Bogoslavsky

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.

Signed-off-by: Anton Nayshtut <anton@swortex.com>
Signed-off-by: Alexey Bogoslavsky <alexey@swortex.com>
---
 drivers/net/bonding/bond_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 0dceba1..68ad39a 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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;
 			}
-- 
1.9.1


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

* Re: [PATCH] Bonding Overriding Configuration logic restored.
  2015-03-29 11:20 [PATCH] Bonding Overriding Configuration logic restored Anton Nayshtut
@ 2015-03-30 13:59 ` Andy Gospodarek
  2015-03-31 17:50 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Gospodarek @ 2015-03-30 13:59 UTC (permalink / raw)
  To: Anton Nayshtut
  Cc: Jay Vosburgh, Veaceslav Falico, netdev, linux-kernel, Alexey Bogoslavsky

On Sun, Mar 29, 2015 at 02:20:25PM +0300, Anton Nayshtut wrote:
> 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.
Yes, this does.  Good catch.

> Signed-off-by: Anton Nayshtut <anton@swortex.com>
> Signed-off-by: Alexey Bogoslavsky <alexey@swortex.com>
Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>

> ---
>  drivers/net/bonding/bond_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 0dceba1..68ad39a 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -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;
>  			}
> -- 
> 1.9.1
> 

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

* Re: [PATCH] Bonding Overriding Configuration logic restored.
  2015-03-29 11:20 [PATCH] Bonding Overriding Configuration logic restored Anton Nayshtut
  2015-03-30 13:59 ` Andy Gospodarek
@ 2015-03-31 17:50 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-03-31 17:50 UTC (permalink / raw)
  To: anton; +Cc: j.vosburgh, vfalico, gospo, netdev, linux-kernel, alexey

From: Anton Nayshtut <anton@swortex.com>
Date: Sun, 29 Mar 2015 14:20:25 +0300

> 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.
> 
> Signed-off-by: Anton Nayshtut <anton@swortex.com>
> Signed-off-by: Alexey Bogoslavsky <alexey@swortex.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2015-03-31 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-29 11:20 [PATCH] Bonding Overriding Configuration logic restored Anton Nayshtut
2015-03-30 13:59 ` Andy Gospodarek
2015-03-31 17:50 ` David Miller

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).