diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 49d043de3476..383cac0ff0ec 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1703,8 +1703,8 @@ static bool tcp_nagle_check(bool partial, const struct tcp_sock *tp, | |||
1703 | /* Return how many segs we'd like on a TSO packet, | 1703 | /* Return how many segs we'd like on a TSO packet, |
1704 | * to send one TSO packet per ms | 1704 | * to send one TSO packet per ms |
1705 | */ | 1705 | */ |
1706 | u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now, | 1706 | static u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now, |
1707 | int min_tso_segs) | 1707 | int min_tso_segs) |
1708 | { | 1708 | { |
1709 | u32 bytes, segs; | 1709 | u32 bytes, segs; |
1710 | 1710 | ||
@@ -1720,7 +1720,6 @@ u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now, | |||
1720 | 1720 | ||
1721 | return segs; | 1721 | return segs; |
1722 | } | 1722 | } |
1723 | EXPORT_SYMBOL(tcp_tso_autosize); | ||
1724 | 1723 | ||
1725 | /* Return the number of segments we want in the skb we are transmitting. | 1724 | /* Return the number of segments we want in the skb we are transmitting. |
1726 | * See if congestion control module wants to decide; otherwise, autosize. | 1725 | * See if congestion control module wants to decide; otherwise, autosize. |
@@ -1728,11 +1727,13 @@ EXPORT_SYMBOL(tcp_tso_autosize); | |||
1728 | static u32 tcp_tso_segs(struct sock *sk, unsigned int mss_now) | 1727 | static u32 tcp_tso_segs(struct sock *sk, unsigned int mss_now) |
1729 | { | 1728 | { |
1730 | const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; | 1729 | 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; | 1730 | u32 min_tso, tso_segs; |
1732 | 1731 | ||
1733 | if (!tso_segs) | 1732 | min_tso = ca_ops->min_tso_segs ? |
1734 | tso_segs = tcp_tso_autosize(sk, mss_now, | 1733 | ca_ops->min_tso_segs(sk) : |
1735 | sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs); | 1734 | sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs; |
1735 | |||
1736 | tso_segs = tcp_tso_autosize(sk, mss_now, min_tso); | ||
1736 | return min_t(u32, tso_segs, sk->sk_gso_max_segs); | 1737 | return min_t(u32, tso_segs, sk->sk_gso_max_segs); |
1737 | } | 1738 | } |
1738 | 1739 | ||