Skip to contentSkip to conversation

tcp: convert icsk_user_timeout from jiffies to msecs

PATCH In review Jon Maxwell 2 participants 2 messages Jul 13, 2018 – Jul 16, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 tcp: convert icsk_user_timeout from jiffies to msecs

Create a seperate helper routine called tcp_retransmit_stamp() as per Neal Cardwells suggestion. To be used by the final commit in this series and retransmits_timed_out().

---
 net/ipv4/tcp_timer.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)
net/ipv4/tcp_timer.c +17 -8
index fa34984d0b12..8ab8c9645294 100644
@@ -22,6 +22,20 @@
 #include <linux/gfp.h>
 #include <net/tcp.h>
 
+u32 tcp_retransmit_stamp(const struct sock *sk)
+{
+	u32 start_ts = tcp_sk(sk)->retrans_stamp;
+
+	if (unlikely(!start_ts)) {
+		struct sk_buff *head = tcp_rtx_queue_head(sk);
+
+	if (!head)
+		return 0;
+	start_ts = tcp_skb_timestamp(head);
+	}
+	return start_ts;
+}
+
 /**
  *  tcp_write_err() - close socket and save error info
  *  @sk:  The socket the error has appeared on.
@@ -166,14 +180,9 @@ static bool retransmits_timed_out(struct sock *sk,
 	if (!inet_csk(sk)->icsk_retransmits)
 		return false;
 
-	start_ts = tcp_sk(sk)->retrans_stamp;
-	if (unlikely(!start_ts)) {
-		struct sk_buff *head = tcp_rtx_queue_head(sk);
-
-		if (!head)
-			return false;
-		start_ts = tcp_skb_timestamp(head);
-	}
+	start_ts = tcp_retransmit_stamp(sk);
+	if (!start_ts)
+		return false;
 
 	if (likely(timeout == 0)) {
 		linear_backoff_thresh = ilog2(TCP_RTO_MAX/rto_base);
Signature · 1 line
2.13.6
#1 lore raw
Quoted 18 lines · Jon Maxwell

Create a seperate helper routine called tcp_retransmit_stamp() as per Neal Cardwells suggestion. To be used by the final commit in this series and retransmits_timed_out().

---
 net/ipv4/tcp_timer.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)
net/ipv4/tcp_timer.c +1 -0
index fa34984d0b12..8ab8c9645294 100644
@@ -22,6 +22,20 @@
 #include <linux/gfp.h>
 #include <net/tcp.h>
 
+u32 tcp_retransmit_stamp(const struct sock *sk)

net/ipv4/tcp_timer.c line 35

Quoted 10 lines
net/ipv4/tcp_timer.c +10 -0
+{
+	u32 start_ts = tcp_sk(sk)->retrans_stamp;
+
+	if (unlikely(!start_ts)) {
+		struct sk_buff *head = tcp_rtx_queue_head(sk);
+
+	if (!head)
+		return 0;
+	start_ts = tcp_skb_timestamp(head);
+	}?

Indentation is fuzzy.

Can you send a new version, with a cover letter ?

git format-patch -o ../output --cover-letter --subject-prefix "PATCH net-next" origin

...

Thanks !