Skip to content

tcp: increase flexibility of EBPF congestion control initialization

Neal Cardwell netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyIn review
  2. v14 patches 7 repliesSuperseded

Changes in v2 from the cover letter

o rebase onto bpf-next

o add another follow-on simplification suggested by Martin KaFai Lau:
"tcp: simplify tcp_set_congestion_control() load=false case"

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5tcp: only init congestion control if not initialized alreadyinclude/net/inet_connection_sock.h net/ipv4/tcp.c net/ipv4/tcp_cong.c +1 more+8 -30 replies
2/5tcp: simplify EBPF TCP_CONGESTION to always init CCnet/core/filter.c+1 -60 replies
3/5tcp: simplify tcp_set_congestion_control(): always reinitializeinclude/net/tcp.h net/core/filter.c net/ipv4/tcp.c +1 more+5 -130 replies
4/5tcp: simplify _bpf_setsockopt(): remove flags argumentnet/core/filter.c+3 -70 replies
5/5tcp: simplify tcp_set_congestion_control() load=false casenet/ipv4/tcp_cong.c+4 -110 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchYuchung ChengKevin YangMartin KaFai Lau
SeriesA-b
1/5A-b A-b
2/5A-b A-b
3/5A-b A-b
4/5A-b A-b
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/5] tcp: increase flexibility of EBPF congestion control initialization

This patch series reorganizes TCP congestion control initialization so that if EBPF code called by tcp_init_transfer() sets the congestion control algorithm by calling setsockopt(TCP_CONGESTION) then the TCP stack initializes the congestion control module immediately, instead of having tcp_init_transfer() later initialize the congestion control module.

This increases flexibility for the EBPF code that runs at connection establishment time, and simplifies the code.

This has the following benefits:

(1) This allows CC module customizations made by the EBPF called in tcp_init_transfer() to persist, and not be wiped out by a later call to tcp_init_congestion_control() in tcp_init_transfer().

(2) Does not flip the order of EBPF and CC init, to avoid causing bugs for existing code upstream that depends on the current order.

(3) Does not cause 2 initializations for for CC in the case where the EBPF called in tcp_init_transfer() wants to set the CC to a new CC algorithm.

(4) Allows follow-on simplifications to the code in net/core/filter.c and net/ipv4/tcp_cong.c, which currently both have some complexity to special-case CC initialization to avoid double CC initialization if EBPF sets the CC.

changes in v2:

o rebase onto bpf-next

o add another follow-on simplification suggested by Martin KaFai Lau:
"tcp: simplify tcp_set_congestion_control() load=false case"

Neal Cardwell (5):
tcp: only init congestion control if not initialized already
tcp: simplify EBPF TCP_CONGESTION to always init CC
tcp: simplify tcp_set_congestion_control(): always reinitialize
tcp: simplify _bpf_setsockopt(): remove flags argument
tcp: simplify tcp_set_congestion_control() load=false case

 include/net/inet_connection_sock.h |  3 ++-
 include/net/tcp.h                  |  2 +-
 net/core/filter.c                  | 18 ++++--------------
 net/ipv4/tcp.c                     |  3 ++-
 net/ipv4/tcp_cong.c                | 27 +++++++--------------------
 net/ipv4/tcp_input.c               |  4 +++-
 6 files changed, 19 insertions(+), 38 deletions(-)
Signature · 1 line
2.28.0.526.ge36021eeef-goog