From: Miao Xu Date: Thu, 2 May 2024 04:23:17 +0000 (-0700) Subject: bpf: tcp: Allow to write tp->snd_cwnd_stamp in bpf_tcp_ca X-Git-Tag: Ubuntu-6.11.0-9.9~1473^2~13^2~34^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=0325cbd21e3c26eff88bc7da303ffb46b4f5d294;p=mirror_ubuntu-kernels.git bpf: tcp: Allow to write tp->snd_cwnd_stamp in bpf_tcp_ca This patch allows the write of tp->snd_cwnd_stamp in a bpf tcp ca program. An use case of writing this field is to keep track of the time whenever tp->snd_cwnd is raised or reduced inside the `cong_control` callback. Reviewed-by: Eric Dumazet Signed-off-by: Miao Xu Link: https://lore.kernel.org/r/20240502042318.801932-3-miaxu@meta.com Signed-off-by: Martin KaFai Lau --- diff --git a/net/ipv4/bpf_tcp_ca.c b/net/ipv4/bpf_tcp_ca.c index 6bd7f8db189a..18227757ec0c 100644 --- a/net/ipv4/bpf_tcp_ca.c +++ b/net/ipv4/bpf_tcp_ca.c @@ -107,6 +107,9 @@ static int bpf_tcp_ca_btf_struct_access(struct bpf_verifier_log *log, case offsetof(struct tcp_sock, snd_cwnd_cnt): end = offsetofend(struct tcp_sock, snd_cwnd_cnt); break; + case offsetof(struct tcp_sock, snd_cwnd_stamp): + end = offsetofend(struct tcp_sock, snd_cwnd_stamp); + break; case offsetof(struct tcp_sock, snd_ssthresh): end = offsetofend(struct tcp_sock, snd_ssthresh); break;