diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index b2bca373f8be..6818042cd8a9 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1730,7 +1730,7 @@ u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now, | |||
1730 | */ | 1730 | */ |
1731 | segs = max_t(u32, bytes / mss_now, min_tso_segs); | 1731 | segs = max_t(u32, bytes / mss_now, min_tso_segs); |
1732 | 1732 | ||
1733 | return min_t(u32, segs, sk->sk_gso_max_segs); | 1733 | return segs; |
1734 | } | 1734 | } |
1735 | EXPORT_SYMBOL(tcp_tso_autosize); | 1735 | EXPORT_SYMBOL(tcp_tso_autosize); |
1736 | 1736 | ||
@@ -1742,9 +1742,10 @@ static u32 tcp_tso_segs(struct sock *sk, unsigned int mss_now) | |||
1742 | const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; | 1742 | const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; |
1743 | u32 tso_segs = ca_ops->tso_segs_goal ? ca_ops->tso_segs_goal(sk) : 0; | 1743 | u32 tso_segs = ca_ops->tso_segs_goal ? ca_ops->tso_segs_goal(sk) : 0; |
1744 | 1744 | ||
1745 | return tso_segs ? : | 1745 | if (!tso_segs) |
1746 | tcp_tso_autosize(sk, mss_now, | 1746 | tso_segs = tcp_tso_autosize(sk, mss_now, |
1747 | sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs); | 1747 | sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs); |
1748 | return min_t(u32, tso_segs, sk->sk_gso_max_segs); | ||
1748 | } | 1749 | } |
1749 | 1750 | ||
1750 | /* Returns the portion of skb which can be sent right away */ | 1751 | /* Returns the portion of skb which can be sent right away */ |