diff options
author | Prankur gupta <prankgup@fb.com> | 2020-12-02 13:31:51 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-12-03 17:23:24 -0800 |
commit | cb81110997d1f5097f29dd8e49d32a1fc55cbf86 (patch) | |
tree | 9e4266c79d35395cbccd79f7eb7cf4c27eaef2b9 /net/core | |
parent | 2faa7328f53b36b2b171501154bba3fd66d8f5da (diff) |
bpf: Adds support for setting window clamp
Adds a new bpf_setsockopt for TCP sockets, TCP_BPF_WINDOW_CLAMP,
which sets the maximum receiver window size. It will be useful for
limiting receiver window based on RTT.
Signed-off-by: Prankur gupta <prankgup@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201202213152.435886-2-prankgup@fb.com
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/filter.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index 21d91dcf0260..77001a35768f 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -4910,6 +4910,9 @@ static int _bpf_setsockopt(struct sock *sk, int level, int optname, tp->notsent_lowat = val; sk->sk_write_space(sk); break; + case TCP_WINDOW_CLAMP: + ret = tcp_set_window_clamp(sk, val); + break; default: ret = -EINVAL; } |