From 6810c771d3165e6320f991220f0c92519e6bace7 Mon Sep 17 00:00:00 2001 From: Jason Xing Date: Wed, 19 Feb 2025 16:13:31 +0800 Subject: [PATCH] bpf: Support TCP_RTO_MAX_MS for bpf_setsockopt Some applications don't want to wait for too long because the time of retransmission increases exponentially and can reach more than 10 seconds, for example. Eric implements the core logic on supporting rto max feature in the stack previously. Based on that, we can support it for BPF use. This patch reuses the same logic of TCP_RTO_MAX_MS in do_tcp_setsockopt() and do_tcp_getsockopt(). BPF program can call bpf_{set/get}sockopt() to set/get the maximum value of RTO. Signed-off-by: Jason Xing Signed-off-by: Martin KaFai Lau Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20250219081333.56378-2-kerneljasonxing@gmail.com --- net/core/filter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/filter.c b/net/core/filter.c index 2ec162dd83c4..ffec7b4357f9 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -5382,6 +5382,7 @@ static int sol_tcp_sockopt(struct sock *sk, int optname, case TCP_USER_TIMEOUT: case TCP_NOTSENT_LOWAT: case TCP_SAVE_SYN: + case TCP_RTO_MAX_MS: if (*optlen != sizeof(int)) return -EINVAL; break; -- 2.50.1