diff options
author | Yuchung Cheng <ycheng@google.com> | 2019-01-17 17:51:01 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-01-18 00:30:34 +0100 |
commit | e224c390a6259c529f7b2a6bd215a087b3344f5c (patch) | |
tree | 493ddd94dadde65ab3e817df33fd653ca24c4c8f /net/core | |
parent | bpf: bpf_setsockopt: reset sock dst on SO_MARK changes (diff) | |
download | linux-e224c390a6259c529f7b2a6bd215a087b3344f5c.tar.xz linux-e224c390a6259c529f7b2a6bd215a087b3344f5c.zip |
bpf: fix SO_MAX_PACING_RATE to support TCP internal pacing
If sch_fq packet scheduler is not used, TCP can fallback to
internal pacing, but this requires sk_pacing_status to
be properly set.
Fixes: 8c4b4c7e9ff0 ("bpf: Add setsockopt helper function to bpf")
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Lawrence Brakmo <brakmo@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/filter.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index d9ea51b47f35..dab10d21cae8 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -4119,6 +4119,10 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock, sk->sk_sndbuf = max_t(int, val * 2, SOCK_MIN_SNDBUF); break; case SO_MAX_PACING_RATE: /* 32bit version */ + if (val != ~0U) + cmpxchg(&sk->sk_pacing_status, + SK_PACING_NONE, + SK_PACING_NEEDED); sk->sk_max_pacing_rate = (val == ~0U) ? ~0UL : val; sk->sk_pacing_rate = min(sk->sk_pacing_rate, sk->sk_max_pacing_rate); |