All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tcp: Use BPF timeout setting for SYN ACK RTO
@ 2021-10-25 12:12 Akhmat Karakotov
  2021-10-25 16:54 ` Eric Dumazet
  2021-11-03 20:46 ` [PATCH v3] " Akhmat Karakotov
  0 siblings, 2 replies; 25+ messages in thread
From: Akhmat Karakotov @ 2021-10-25 12:12 UTC (permalink / raw)
  To: netdev; +Cc: hmukos, mitradir, zeil, brakmo

When setting RTO through BPF program, SYN ACK packets were unaffected and
continued to use TCP_TIMEOUT_INIT constant. This patch makes SYN ACK
retransmits use tcp_timeout_init() function instead.

Signed-off-by: Akhmat Karakotov <hmukos@yandex-team.ru>
---
 net/ipv4/inet_connection_sock.c | 2 +-
 net/ipv4/tcp_minisocks.c        | 4 ++--
 net/ipv4/tcp_timer.c            | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 0d477c816309..41663d1ffd0a 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -870,7 +870,7 @@ static void reqsk_timer_handler(struct timer_list *t)
 
 		if (req->num_timeout++ == 0)
 			atomic_dec(&queue->young);
-		timeo = min(TCP_TIMEOUT_INIT << req->num_timeout, TCP_RTO_MAX);
+		timeo = min(tcp_timeout_init((struct sock *)req) << req->num_timeout, TCP_RTO_MAX);
 		mod_timer(&req->rsk_timer, jiffies + timeo);
 
 		if (!nreq)
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 0a4f3f16140a..8ddc3aa9e3a6 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -590,7 +590,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
 			 * it can be estimated (approximately)
 			 * from another data.
 			 */
-			tmp_opt.ts_recent_stamp = ktime_get_seconds() - ((TCP_TIMEOUT_INIT/HZ)<<req->num_timeout);
+			tmp_opt.ts_recent_stamp = ktime_get_seconds() - ((tcp_timeout_init((struct sock *)req)/HZ)<<req->num_timeout);
 			paws_reject = tcp_paws_reject(&tmp_opt, th->rst);
 		}
 	}
@@ -629,7 +629,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
 		    !inet_rtx_syn_ack(sk, req)) {
 			unsigned long expires = jiffies;
 
-			expires += min(TCP_TIMEOUT_INIT << req->num_timeout,
+			expires += min(tcp_timeout_init((struct sock *)req) << req->num_timeout,
 				       TCP_RTO_MAX);
 			if (!fastopen)
 				mod_timer_pending(&req->rsk_timer, expires);
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 20cf4a98c69d..0954e3685ad2 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -430,7 +430,7 @@ static void tcp_fastopen_synack_timer(struct sock *sk, struct request_sock *req)
 	if (!tp->retrans_stamp)
 		tp->retrans_stamp = tcp_time_stamp(tp);
 	inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
-			  TCP_TIMEOUT_INIT << req->num_timeout, TCP_RTO_MAX);
+			  tcp_timeout_init((struct sock *)req) << req->num_timeout, TCP_RTO_MAX);
 }
 
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-01-18 17:20 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 12:12 [PATCH] tcp: Use BPF timeout setting for SYN ACK RTO Akhmat Karakotov
2021-10-25 16:54 ` Eric Dumazet
2021-10-25 19:26   ` Alexander Azimov
2021-10-25 20:48     ` [PATCH] " Eric Dumazet
2021-10-25 21:55       ` Martin KaFai Lau
2021-10-29 16:19       ` Akhmat Karakotov
2021-10-29 16:29         ` Akhmat Karakotov
2021-10-29 16:30         ` Eric Dumazet
2021-11-02 18:32           ` [PATCH v2] " Akhmat Karakotov
2021-11-02 18:57             ` Yuchung Cheng
2021-11-02 22:06             ` Eric Dumazet
2021-11-02 23:17               ` Martin KaFai Lau
2021-11-03  9:31                 ` Akhmat Karakotov
2021-11-03 17:22                   ` Martin KaFai Lau
2021-11-03 20:46 ` [PATCH v3] " Akhmat Karakotov
2021-11-03 20:54   ` Eric Dumazet
2021-11-03 21:23   ` Yuchung Cheng
2021-11-03 21:53     ` Neal Cardwell
2021-11-04  1:06   ` Martin KaFai Lau
2022-01-17 15:26     ` Akhmat Karakotov
2022-01-18 15:57       ` Jakub Kicinski
2022-01-18 16:49         ` Akhmat Karakotov
2022-01-18 17:04           ` Jakub Kicinski
2022-01-18 17:07             ` Akhmat Karakotov
2022-01-18 17:20               ` Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.