stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "bonding: discard lowest hash bit for 802.3ad layer3+4" has been added to the 4.13-stable tree
@ 2017-11-21 12:38 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-11-21 12:38 UTC (permalink / raw)
  To: liuhangbin, davem, gregkh, pabeni; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    bonding: discard lowest hash bit for 802.3ad layer3+4

to the 4.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bonding-discard-lowest-hash-bit-for-802.3ad-layer3-4.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Tue Nov 21 13:07:20 CET 2017
From: Hangbin Liu <liuhangbin@gmail.com>
Date: Mon, 6 Nov 2017 09:01:57 +0800
Subject: bonding: discard lowest hash bit for 802.3ad layer3+4

From: Hangbin Liu <liuhangbin@gmail.com>


[ Upstream commit b5f862180d7011d9575d0499fa37f0f25b423b12 ]

After commit 07f4c90062f8 ("tcp/dccp: try to not exhaust ip_local_port_range
in connect()"), we will try to use even ports for connect(). Then if an
application (seen clearly with iperf) opens multiple streams to the same
destination IP and port, each stream will be given an even source port.

So the bonding driver's simple xmit_hash_policy based on layer3+4 addressing
will always hash all these streams to the same interface. And the total
throughput will limited to a single slave.

Change the tcp code will impact the whole tcp behavior, only for bonding
usage. Paolo Abeni suggested fix this by changing the bonding code only,
which should be more reasonable, and less impact.

Fix this by discarding the lowest hash bit because it contains little entropy.
After the fix we can re-balance between slaves.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/bonding/bond_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3253,7 +3253,7 @@ u32 bond_xmit_hash(struct bonding *bond,
 	hash ^= (hash >> 16);
 	hash ^= (hash >> 8);
 
-	return hash;
+	return hash >> 1;
 }
 
 /*-------------------------- Device entry points ----------------------------*/


Patches currently in stable-queue which might be from liuhangbin@gmail.com are

queue-4.13/bonding-discard-lowest-hash-bit-for-802.3ad-layer3-4.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-21 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-21 12:38 Patch "bonding: discard lowest hash bit for 802.3ad layer3+4" has been added to the 4.13-stable tree gregkh

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