netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neal Cardwell <ncardwell.kernel@gmail.com>
To: Alexei Starovoitov <ast@kernel.org>
Cc: netdev@vger.kernel.org, Neal Cardwell <ncardwell@google.com>
Subject: [PATCH bpf-next v3 0/5] tcp: increase flexibility of EBPF congestion control initialization
Date: Thu, 10 Sep 2020 15:35:31 -0400	[thread overview]
Message-ID: <20200910193536.2980613-1-ncardwell.kernel@gmail.com> (raw)

From: Neal Cardwell <ncardwell@google.com>

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"

changes in v3:

o no change in commits

o resent patch series from @gmail.com, since mail from ncardwell@google.com
  stopped being accepted at netdev@vger.kernel.org mid-way through processing
  the v2 patch series (between patches 2 and 3), confusing patchwork about
  which patches belonged to the v2 patch series

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

-- 
2.28.0.618.gf4bc123cb7-goog


             reply	other threads:[~2020-09-10 19:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10 19:35 Neal Cardwell [this message]
2020-09-10 19:35 ` [PATCH bpf-next v3 1/5] tcp: only init congestion control if not initialized already Neal Cardwell
2020-09-10 19:35 ` [PATCH bpf-next v3 2/5] tcp: simplify EBPF TCP_CONGESTION to always init CC Neal Cardwell
2020-09-10 19:35 ` [PATCH bpf-next v3 3/5] tcp: simplify tcp_set_congestion_control(): always reinitialize Neal Cardwell
2020-09-10 19:35 ` [PATCH bpf-next v3 4/5] tcp: simplify _bpf_setsockopt(): remove flags argument Neal Cardwell
2020-09-10 19:35 ` [PATCH bpf-next v3 5/5] tcp: simplify tcp_set_congestion_control() load=false case Neal Cardwell
2020-09-11  3:28 ` [PATCH bpf-next v3 0/5] tcp: increase flexibility of EBPF congestion control initialization Martin KaFai Lau
2020-09-11  4:20   ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200910193536.2980613-1-ncardwell.kernel@gmail.com \
    --to=ncardwell.kernel@gmail.com \
    --cc=ast@kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).