bpf: fix SO_MAX_PACING_RATE to support TCP internal pacing
Subsystems (4)
PATCH 1/1 bpf: fix SO_MAX_PACING_RATE to support TCP internal pacing
From: Yuchung Cheng <[email protected]>
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 <[email protected]>
Signed-off-by Eric Dumazet <[email protected]>
Cc Lawrence Brakmo <[email protected]>
--- net/core/filter.c | 4 ++++ 1 file changed, 4 insertions(+)
net/core/filter.c +4 -0
@@ -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);
Signature · 1 line
2.20.1.321.g9e740568ce-goog
Quoted 5 lines · Eric Dumazet
From: Yuchung Cheng <[email protected]>
If
sch_fqpacket scheduler is not used, TCP can fallback to internal pacing, but this requiressk_pacing_statusto be properly set.
Acked-by Martin KaFai Lau <[email protected]>
Quoted 10 lines · Eric Dumazet
From: Yuchung Cheng <[email protected]>
If
sch_fqpacket scheduler is not used, TCP can fallback to internal pacing, but this requiressk_pacing_statusto be properly set.Fixes 8c4b4c7e9ff0 ("bpf: Add setsockopt helper function to bpf")Signed-off-by Yuchung Cheng <[email protected]>Signed-off-by Eric Dumazet <[email protected]>Cc Lawrence Brakmo <[email protected]>
Applied, thanks!