Commit e224c390 authored by Yuchung Cheng's avatar Yuchung Cheng Committed by Daniel Borkmann
Browse files

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: 8c4b4c7e

 ("bpf: Add setsockopt helper function to bpf")
Signed-off-by: default avatarYuchung Cheng <>
Signed-off-by: default avatarEric Dumazet <>
Cc: Lawrence Brakmo <>
Acked-by: default avatarMartin KaFai Lau <>
Signed-off-by: default avatarDaniel Borkmann <>
parent f4924f24
......@@ -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);
case SO_MAX_PACING_RATE: /* 32bit version */
if (val != ~0U)
sk->sk_max_pacing_rate = (val == ~0U) ? ~0UL : val;
sk->sk_pacing_rate = min(sk->sk_pacing_rate,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment