]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix SO_RCVLOWAT and RCVBUF autotuning
authorEric Dumazet <edumazet@google.com>
Mon, 16 Apr 2018 17:33:35 +0000 (10:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Apr 2018 22:26:37 +0000 (18:26 -0400)
commit5c4e6e4923c160f89db96cbcebe03081c4701acc
tree86a904ade99a93544e0817cda7dc842b12f9b833
parent51bd212eb8c0ddc9f1249d6ef757360141077eb6
tcp: fix SO_RCVLOWAT and RCVBUF autotuning

Applications might use SO_RCVLOWAT on TCP socket hoping to receive
one [E]POLLIN event only when a given amount of bytes are ready in socket
receive queue.

Problem is that receive autotuning is not aware of this constraint,
meaning sk_rcvbuf might be too small to allow all bytes to be stored.

Add a new (struct proto_ops)->set_rcvlowat method so that a protocol
can override the default setsockopt(SO_RCVLOWAT) behavior.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/net.h
include/net/tcp.h
net/core/sock.c
net/ipv4/af_inet.c
net/ipv4/tcp.c
net/ipv6/af_inet6.c