All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH net-next 0/4] txhash: Make hash rethink configurable
@ 2021-10-25 20:35 Akhmat Karakotov
  2021-10-25 20:35 ` [RFC PATCH net-next 1/4] txhash: Make rethinking txhash behavior configurable via sysctl Akhmat Karakotov
                   ` (5 more replies)
  0 siblings, 6 replies; 44+ messages in thread
From: Akhmat Karakotov @ 2021-10-25 20:35 UTC (permalink / raw)
  To: netdev; +Cc: eric.dumazet, tom, mitradir, zeil, hmukos

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/

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

 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              |  2 ++
 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              |  3 +++
 net/core/sock.c                       | 13 +++++++++++++
 net/core/sysctl_net_core.c            |  7 +++++++
 net/ipv4/inet_connection_sock.c       |  3 +++
 net/ipv4/tcp_output.c                 |  3 ++-
 14 files changed, 69 insertions(+), 14 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 44+ messages in thread
* Re: [RFC PATCH v2 net-next 2/4] txhash: Add socket option to control TX hash rethink behavior
  2021-12-02 16:40           ` [RFC PATCH v2 net-next 2/4] txhash: Add socket option to control TX hash rethink behavior Akhmat Karakotov
@ 2021-12-06 13:33 ` Dan Carpenter
  2021-12-02 21:59               ` kernel test robot
  1 sibling, 0 replies; 44+ messages in thread
From: kernel test robot @ 2021-12-04 10:51 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4669 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20211202164031.18134-3-hmukos@yandex-team.ru>
References: <20211202164031.18134-3-hmukos@yandex-team.ru>
TO: Akhmat Karakotov <hmukos@yandex-team.ru>

Hi Akhmat,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on arnd-asm-generic/master]
[cannot apply to net-next/master deller-parisc/for-next bpf-next/master bpf/master linus/master davem-sparc/master v5.16-rc3 next-20211203]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Akhmat-Karakotov/txhash-Make-rethinking-txhash-behavior-configurable-via-sysctl/20211203-014057
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git master
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-m001-20211203 (https://download.01.org/0day-ci/archive/20211204/202112041819.olaAZP8L-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
net/ipv4/inet_connection_sock.c:1049 inet_csk_listen_start() warn: impossible condition '(sk->sk_txrehash == -1) => (0-255 == (-1))'

vim +1049 net/ipv4/inet_connection_sock.c

e337e24d6624e7 Christoph Paasch         2012-12-14  1037  
f985c65c908f6b Eric Dumazet             2015-10-14  1038  int inet_csk_listen_start(struct sock *sk, int backlog)
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1039  {
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1040  	struct inet_connection_sock *icsk = inet_csk(sk);
10cbc8f179177c Eric Dumazet             2015-10-02  1041  	struct inet_sock *inet = inet_sk(sk);
086c653f586259 Craig Gallek             2016-02-10  1042  	int err = -EADDRINUSE;
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1043  
ef547f2ac16bd9 Eric Dumazet             2015-10-02  1044  	reqsk_queue_alloc(&icsk->icsk_accept_queue);
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1045  
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1046  	sk->sk_ack_backlog = 0;
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1047  	inet_csk_delack_init(sk);
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1048  
5a9ea3173f8cf5 Akhmat Karakotov         2021-12-02 @1049  	if (sk->sk_txrehash == SOCK_TXREHASH_DEFAULT)
5a9ea3173f8cf5 Akhmat Karakotov         2021-12-02  1050  		sk->sk_txrehash = READ_ONCE(sock_net(sk)->core.sysctl_txrehash);
5a9ea3173f8cf5 Akhmat Karakotov         2021-12-02  1051  
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1052  	/* There is race window here: we announce ourselves listening,
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1053  	 * but this transition is still not validated by get_port().
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1054  	 * It is OK, because this socket enters to hash table only
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1055  	 * after validation is complete.
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1056  	 */
563e0bb0dc74b3 Yafang Shao              2017-12-20  1057  	inet_sk_state_store(sk, TCP_LISTEN);
c720c7e8383aff Eric Dumazet             2009-10-15  1058  	if (!sk->sk_prot->get_port(sk, inet->inet_num)) {
c720c7e8383aff Eric Dumazet             2009-10-15  1059  		inet->inet_sport = htons(inet->inet_num);
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1060  
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1061  		sk_dst_reset(sk);
086c653f586259 Craig Gallek             2016-02-10  1062  		err = sk->sk_prot->hash(sk);
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1063  
086c653f586259 Craig Gallek             2016-02-10  1064  		if (likely(!err))
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1065  			return 0;
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1066  	}
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1067  
563e0bb0dc74b3 Yafang Shao              2017-12-20  1068  	inet_sk_set_state(sk, TCP_CLOSE);
086c653f586259 Craig Gallek             2016-02-10  1069  	return err;
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1070  }
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1071  EXPORT_SYMBOL_GPL(inet_csk_listen_start);
a019d6fe2b9da6 Arnaldo Carvalho de Melo 2005-08-09  1072  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

end of thread, other threads:[~2022-01-18 16:52 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 20:35 [RFC PATCH net-next 0/4] txhash: Make hash rethink configurable Akhmat Karakotov
2021-10-25 20:35 ` [RFC PATCH net-next 1/4] txhash: Make rethinking txhash behavior configurable via sysctl Akhmat Karakotov
2021-10-25 20:54   ` Eric Dumazet
2021-11-05  6:13   ` [txhash] d7fa06e1ae: WARNING:at_net/sysctl_net.c:#register_net_sysctl kernel test robot
2021-11-05  6:13     ` kernel test robot
2021-11-05  6:13     ` [LTP] " kernel test robot
2021-10-25 20:35 ` [RFC PATCH net-next 2/4] txhash: Add socket option to control TX hash rethink behavior Akhmat Karakotov
2021-10-25 21:05   ` Eric Dumazet
2021-10-29 10:01     ` Akhmat Karakotov
     [not found]       ` <D7FFC160-1DC3-42A5-BE0E-15FD81BEB1F3@yandex-team.ru>
2021-11-08 12:48         ` Akhmat Karakotov
2021-11-08 19:39           ` Eric Dumazet
2021-10-25 20:35 ` [RFC PATCH net-next 3/4] bpf: Add SO_TXREHASH setsockopt Akhmat Karakotov
2021-10-25 20:35 ` [RFC PATCH net-next 4/4] tcp: change SYN ACK retransmit behaviour to account for rehash Akhmat Karakotov
2021-11-12 18:19 ` [RFC PATCH v2 net-next 0/4] txhash: Make hash rethink configurable Akhmat Karakotov
2021-11-12 18:19   ` [RFC PATCH v2 net-next 1/4] txhash: Make rethinking txhash behavior configurable via sysctl Akhmat Karakotov
2021-11-12 18:19   ` [RFC PATCH v2 net-next 2/4] txhash: Add socket option to control TX hash rethink behavior Akhmat Karakotov
2021-11-12 18:19   ` [RFC PATCH v2 net-next 3/4] bpf: Add SO_TXREHASH setsockopt Akhmat Karakotov
2021-11-12 18:19   ` [RFC PATCH v2 net-next 4/4] tcp: change SYN ACK retransmit behaviour to account for rehash Akhmat Karakotov
2021-11-23 13:20   ` [RFC PATCH v2 net-next 0/4] txhash: Make hash rethink configurable Akhmat Karakotov
2021-11-30  9:58     ` Akhmat Karakotov
2021-12-01 16:49       ` Eric Dumazet
2021-12-02 16:40         ` Akhmat Karakotov
2021-12-02 16:40           ` [RFC PATCH v2 net-next 1/4] txhash: Make rethinking txhash behavior configurable via sysctl Akhmat Karakotov
2021-12-02 16:40           ` [RFC PATCH v2 net-next 2/4] txhash: Add socket option to control TX hash rethink behavior Akhmat Karakotov
2021-12-02 17:18             ` Eric Dumazet
2021-12-02 21:59             ` kernel test robot
2021-12-02 21:59               ` kernel test robot
2021-12-02 16:40           ` [RFC PATCH v2 net-next 3/4] bpf: Add SO_TXREHASH setsockopt Akhmat Karakotov
2021-12-02 16:40           ` [RFC PATCH v2 net-next 4/4] tcp: change SYN ACK retransmit behaviour to account for rehash Akhmat Karakotov
2021-12-02 17:24             ` Eric Dumazet
2021-12-06 19:11 ` [RFC PATCH v3 net-next 0/4] txhash: Make hash rethink configurable Akhmat Karakotov
2021-12-06 19:11   ` [RFC PATCH v3 net-next 1/4] txhash: Make rethinking txhash behavior configurable via sysctl Akhmat Karakotov
2021-12-06 19:47     ` Eric Dumazet
2021-12-06 19:11   ` [RFC PATCH v3 net-next 2/4] txhash: Add socket option to control TX hash rethink behavior Akhmat Karakotov
2021-12-06 19:48     ` Eric Dumazet
2021-12-06 19:11   ` [RFC PATCH v3 net-next 3/4] bpf: Add SO_TXREHASH setsockopt Akhmat Karakotov
2021-12-06 19:48     ` Eric Dumazet
2021-12-06 19:11   ` [RFC PATCH v3 net-next 4/4] tcp: change SYN ACK retransmit behaviour to account for rehash Akhmat Karakotov
2021-12-06 19:49     ` Eric Dumazet
2022-01-17 15:31     ` Akhmat Karakotov
2022-01-18 16:03       ` Jakub Kicinski
2022-01-18 16:52         ` Akhmat Karakotov
2021-12-04 10:51 [RFC PATCH v2 net-next 2/4] txhash: Add socket option to control TX hash rethink behavior kernel test robot
2021-12-06 13:33 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.