linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V4 net-next 2/3] tcp: Add tcp_retransmit_stamp() helper routine
@ 2018-07-19  1:14 Jon Maxwell
  2018-07-19  9:31 ` Sergei Shtylyov
  2018-07-19 13:49 ` Eric Dumazet
  0 siblings, 2 replies; 3+ messages in thread
From: Jon Maxwell @ 2018-07-19  1:14 UTC (permalink / raw)
  To: davem
  Cc: edumazet, ncardwell, David.Laight, kuznet, yoshfuji, netdev,
	linux-kernel, jmaxwell

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

Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
---
 net/ipv4/tcp_timer.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index fa34984d0b12..d212f183dd2d 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -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);
-- 
2.13.6


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

* Re: [PATCH V4 net-next 2/3] tcp: Add tcp_retransmit_stamp() helper routine
  2018-07-19  1:14 [PATCH V4 net-next 2/3] tcp: Add tcp_retransmit_stamp() helper routine Jon Maxwell
@ 2018-07-19  9:31 ` Sergei Shtylyov
  2018-07-19 13:49 ` Eric Dumazet
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2018-07-19  9:31 UTC (permalink / raw)
  To: Jon Maxwell, davem
  Cc: edumazet, ncardwell, David.Laight, kuznet, yoshfuji, netdev,
	linux-kernel, jmaxwell

Hello!

On 7/19/2018 4:14 AM, Jon Maxwell wrote:

> Create a seperate helper routine as per Neal Cardwells suggestion. To

    Cardwell's. Perhaps copuld be fixed while applying...

> be used by the final commit in this series and retransmits_timed_out().
> 
> Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
[...]

MBR, Sergei

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

* Re: [PATCH V4 net-next 2/3] tcp: Add tcp_retransmit_stamp() helper routine
  2018-07-19  1:14 [PATCH V4 net-next 2/3] tcp: Add tcp_retransmit_stamp() helper routine Jon Maxwell
  2018-07-19  9:31 ` Sergei Shtylyov
@ 2018-07-19 13:49 ` Eric Dumazet
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2018-07-19 13:49 UTC (permalink / raw)
  To: Jon Maxwell, davem
  Cc: edumazet, ncardwell, David.Laight, kuznet, yoshfuji, netdev,
	linux-kernel, jmaxwell



On 07/18/2018 06:14 PM, Jon Maxwell wrote:
> Create a seperate helper routine as per Neal Cardwells suggestion. To
> be used by the final commit in this series and retransmits_timed_out().
> 
> Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>


Signed-off-by: Eric Dumazet <edumazet@google.com>


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

end of thread, other threads:[~2018-07-19 13:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-19  1:14 [PATCH V4 net-next 2/3] tcp: Add tcp_retransmit_stamp() helper routine Jon Maxwell
2018-07-19  9:31 ` Sergei Shtylyov
2018-07-19 13:49 ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).