Thread (17 messages) flat view 17 messages, 4 authors, 2017-09-11

Re: [PATCH] net: bonding: Fix transmit load balancing in balance-alb mode if specified by sysfs

From: Nikolay Aleksandrov <hidden>
Date: 2017-09-11 16:30:16
Also in: lkml

On 11 September 2017 19:07:33 EEST, "Mahesh Bandewar (महेश बंडेवार)" [off-list ref] wrote:
On Sat, Sep 9, 2017 at 4:28 AM, Nikolay Aleksandrov
[off-list ref] wrote:
quoted
On 07/09/17 01:47, Kosuke Tatsukawa wrote:
quoted
Commit cbf5ecb30560 ("net: bonding: Fix transmit load balancing in
balance-alb mode") tried to fix transmit dynamic load balancing in
balance-alb mode, which wasn't working after commit 8b426dc54cf4
("bonding: remove hardcoded value").

It turned out that my previous patch only fixed the case when
balance-alb was specified as bonding module parameter, and not when
balance-alb mode was set using /sys/class/net/*/bonding/mode (the
most
quoted
quoted
common usage).  In the latter case, tlb_dynamic_lb was set up
according
quoted
quoted
to the default mode of the bonding interface, which happens to be
balance-rr.

This additional patch addresses this issue by setting up
tlb_dynamic_lb
quoted
quoted
to 1 if "mode" is set to balance-alb through the sysfs interface.

I didn't add code to change tlb_balance_lb back to the default value
for
quoted
quoted
other modes, because "mode" is usually set up only once during
initialization, and it's not worthwhile to change the static
variable
quoted
quoted
bonding_defaults in bond_main.c to a global variable just for this
purpose.

Commit 8b426dc54cf4 also changes the value of tlb_dynamic_lb for
balance-tlb mode if it is set up using the sysfs interface.  I
didn't
quoted
quoted
change that behavior, because the value of tlb_balance_lb can be
changed
quoted
quoted
using the sysfs interface for balance-tlb, and I didn't like
changing
quoted
quoted
the default value back and forth for balance-tlb.

As for balance-alb, /sys/class/net/*/bonding/tlb_balance_lb cannot
be
quoted
quoted
written to.  However, I think balance-alb with tlb_dynamic_lb set to
0
quoted
quoted
is not an intended usage, so there is little use making it writable
at
quoted
quoted
this moment.

Fixes: 8b426dc54cf4 ("bonding: remove hardcoded value")
Reported-by: Reinis Rozitis <redacted>
Signed-off-by: Kosuke Tatsukawa <redacted>
Cc: stable@vger.kernel.org  # v4.12+
---
 drivers/net/bonding/bond_options.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
This fix is simpler and more suitable for -net, it fixes the case
where
quoted
we switch to ALB mode with tlb_dynamic_lb = 0. After it is in I'll
fix the
quoted
default tlb_dynamic_lb issue and restore the original behaviour.
Changing tlb_dyanamic_lb to initialize always is also safe for -net
and can go in before or after this change (no dependency on this
change as such)
I never said it was unsafe or dependent, it is simply my preference to wait. :-)
If you need it sooner feel free to post it.
quoted
Acked-by: Nikolay Aleksandrov <redacted>
Acked-by: Mahesh Bandewar <redacted>
quoted
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help