Skip to content

tcp: optimizations for linux-5.17

Eric Dumazet netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest20 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20tcp: minor optimization in tcp_add_backlog()net/ipv4/tcp_ipv4.c+2 -30 replies
2/20tcp: remove dead code in __tcp_v6_send_check()include/net/ip6_checksum.h+3 -92 replies
3/20tcp: small optimization in tcp_v6_send_check()net/ipv6/tcp_ipv6.c+1 -30 replies
4/20net: use sk_is_tcp() in more placesinclude/linux/skmsg.h include/net/sock.h net/core/skbuff.c +1 more+9 -140 replies
5/20net: remove sk_route_forced_capsinclude/net/sock.h net/core/sock.c net/ipv4/tcp.c+3 -50 replies
6/20net: remove sk_route_nocapsinclude/net/sock.h net/core/sock.c net/ipv4/tcp_ipv4.c +2 more+11 -110 replies
7/20ipv6: shrink struct ipcm6_cookieinclude/net/ipv6.h+2 -20 replies
8/20net: shrink struct sock by 8 bytesinclude/net/sock.h+1 -10 replies
9/20net: forward_alloc_get depends on CONFIG_MPTCPinclude/net/sock.h+7 -40 replies
10/20net: cache align tcp_memory_allocated, tcp_sockets_allocatednet/ipv4/tcp.c net/ipv4/udp.c net/mptcp/protocol.c+4 -40 replies
11/20tcp: small optimization in tcp recvmsg()net/ipv4/tcp.c+1 -20 replies
12/20tcp: add RETPOLINE mitigation to sk_backlog_rcvinclude/net/sock.h net/core/sock.c net/ipv6/tcp_ipv6.c+14 -40 replies
13/20tcp: annotate data-races on tp->segs_in and tp->data_segs_ininclude/net/tcp.h net/ipv4/tcp.c+10 -40 replies
14/20tcp: annotate races around tp->urg_datanet/ipv4/tcp.c net/ipv4/tcp_input.c+11 -100 replies
15/20tcp: tp->urg_data is unlikely to be setnet/ipv4/tcp.c net/ipv4/tcp_input.c+7 -70 replies
16/20tcp: avoid indirect calls to sock_rfreenet/ipv4/tcp.c+15 -51 reply
17/20tcp: defer skb freeing after socket lock is releasedinclude/linux/skbuff.h include/net/sock.h include/net/tcp.h +3 more+42 -29 replies
18/20tcp: check local var (timeo) before socket fields in one testnet/ipv4/tcp.c+2 -20 replies
19/20tcp: do not call tcp_cleanup_rbuf() if we have a backlognet/ipv4/tcp.c+1 -20 replies
20/20net: move early demux fields close to sk_refcntinclude/net/sock.h+5 -30 replies

Reviews trailers per patch

None of the 20 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSoheil Hassas YeganehArjun Roy
SeriesA-b A-b
1/20
2/20
3/20
4/20
5/20
6/20
7/20
8/20
9/20
10/20
11/20
12/20
13/20
14/20
15/20
16/20
17/20
18/20
19/20
20/20

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 00/20] tcp: optimizations for linux-5.17

From: Eric Dumazet <[email protected]>

Mostly small improvements in this series.

The notable change is in "defer skb freeing after socket lock is released" in recvmsg() (and RX zerocopy)

The idea is to try to let skb freeing to BH handler, whenever possible, or at least perform the freeing outside of the socket lock section, for much improved performance. This idea can probably be extended to other protocols.

Tests on a 100Gbit NIC
Max throughput for one TCP_STREAM flow, over 10 runs.

MTU : 1500 (1428 bytes of TCP payload per MSS)
Before: 55 Gbit
After: 66 Gbit

MTU : 4096+ (4096 bytes of TCP payload, plus TCP/IPv6 headers)
Before: 82 Gbit
After: 95 Gbit

Eric Dumazet (20):
tcp: minor optimization in tcp_add_backlog()
tcp: remove dead code in __tcp_v6_send_check()
tcp: small optimization in tcp_v6_send_check()
net: use sk_is_tcp() in more places
net: remove sk_route_forced_caps
net: remove sk_route_nocaps
ipv6: shrink struct ipcm6_cookie
net: shrink struct sock by 8 bytes
net: forward_alloc_get depends on CONFIG_MPTCP
net: cache align tcp_memory_allocated, tcp_sockets_allocated
tcp: small optimization in tcp recvmsg()
tcp: add RETPOLINE mitigation to sk_backlog_rcv
tcp: annotate data-races on tp->segs_in and tp->data_segs_in
tcp: annotate races around tp->urg_data
tcp: tp->urg_data is unlikely to be set
tcp: avoid indirect calls to sock_rfree
tcp: defer skb freeing after socket lock is released
tcp: check local var (timeo) before socket fields in one test
tcp: do not call tcp_cleanup_rbuf() if we have a backlog
net: move early demux fields close to sk_refcnt

 include/linux/skbuff.h     |  2 +
 include/linux/skmsg.h      |  6 ---
 include/net/ip6_checksum.h | 12 ++---
 include/net/ipv6.h         |  4 +-
 include/net/sock.h         | 51 +++++++++++++--------
 include/net/tcp.h          | 18 +++++++-
 net/core/skbuff.c          |  6 +--
 net/core/sock.c            | 18 +++++---
 net/ipv4/tcp.c             | 91 ++++++++++++++++++++++++++------------
 net/ipv4/tcp_input.c       |  8 ++--
 net/ipv4/tcp_ipv4.c        | 10 ++---
 net/ipv4/tcp_output.c      |  2 +-
 net/ipv4/udp.c             |  2 +-
 net/ipv6/ip6_output.c      |  2 +-
 net/ipv6/tcp_ipv6.c        | 10 ++---
 net/mptcp/protocol.c       |  2 +-
 16 files changed, 149 insertions(+), 95 deletions(-)
Signature · 1 line
2.34.0.rc1.387.gb447b232ab-goog