|
@@ -1549,7 +1549,8 @@ static bool tcp_nagle_check(bool partial, const struct tcp_sock *tp,
|
|
/* Return how many segs we'd like on a TSO packet,
|
|
/* Return how many segs we'd like on a TSO packet,
|
|
* to send one TSO packet per ms
|
|
* to send one TSO packet per ms
|
|
*/
|
|
*/
|
|
-static u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now)
|
|
|
|
|
|
+u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now,
|
|
|
|
+ int min_tso_segs)
|
|
{
|
|
{
|
|
u32 bytes, segs;
|
|
u32 bytes, segs;
|
|
|
|
|
|
@@ -1561,10 +1562,11 @@ static u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now)
|
|
* This preserves ACK clocking and is consistent
|
|
* This preserves ACK clocking and is consistent
|
|
* with tcp_tso_should_defer() heuristic.
|
|
* with tcp_tso_should_defer() heuristic.
|
|
*/
|
|
*/
|
|
- segs = max_t(u32, bytes / mss_now, sysctl_tcp_min_tso_segs);
|
|
|
|
|
|
+ segs = max_t(u32, bytes / mss_now, min_tso_segs);
|
|
|
|
|
|
return min_t(u32, segs, sk->sk_gso_max_segs);
|
|
return min_t(u32, segs, sk->sk_gso_max_segs);
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL(tcp_tso_autosize);
|
|
|
|
|
|
/* Return the number of segments we want in the skb we are transmitting.
|
|
/* Return the number of segments we want in the skb we are transmitting.
|
|
* See if congestion control module wants to decide; otherwise, autosize.
|
|
* See if congestion control module wants to decide; otherwise, autosize.
|
|
@@ -1574,7 +1576,8 @@ static u32 tcp_tso_segs(struct sock *sk, unsigned int mss_now)
|
|
const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;
|
|
const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;
|
|
u32 tso_segs = ca_ops->tso_segs_goal ? ca_ops->tso_segs_goal(sk) : 0;
|
|
u32 tso_segs = ca_ops->tso_segs_goal ? ca_ops->tso_segs_goal(sk) : 0;
|
|
|
|
|
|
- return tso_segs ? : tcp_tso_autosize(sk, mss_now);
|
|
|
|
|
|
+ return tso_segs ? :
|
|
|
|
+ tcp_tso_autosize(sk, mss_now, sysctl_tcp_min_tso_segs);
|
|
}
|
|
}
|
|
|
|
|
|
/* Returns the portion of skb which can be sent right away */
|
|
/* Returns the portion of skb which can be sent right away */
|