Skip to content

net: tcp: add support of window shrink

[email protected] lkml netdev oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: tcp: add sysctl for controling tcp window shrinkinclude/net/tcp.h net/ipv4/sysctl_net_ipv4.c net/ipv4/tcp.c+13 -00 replies
2/3net: tcp: send zero-window when no memoryinclude/net/sock.h net/ipv4/tcp_input.c net/ipv4/tcp_output.c+20 -03 replies
3/3net: tcp: handle window shrink properlyinclude/net/tcp.h net/ipv4/tcp_input.c net/ipv4/tcp_output.c +1 more+64 -514 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/3] net: tcp: add support of window shrink

From: Menglong Dong <[email protected]>

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(-)
Signature · 1 line
2.40.1