]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Merge branch 'tcp-rehash-onto-different-local-ecmp-path-on-retransmit-timeout'
authorJakub Kicinski <kuba@kernel.org>
Mon, 15 Jun 2026 22:57:32 +0000 (15:57 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 15 Jun 2026 23:00:00 +0000 (16:00 -0700)
Neil Spring says:

====================
tcp: rehash onto different local ECMP path on retransmit timeout

Currently sk_rethink_txhash() re-rolls the socket's txhash on RTO,
PLB, and spurious-retransmission events, but the new hash is not
propagated into the IPv6 ECMP path selection.  The cached
route is reused and fib6_select_path() is never re-invoked, so
the connection uses the same local ECMP decision.

This series adds the two missing pieces:

1. __sk_dst_reset() alongside sk_rethink_txhash() so the cached dst
   is invalidated and the next transmit triggers a fresh route lookup.

2. fl6->mp_hash set from sk_txhash before each route lookup so
   fib6_select_path() picks a path from the (potentially re-rolled) hash.

The override applies only to fib_multipath_hash_policy 0 (the default L3
policy).  Its hash includes the flow label, but that is 0 by default
(np->flow_label is unset; auto_flowlabels computes the on-wire label
later, per packet), so flows to the same peer share one local path.
Keying it on sk_txhash makes that local path per-connection and lets a
rehash re-select it; even when a flow label is present (reflected REPFLOW
or explicitly set) only local path selection changes -- the on-wire flow
label is unaffected.  Policies 1-3 are left unchanged.

Patch 1 is the kernel change; patch 2 adds selftests covering rehash on
SYN, SYN/ACK, midstream RTO, midstream spurious-retransmission, and PLB
events, plus a policy 1 negative test, a flowlabel-leak regression test,
a dst-rebuild consistency test, and a syncookie path-consistency test.
====================

Link: https://patch.msgid.link/20260615042158.1600746-1-ntspring@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Trivial merge