[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240502042318.801932-3-miaxu@meta.com>
Date: Wed, 1 May 2024 21:23:17 -0700
From: Miao Xu <miaxu@...a.com>
To: Eric Dumazet <edumazet@...gle.com>,
"David S . Miller"
<davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>,
David Ahern <dsahern@...nel.org>, Martin Lau
<kafai@...a.com>
CC: <netdev@...r.kernel.org>, <bpf@...r.kernel.org>, Miao Xu <miaxu@...a.com>
Subject: [PATCH net-next v3 2/3] 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 <edumazet@...gle.com>
---
Changes in v3:
* Updated the title.
Changes in v2:
* None. It is a spinout from the original 1st patch.
Signed-off-by: Miao Xu <miaxu@...a.com>
---
net/ipv4/bpf_tcp_ca.c | 3 +++
1 file changed, 3 insertions(+)
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;
--
2.43.0
Powered by blists - more mailing lists