netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v4 0/5] Make hash rethink configurable
@ 2022-01-28 19:44 Akhmat Karakotov
  2022-01-28 19:44 ` [PATCH net-next v4 1/5] txhash: Make rethinking txhash behavior configurable via sysctl Akhmat Karakotov
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Akhmat Karakotov @ 2022-01-28 19:44 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, edumazet, eric.dumazet, bpf, ast, daniel, andrii,
	tom, hmukos, zeil, mitradir

As it was shown in the report by Alexander Azimov, hash rethink at the
client-side may lead to connection timeout toward stateful anycast
services. Tom Herbert created a patchset to address this issue by applying
hash rethink only after a negative routing event (3RTOs) [1]. This change
also affects server-side behavior, which we found undesirable. This
patchset changes defaults in a way to make them safe: hash rethink at the
client-side is disabled and enabled at the server-side upon each RTO
event or in case of duplicate acknowledgments.

This patchset provides two options to change default behaviour. The hash
rethink may be disabled at the server-side by the new sysctl option.
Changes in the sysctl option don't affect default behavior at the
client-side.

Hash rethink can also be enabled/disabled with socket option or bpf
syscalls which ovewrite both default and sysctl settings. This socket
option is available on both client and server-side. This should provide
mechanics to enable hash rethink inside administrative domain, such as DC,
where hash rethink at the client-side can be desirable.

[1] https://lore.kernel.org/netdev/20210809185314.38187-1-tom@herbertland.com/

v2:
	- Changed sysctl default to ENABLED in all patches. Reduced sysctl
	  and socket option size to u8. Fixed netns bug reported by kernel
	  test robot.

v3:
	- Fixed bug with bad u8 comparison. Moved sk->txrehash to use less
	  bytes in struct. Added WRITE_ONCE() in setsockopt in and
	  READ_ONCE() in tcp_rtx_synack.

v4:
	- Rebase and add documentation for sysctl option.


Akhmat Karakotov (5):
  txhash: Make rethinking txhash behavior configurable via sysctl
  txhash: Add socket option to control TX hash rethink behavior
  txhash: Add txrehash sysctl description
  bpf: Add SO_TXREHASH setsockopt
  tcp: Change SYN ACK retransmit behaviour to account for rehash

 Documentation/admin-guide/sysctl/net.rst |  9 ++++++++
 arch/alpha/include/uapi/asm/socket.h     |  2 ++
 arch/mips/include/uapi/asm/socket.h      |  2 ++
 arch/parisc/include/uapi/asm/socket.h    |  2 ++
 arch/sparc/include/uapi/asm/socket.h     |  2 ++
 include/net/netns/core.h                 |  1 +
 include/net/sock.h                       | 28 +++++++++++++-----------
 include/uapi/asm-generic/socket.h        |  2 ++
 include/uapi/linux/socket.h              |  4 ++++
 net/core/filter.c                        | 10 +++++++++
 net/core/net_namespace.c                 |  2 ++
 net/core/sock.c                          | 14 ++++++++++++
 net/core/sysctl_net_core.c               | 14 ++++++++++--
 net/ipv4/inet_connection_sock.c          |  3 +++
 net/ipv4/tcp_output.c                    |  4 +++-
 15 files changed, 83 insertions(+), 16 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2022-01-28 22:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-28 19:44 [PATCH net-next v4 0/5] Make hash rethink configurable Akhmat Karakotov
2022-01-28 19:44 ` [PATCH net-next v4 1/5] txhash: Make rethinking txhash behavior configurable via sysctl Akhmat Karakotov
2022-01-28 19:44 ` [PATCH net-next v4 2/5] txhash: Add socket option to control TX hash rethink behavior Akhmat Karakotov
2022-01-28 22:05   ` kernel test robot
2022-01-28 19:44 ` [PATCH net-next v4 3/5] txhash: Add txrehash sysctl description Akhmat Karakotov
2022-01-28 19:44 ` [PATCH net-next v4 4/5] bpf: Add SO_TXREHASH setsockopt Akhmat Karakotov
2022-01-28 19:44 ` [PATCH net-next v4 5/5] tcp: Change SYN ACK retransmit behaviour to account for rehash Akhmat Karakotov

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