* [PATCH] tcp: do not scale TSO segment size with reordering degree
@ 2011-11-22 3:15 Neal Cardwell
2011-11-29 6:20 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Neal Cardwell @ 2011-11-22 3:15 UTC (permalink / raw)
To: David Miller
Cc: netdev, ilpo.jarvinen, Nandita Dukkipati, Yuchung Cheng,
Jerry Chu, Tom Herbert, Neal Cardwell
Since 2005 (c1b4a7e69576d65efc31a8cea0714173c2841244)
tcp_tso_should_defer has been using tcp_max_burst() as a target limit
for deciding how large to make outgoing TSO packets when not using
sysctl_tcp_tso_win_divisor. But since 2008
(dd9e0dda66ba38a2ddd1405ac279894260dc5c36) tcp_max_burst() returns the
reordering degree. We should not have tcp_tso_should_defer attempt to
build larger segments just because there is more reordering. This
commit splits the notion of deferral size used in TSO from the notion
of burst size used in cwnd moderation, and returns the TSO deferral
limit to its original value.
Signed-off-by: Neal Cardwell <ncardwell@google.com>
---
include/net/tcp.h | 8 ++++++++
net/ipv4/tcp_cong.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 113160b..87e3c80 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -834,6 +834,14 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk)
extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
extern __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst);
+/* The maximum number of MSS of available cwnd for which TSO defers
+ * sending if not using sysctl_tcp_tso_win_divisor.
+ */
+static inline __u32 tcp_max_tso_deferred_mss(const struct tcp_sock *tp)
+{
+ return 3;
+}
+
/* Slow start with delack produces 3 packets of burst, so that
* it is safe "de facto". This will be the default - same as
* the default reordering threshold - but if reordering increases,
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 850c737..fc6d475 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -292,7 +292,7 @@ int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight)
left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd &&
left * tp->mss_cache < sk->sk_gso_max_size)
return 1;
- return left <= tcp_max_burst(tp);
+ return left <= tcp_max_tso_deferred_mss(tp);
}
EXPORT_SYMBOL_GPL(tcp_is_cwnd_limited);
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 63170e2..58f69ac 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1581,7 +1581,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb)
* frame, so if we have space for more than 3 frames
* then send now.
*/
- if (limit > tcp_max_burst(tp) * tp->mss_cache)
+ if (limit > tcp_max_tso_deferred_mss(tp) * tp->mss_cache)
goto send_now;
}
--
1.7.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tcp: do not scale TSO segment size with reordering degree
2011-11-22 3:15 [PATCH] tcp: do not scale TSO segment size with reordering degree Neal Cardwell
@ 2011-11-29 6:20 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-11-29 6:20 UTC (permalink / raw)
To: ncardwell; +Cc: netdev, ilpo.jarvinen, nanditad, ycheng, hkchu, therbert
From: Neal Cardwell <ncardwell@google.com>
Date: Mon, 21 Nov 2011 22:15:14 -0500
> Since 2005 (c1b4a7e69576d65efc31a8cea0714173c2841244)
> tcp_tso_should_defer has been using tcp_max_burst() as a target limit
> for deciding how large to make outgoing TSO packets when not using
> sysctl_tcp_tso_win_divisor. But since 2008
> (dd9e0dda66ba38a2ddd1405ac279894260dc5c36) tcp_max_burst() returns the
> reordering degree. We should not have tcp_tso_should_defer attempt to
> build larger segments just because there is more reordering. This
> commit splits the notion of deferral size used in TSO from the notion
> of burst size used in cwnd moderation, and returns the TSO deferral
> limit to its original value.
>
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
Applied to net-next.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-29 6:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22 3:15 [PATCH] tcp: do not scale TSO segment size with reordering degree Neal Cardwell
2011-11-29 6:20 ` David Miller
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).