linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: tcp: add support of window shrink
@ 2023-05-17 12:41 menglong8.dong
  2023-05-17 12:41 ` [PATCH net-next 1/3] net: tcp: add sysctl for controling tcp " menglong8.dong
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: menglong8.dong @ 2023-05-17 12:41 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pabeni, dsahern, netdev, linux-kernel, Menglong Dong

From: Menglong Dong <imagedong@tencent.com>

For now, skb will be dropped when no memory, which makes client keep
retrans util timeout and it's not friendly to the users.

Therefore, now we force to receive one packet on current socket when
the protocol memory is out of the limitation. Then, this socket will
stay in 'no mem' status, util protocol memory is available.

When a socket is in 'no mem' status, it's receive window will become
0, which means window shrink happens. For the sender, it need to
cover this case, and we turn it into zero-window probe status.

In the origin logic, 0 probe is triggered only when there is no any
data in the retrans queue and the receive window can't hold the data
of the 1th packet in the send queue.

Now, let's change it and trigger the 0 probe in such cases:

- if the retrans queue has data and the 1th packet in it is not within
  the receive window, which is for window shrink case, as the shrinked
  window may can't cover the data in retrans queue.
- no data in the retrans queue and the 1th packet in the send queue is
  out of the end of the receive window

And the sysctl 'tcp_wnd_shrink' is also introduced. In order to keep
safe, we disable this feature by default.

*** BLURB HERE ***

Menglong Dong (3):
  net: tcp: add sysctl for controling tcp window shrink
  net: tcp: send zero-window when no memory
  net: tcp: handle window shrink properly

 include/net/sock.h         |  1 +
 include/net/tcp.h          | 22 ++++++++++++++++
 net/ipv4/sysctl_net_ipv4.c |  9 +++++++
 net/ipv4/tcp.c             |  3 +++
 net/ipv4/tcp_input.c       | 53 ++++++++++++++++++++++++++++++++++++++
 net/ipv4/tcp_output.c      | 10 +++++--
 net/ipv4/tcp_timer.c       |  4 +--
 7 files changed, 97 insertions(+), 5 deletions(-)

-- 
2.40.1


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

end of thread, other threads:[~2023-05-24 14:50 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-17 12:41 [PATCH net-next 0/3] net: tcp: add support of window shrink menglong8.dong
2023-05-17 12:41 ` [PATCH net-next 1/3] net: tcp: add sysctl for controling tcp " menglong8.dong
2023-05-17 12:42 ` [PATCH net-next 2/3] net: tcp: send zero-window when no memory menglong8.dong
2023-05-17 14:44   ` Eric Dumazet
2023-05-18  2:14     ` Menglong Dong
2023-05-18 14:25     ` Menglong Dong
2023-05-17 12:42 ` [PATCH net-next 3/3] net: tcp: handle window shrink properly menglong8.dong
2023-05-17 14:47   ` Eric Dumazet
2023-05-18  2:34     ` Menglong Dong
2023-05-18 13:40       ` Neal Cardwell
2023-05-18 14:11         ` Menglong Dong
2023-05-18 16:03           ` Neal Cardwell
2023-05-20  9:07             ` Menglong Dong
2023-05-20 14:28               ` Neal Cardwell
2023-05-22  2:55                 ` Menglong Dong
2023-05-22 15:04                   ` Neal Cardwell
2023-05-23  8:59                     ` Menglong Dong
2023-05-23 13:27                       ` Neal Cardwell
2023-05-24 12:16                         ` Menglong Dong
2023-05-24 14:49                           ` Neal Cardwell
2023-05-23 10:26                     ` Eric Dumazet
2023-05-17 16:55   ` kernel test robot

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