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 8795d76f987c..49d043de3476 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1718,7 +1718,7 @@ u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now, | |||
1718 | */ | 1718 | */ |
1719 | segs = max_t(u32, bytes / mss_now, min_tso_segs); | 1719 | segs = max_t(u32, bytes / mss_now, min_tso_segs); |
1720 | 1720 | ||
1721 | return min_t(u32, segs, sk->sk_gso_max_segs); | 1721 | return segs; |
1722 | } | 1722 | } |
1723 | EXPORT_SYMBOL(tcp_tso_autosize); | 1723 | EXPORT_SYMBOL(tcp_tso_autosize); |
1724 | 1724 | ||
@@ -1730,9 +1730,10 @@ static u32 tcp_tso_segs(struct sock *sk, unsigned int mss_now) | |||
1730 | const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; | 1730 | const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; |
1731 | u32 tso_segs = ca_ops->tso_segs_goal ? ca_ops->tso_segs_goal(sk) : 0; | 1731 | u32 tso_segs = ca_ops->tso_segs_goal ? ca_ops->tso_segs_goal(sk) : 0; |
1732 | 1732 | ||
1733 | return tso_segs ? : | 1733 | if (!tso_segs) |
1734 | tcp_tso_autosize(sk, mss_now, | 1734 | tso_segs = tcp_tso_autosize(sk, mss_now, |
1735 | sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs); | 1735 | sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs); |
1736 | return min_t(u32, tso_segs, sk->sk_gso_max_segs); | ||
1736 | } | 1737 | } |
1737 | 1738 | ||
1738 | /* Returns the portion of skb which can be sent right away */ | 1739 | /* Returns the portion of skb which can be sent right away */ |