aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-07-30 16:11:42 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-02 09:47:04 -0700
commit09c403dc7c8e73a4f9c553e4d84aef68af25ff65 (patch)
tree0a6bfbdde7aa192140a8b7398e58d3f9f9a7b953 /net/ipv4/tcp.c
parent8a15a4b44f4f3348db373f70103b25a1175ea25b (diff)
downloadkernel_samsung_espresso10-09c403dc7c8e73a4f9c553e4d84aef68af25ff65.tar.gz
kernel_samsung_espresso10-09c403dc7c8e73a4f9c553e4d84aef68af25ff65.tar.bz2
kernel_samsung_espresso10-09c403dc7c8e73a4f9c553e4d84aef68af25ff65.zip
tcp: Apply device TSO segment limit earlier
[ Upstream commit 1485348d2424e1131ea42efc033cbd9366462b01 ] Cache the device gso_max_segs in sock::sk_gso_max_segs and use it to limit the size of TSO skbs. This avoids the need to fall back to software GSO for local TCP senders. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index b6ec23c7ffc..e57df66affc 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -739,7 +739,9 @@ static unsigned int tcp_xmit_size_goal(struct sock *sk, u32 mss_now,
old_size_goal + mss_now > xmit_size_goal)) {
xmit_size_goal = old_size_goal;
} else {
- tp->xmit_size_goal_segs = xmit_size_goal / mss_now;
+ tp->xmit_size_goal_segs =
+ min_t(u16, xmit_size_goal / mss_now,
+ sk->sk_gso_max_segs);
xmit_size_goal = tp->xmit_size_goal_segs * mss_now;
}
}