netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yuchung Cheng <ycheng@google.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Yuchung Cheng <ycheng@google.com>,
	Neal Cardwell <ncardwell@google.com>,
	Eric Dumazet <edumazet@google.com>
Subject: [PATCH net-next 4/6] tcp: refactor pkts acked accounting
Date: Thu, 14 Jan 2016 15:43:32 -0800	[thread overview]
Message-ID: <1452815014-601-5-git-send-email-ycheng@google.com> (raw)
In-Reply-To: <1452815014-601-1-git-send-email-ycheng@google.com>

A small refactoring that gets number of packets cumulatively acked
from tcp_clean_rtx_queue() directly.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/tcp_input.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e7a8ce7..2d6eaad 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3106,7 +3106,7 @@ static void tcp_ack_tstamp(struct sock *sk, struct sk_buff *skb,
  * arrived at the other end.
  */
 static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
-			       u32 prior_snd_una,
+			       u32 prior_snd_una, int *acked,
 			       struct tcp_sacktag_state *sack)
 {
 	const struct inet_connection_sock *icsk = inet_csk(sk);
@@ -3279,6 +3279,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
 		}
 	}
 #endif
+	*acked = pkts_acked;
 	return flag;
 }
 
@@ -3644,10 +3645,8 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 		goto no_queue;
 
 	/* See if we can take anything off of the retransmit queue. */
-	acked = tp->packets_out;
-	flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una,
+	flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una, &acked,
 				    &sack_state);
-	acked -= tp->packets_out;
 
 	if (tcp_ack_is_dubious(sk, flag)) {
 		is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP));
-- 
2.6.0.rc2.230.g3dd15c0

  parent reply	other threads:[~2016-01-14 23:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 23:43 [PATCH net-next 0/6] tcp: congestion control refactoring Yuchung Cheng
2016-01-14 23:43 ` [PATCH net-next 1/6] tcp: retransmit after recovery processing and congestion control Yuchung Cheng
2016-01-14 23:43 ` [PATCH net-next 2/6] tcp: move cwnd reduction after recovery state procesing Yuchung Cheng
2016-01-14 23:43 ` [PATCH net-next 3/6] tcp: new delivery accounting Yuchung Cheng
2016-01-14 23:43 ` Yuchung Cheng [this message]
2016-01-14 23:43 ` [PATCH net-next 5/6] tcp: make congestioin control more robust against reordering Yuchung Cheng
2016-01-14 23:43 ` [PATCH net-next 6/6] tcp: tcp_cong_control helper Yuchung Cheng
2016-01-15  0:46 ` [PATCH net-next 0/6] tcp: congestion control refactoring Yuchung Cheng
2016-01-15  4:55 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2016-02-02 18:33 Yuchung Cheng
2016-02-02 18:33 ` [PATCH net-next 4/6] tcp: refactor pkts acked accounting Yuchung Cheng

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=1452815014-601-5-git-send-email-ycheng@google.com \
    --to=ycheng@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).