diff options
| author | Neal Cardwell <[email protected]> | 2020-09-10 19:35:34 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-09-11 03:53:01 +0000 |
| commit | 29a949325c6c90f1431db9af64592275c83d9b2a (patch) | |
| tree | de25fc54a76f1a554ccc2357f6e4b30fb42089b3 /net/ipv4/tcp_cong.c | |
| parent | tcp: Simplify EBPF TCP_CONGESTION to always init CC (diff) | |
| download | kernel-29a949325c6c90f1431db9af64592275c83d9b2a.tar.gz kernel-29a949325c6c90f1431db9af64592275c83d9b2a.zip | |
tcp: simplify tcp_set_congestion_control(): Always reinitialize
Now that the previous patches ensure that all call sites for
tcp_set_congestion_control() want to initialize congestion control, we
can simplify tcp_set_congestion_control() by removing the reinit
argument and the code to support it.
Signed-off-by: Neal Cardwell <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Yuchung Cheng <[email protected]>
Acked-by: Kevin Yang <[email protected]>
Cc: Lawrence Brakmo <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_cong.c')
| -rw-r--r-- | net/ipv4/tcp_cong.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c index d18d7a1ce4ce..a9b0fb52a1ec 100644 --- a/net/ipv4/tcp_cong.c +++ b/net/ipv4/tcp_cong.c @@ -341,7 +341,7 @@ out: * already initialized. */ int tcp_set_congestion_control(struct sock *sk, const char *name, bool load, - bool reinit, bool cap_net_admin) + bool cap_net_admin) { struct inet_connection_sock *icsk = inet_csk(sk); const struct tcp_congestion_ops *ca; @@ -365,15 +365,8 @@ int tcp_set_congestion_control(struct sock *sk, const char *name, bool load, if (!ca) { err = -ENOENT; } else if (!load) { - const struct tcp_congestion_ops *old_ca = icsk->icsk_ca_ops; - if (bpf_try_module_get(ca, ca->owner)) { - if (reinit) { - tcp_reinit_congestion_control(sk, ca); - } else { - icsk->icsk_ca_ops = ca; - bpf_module_put(old_ca, old_ca->owner); - } + tcp_reinit_congestion_control(sk, ca); } else { err = -EBUSY; } |
