Netdev List
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: netdev@vger.kernel.org
Cc: ycheng@google.com, ncardwell@google.com, edumazet@google.com,
	Cong Wang <xiyou.wangcong@gmail.com>
Subject: [Patch net-next 2/3] tcp: make tcp_send_loss_probe() boolean
Date: Tue, 22 Oct 2019 16:10:50 -0700	[thread overview]
Message-ID: <20191022231051.30770-3-xiyou.wangcong@gmail.com> (raw)
In-Reply-To: <20191022231051.30770-1-xiyou.wangcong@gmail.com>

Let tcp_send_loss_probe() return whether a TLP has been
sent or not. This is needed by the folllowing patch.

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 include/net/tcp.h     | 2 +-
 net/ipv4/tcp_output.c | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index ab4eb5eb5d07..0ee5400e751c 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -581,7 +581,7 @@ void tcp_push_one(struct sock *, unsigned int mss_now);
 void __tcp_send_ack(struct sock *sk, u32 rcv_nxt);
 void tcp_send_ack(struct sock *sk);
 void tcp_send_delayed_ack(struct sock *sk);
-void tcp_send_loss_probe(struct sock *sk);
+bool tcp_send_loss_probe(struct sock *sk);
 bool tcp_schedule_loss_probe(struct sock *sk, bool advancing_rto);
 void tcp_skb_collapse_tstamp(struct sk_buff *skb,
 			     const struct sk_buff *next_skb);
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 0488607c5cd3..9822820edca4 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2539,12 +2539,13 @@ static bool skb_still_in_host_queue(const struct sock *sk,
 /* When probe timeout (PTO) fires, try send a new segment if possible, else
  * retransmit the last segment.
  */
-void tcp_send_loss_probe(struct sock *sk)
+bool tcp_send_loss_probe(struct sock *sk)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct sk_buff *skb;
 	int pcount;
 	int mss = tcp_current_mss(sk);
+	bool sent = false;
 
 	skb = tcp_send_head(sk);
 	if (skb && tcp_snd_wnd_test(tp, skb, mss)) {
@@ -2560,7 +2561,7 @@ void tcp_send_loss_probe(struct sock *sk)
 			  "invalid inflight: %u state %u cwnd %u mss %d\n",
 			  tp->packets_out, sk->sk_state, tp->snd_cwnd, mss);
 		inet_csk(sk)->icsk_pending = 0;
-		return;
+		return false;
 	}
 
 	/* At most one outstanding TLP retransmission. */
@@ -2592,11 +2593,13 @@ void tcp_send_loss_probe(struct sock *sk)
 	tp->tlp_high_seq = tp->snd_nxt;
 
 probe_sent:
+	sent = true;
 	NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPLOSSPROBES);
 	/* Reset s.t. tcp_rearm_rto will restart timer from now */
 	inet_csk(sk)->icsk_pending = 0;
 rearm_timer:
 	tcp_rearm_rto(sk);
+	return sent;
 }
 
 /* Push out any pending frames which were held back due to
-- 
2.21.0


  parent reply	other threads:[~2019-10-22 23:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22 23:10 [Patch net-next 0/3] tcp: decouple TLP timer from RTO timer Cong Wang
2019-10-22 23:10 ` [Patch net-next 1/3] tcp: get rid of ICSK_TIME_EARLY_RETRANS Cong Wang
2019-10-22 23:10 ` Cong Wang [this message]
2019-10-22 23:10 ` [Patch net-next 3/3] tcp: decouple TLP timer from RTO timer Cong Wang
2019-10-22 23:24   ` Eric Dumazet
2019-10-23  1:10     ` Cong Wang
2019-10-23  2:15       ` Eric Dumazet
2019-10-23 17:40         ` Cong Wang
2019-10-23 18:14           ` Eric Dumazet
2019-10-23 18:30             ` Cong Wang
2019-10-23 18:55               ` Eric Dumazet
2019-10-28 18:29 ` [Patch net-next 0/3] " David Miller
2019-10-28 18:34   ` Eric Dumazet
2019-10-28 20:13     ` Cong Wang
2019-10-28 20:31       ` Eric Dumazet
2019-10-29  0:49         ` Cong Wang
2019-10-30 21:56 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191022231051.30770-3-xiyou.wangcong@gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=edumazet@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox