diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 5a7cb4a9c867..5c08ea20a18d 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -510,8 +510,7 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) | |||
510 | 510 | ||
511 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) | 511 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) |
512 | { | 512 | { |
513 | if (skb->len <= mss_now || | 513 | if (skb->len <= mss_now || !sk_can_gso(sk)) { |
514 | !(sk->sk_route_caps & NETIF_F_TSO)) { | ||
515 | /* Avoid the costly divide in the normal | 514 | /* Avoid the costly divide in the normal |
516 | * non-TSO case. | 515 | * non-TSO case. |
517 | */ | 516 | */ |
@@ -525,7 +524,7 @@ static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned | |||
525 | factor /= mss_now; | 524 | factor /= mss_now; |
526 | skb_shinfo(skb)->gso_segs = factor; | 525 | skb_shinfo(skb)->gso_segs = factor; |
527 | skb_shinfo(skb)->gso_size = mss_now; | 526 | skb_shinfo(skb)->gso_size = mss_now; |
528 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; | 527 | skb_shinfo(skb)->gso_type = sk->sk_gso_type; |
529 | } | 528 | } |
530 | } | 529 | } |
531 | 530 | ||
@@ -824,9 +823,7 @@ unsigned int tcp_current_mss(struct sock *sk, int large_allowed) | |||
824 | 823 | ||
825 | mss_now = tp->mss_cache; | 824 | mss_now = tp->mss_cache; |
826 | 825 | ||
827 | if (large_allowed && | 826 | if (large_allowed && sk_can_gso(sk) && !tp->urg_mode) |
828 | (sk->sk_route_caps & NETIF_F_TSO) && | ||
829 | !tp->urg_mode) | ||
830 | doing_tso = 1; | 827 | doing_tso = 1; |
831 | 828 | ||
832 | if (dst) { | 829 | if (dst) { |