tree 6d1d36cafebb126ff3946443e6d03fec60776f5e
parent aa93466bdfd901b926e033801f0b82b3eaa67be2
author David S. Miller <[EMAIL PROTECTED]> Wed, 06 Jul 2005 05:20:27 -0700
committer David S. Miller <[EMAIL PROTECTED]> Wed, 06 Jul 2005 05:20:27 -0700
[TCP]: Fix send-side cpu utiliziation regression.
Only put user data purely to pages when doing TSO.
The extra page allocations cause two problems:
1) Add the overhead of the page allocations themselves.
2) Make us do small user copies when we get to the end
of the TCP socket cache page.
It is still beneficial to purely use pages for TSO,
so we will do it for that case.
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
net/ipv4/tcp.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -756,8 +756,17 @@ static inline int select_size(struct soc
{
int tmp = tp->mss_cache_std;
- if (sk->sk_route_caps & NETIF_F_SG)
- tmp = 0;
+ if (sk->sk_route_caps & NETIF_F_SG) {
+ if (sk->sk_route_caps & NETIF_F_TSO)
+ tmp = 0;
+ else {
+ int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER);
+
+ if (tmp >= pgbreak &&
+ tmp <= pgbreak + (MAX_SKB_FRAGS - 1) * PAGE_SIZE)
+ tmp = pgbreak;
+ }
+ }
return tmp;
}
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html