From: "David S. Miller" <davem@davemloft.net>
To: netdev@oss.sgi.com
Cc: herbert@gondor.apana.org.au, jheffner@psc.edu
Subject: [PATCH 2/9]: TCP: The Road to Super TSO
Date: Mon, 06 Jun 2005 21:17:08 -0700 (PDT) [thread overview]
Message-ID: <20050606.211708.63132555.davem@davemloft.net> (raw)
In-Reply-To: <20050606.210846.07641049.davem@davemloft.net>
[TCP]: Fix quick-ack decrementing with TSO.
On each packet output, we call tcp_dec_quickack_mode()
if the ACK flag is set. It drops tp->ack.quick until
it hits zero, at which time we deflate the ATO value.
When doing TSO, we are emitting multiple packets with
ACK set, so we should decrement tp->ack.quick that many
segments.
Note that, unlike this case, tcp_enter_cwr() should not
take the tcp_skb_pcount(skb) into consideration. That
function, one time, readjusts tp->snd_cwnd and moves
into TCP_CA_CWR state.
Signed-off-by: David S. Miller <davem@davemloft.net>
00cb08b2ec091f4b461210026392edeaccf31d9c (from 28f78ef8dcc90a2a26499dab76678bd6813d7793)
diff --git a/include/net/tcp.h b/include/net/tcp.h
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -817,11 +817,16 @@ static inline int tcp_ack_scheduled(stru
return tp->ack.pending&TCP_ACK_SCHED;
}
-static __inline__ void tcp_dec_quickack_mode(struct tcp_sock *tp)
+static __inline__ void tcp_dec_quickack_mode(struct tcp_sock *tp, unsigned int pkts)
{
- if (tp->ack.quick && --tp->ack.quick == 0) {
- /* Leaving quickack mode we deflate ATO. */
- tp->ack.ato = TCP_ATO_MIN;
+ if (tp->ack.quick) {
+ if (pkts >= tp->ack.quick) {
+ tp->ack.quick = 0;
+
+ /* Leaving quickack mode we deflate ATO. */
+ tp->ack.ato = TCP_ATO_MIN;
+ } else
+ tp->ack.quick -= pkts;
}
}
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -141,11 +141,11 @@ static inline void tcp_event_data_sent(s
tp->ack.pingpong = 1;
}
-static __inline__ void tcp_event_ack_sent(struct sock *sk)
+static __inline__ void tcp_event_ack_sent(struct sock *sk, unsigned int pkts)
{
struct tcp_sock *tp = tcp_sk(sk);
- tcp_dec_quickack_mode(tp);
+ tcp_dec_quickack_mode(tp, pkts);
tcp_clear_xmit_timer(sk, TCP_TIME_DACK);
}
@@ -361,7 +361,7 @@ static int tcp_transmit_skb(struct sock
tp->af_specific->send_check(sk, th, skb->len, skb);
if (tcb->flags & TCPCB_FLAG_ACK)
- tcp_event_ack_sent(sk);
+ tcp_event_ack_sent(sk, tcp_skb_pcount(skb));
if (skb->len != tcp_header_size)
tcp_event_data_sent(tp, skb, sk);
next prev parent reply other threads:[~2005-06-07 4:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-07 4:08 [PATCH 0/9]: TCP: The Road to Super TSO David S. Miller
2005-06-07 4:16 ` [PATCH 1/9]: " David S. Miller
2005-06-07 4:17 ` David S. Miller [this message]
2005-06-07 4:17 ` [PATCH 3/9]: " David S. Miller
2005-06-07 4:18 ` [PATCH 4/9]: " David S. Miller
2005-06-07 4:19 ` [PATCH 5/9]: " David S. Miller
2005-06-07 4:20 ` [PATCH 6/9]: " David S. Miller
2005-06-07 4:21 ` [PATCH 7/9]: " David S. Miller
2005-06-07 4:22 ` [PATCH 8/9]: " David S. Miller
2005-06-07 4:23 ` [PATCH 9/9]: " David S. Miller
2005-06-07 4:56 ` [PATCH 0/9]: " Stephen Hemminger
2005-06-07 5:51 ` David S. Miller
2005-06-08 21:40 ` John Heffner
2005-06-08 21:49 ` David S. Miller
2005-06-08 22:10 ` Herbert Xu
2005-06-09 4:55 ` Leonid Grossman
2005-06-08 22:19 ` Leonid Grossman
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=20050606.211708.63132555.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jheffner@psc.edu \
--cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).