Commit 6a6ff44b authored by Yuchung Cheng's avatar Yuchung Cheng Committed by Greg Kroah-Hartman

bpf: fix SO_MAX_PACING_RATE to support TCP internal pacing

[ Upstream commit e224c390 ]

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 <>
Signed-off-by: default avatarSasha Levin <>
parent 75412b41
......@@ -3935,6 +3935,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