I configured an ECMP route across two local interfaces, expecting autoflowlabel to adapt when one of those interfaces is blocked in reaching the destination. However, it did not. This affected SYN, SYN/ACK, and established traffic.
I was able to make this work as I expected it to by calling sk_dst_reset() at times when txhash was updated, and propagating sk_txhash into fl6->mp_hash so fib6_select_path() uses the socket's current hash for ECMP selection. I expected autoflowlabel to apply to local ECMP routes, and think it should, but am open to feedback if this isn't the right way to do it. Patch 1 has the kernel changes; patch 2 adds a selftest exercising SYN, SYN/ACK, and established connection rehash over a two-path ECMP topology. The selftest retries a SYN 26 times, so has a tiny (~3e-8) probability of false failure if repeatedly unlucky with ECMP path selection. Neil Spring (2): tcp: rehash onto different ECMP path on retransmit timeout selftests: net: add ECMP rehash test net/ipv4/tcp_input.c | 4 +- net/ipv4/tcp_minisocks.c | 9 + net/ipv4/tcp_plb.c | 1 + net/ipv4/tcp_timer.c | 1 + net/ipv6/inet6_connection_sock.c | 8 + tools/testing/selftests/net/Makefile | 1 + tools/testing/selftests/net/ecmp_rehash.sh | 354 +++++++++++++++++++++ 7 files changed, 377 insertions(+), 1 deletion(-) create mode 100755 tools/testing/selftests/net/ecmp_rehash.sh -- 2.52.0
