From 5584cd7e0ddd0d4e6e91498864c4cd025445dafe Mon Sep 17 00:00:00 2001 From: Jason Xing Date: Wed, 12 Mar 2025 16:35:21 +0100 Subject: [PATCH] tcp: bpf: Support bpf_getsockopt for TCP_BPF_RTO_MIN Support bpf_getsockopt if application tries to know what the RTO MIN of this socket is. Signed-off-by: Jason Xing Signed-off-by: Martin KaFai Lau Link: https://patch.msgid.link/20250312153523.9860-3-kerneljasonxing@gmail.com --- net/core/filter.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/core/filter.c b/net/core/filter.c index 2932de5cc57ce..4d34d35af5c78 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -5295,6 +5295,12 @@ static int bpf_sol_tcp_getsockopt(struct sock *sk, int optname, memcpy(optval, &cb_flags, optlen); break; } + case TCP_BPF_RTO_MIN: { + int rto_min_us = jiffies_to_usecs(inet_csk(sk)->icsk_rto_min); + + memcpy(optval, &rto_min_us, optlen); + break; + } default: return -EINVAL; } -- 2.47.3