aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 80147ba44141..59505ce0c8fd 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -722,8 +722,7 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb)
722static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, 722static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb,
723 unsigned int mss_now) 723 unsigned int mss_now)
724{ 724{
725 if (skb->len <= mss_now || !sk_can_gso(sk) || 725 if (skb->len <= mss_now || !sk_can_gso(sk)) {
726 tcp_urg_mode(tcp_sk(sk))) {
727 /* Avoid the costly divide in the normal 726 /* Avoid the costly divide in the normal
728 * non-TSO case. 727 * non-TSO case.
729 */ 728 */
@@ -1029,10 +1028,6 @@ unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu)
1029 1028
1030/* Compute the current effective MSS, taking SACKs and IP options, 1029/* Compute the current effective MSS, taking SACKs and IP options,
1031 * and even PMTU discovery events into account. 1030 * and even PMTU discovery events into account.
1032 *
1033 * LARGESEND note: !tcp_urg_mode is overkill, only frames up to snd_up
1034 * cannot be large. However, taking into account rare use of URG, this
1035 * is not a big flaw.
1036 */ 1031 */
1037unsigned int tcp_current_mss(struct sock *sk, int large_allowed) 1032unsigned int tcp_current_mss(struct sock *sk, int large_allowed)
1038{ 1033{
@@ -1047,7 +1042,7 @@ unsigned int tcp_current_mss(struct sock *sk, int large_allowed)
1047 1042
1048 mss_now = tp->mss_cache; 1043 mss_now = tp->mss_cache;
1049 1044
1050 if (large_allowed && sk_can_gso(sk) && !tcp_urg_mode(tp)) 1045 if (large_allowed && sk_can_gso(sk))
1051 doing_tso = 1; 1046 doing_tso = 1;
1052 1047
1053 if (dst) { 1048 if (dst) {
@@ -1164,9 +1159,7 @@ static int tcp_init_tso_segs(struct sock *sk, struct sk_buff *skb,
1164{ 1159{
1165 int tso_segs = tcp_skb_pcount(skb); 1160 int tso_segs = tcp_skb_pcount(skb);
1166 1161
1167 if (!tso_segs || 1162 if (!tso_segs || (tso_segs > 1 && tcp_skb_mss(skb) != mss_now)) {
1168 (tso_segs > 1 && (tcp_skb_mss(skb) != mss_now ||
1169 tcp_urg_mode(tcp_sk(sk))))) {
1170 tcp_set_skb_tso_segs(sk, skb, mss_now); 1163 tcp_set_skb_tso_segs(sk, skb, mss_now);
1171 tso_segs = tcp_skb_pcount(skb); 1164 tso_segs = tcp_skb_pcount(skb);
1172 } 1165 }
@@ -1519,6 +1512,10 @@ static int tcp_mtu_probe(struct sock *sk)
1519 * send_head. This happens as incoming acks open up the remote 1512 * send_head. This happens as incoming acks open up the remote
1520 * window for us. 1513 * window for us.
1521 * 1514 *
1515 * LARGESEND note: !tcp_urg_mode is overkill, only frames between
1516 * snd_up-64k-mss .. snd_up cannot be large. However, taking into
1517 * account rare use of URG, this is not a big flaw.
1518 *
1522 * Returns 1, if no segments are in flight and we have queued segments, but 1519 * Returns 1, if no segments are in flight and we have queued segments, but
1523 * cannot send anything now because of SWS or another problem. 1520 * cannot send anything now because of SWS or another problem.
1524 */ 1521 */
@@ -1563,7 +1560,7 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)
1563 } 1560 }
1564 1561
1565 limit = mss_now; 1562 limit = mss_now;
1566 if (tso_segs > 1) 1563 if (tso_segs > 1 && !tcp_urg_mode(tp))
1567 limit = tcp_mss_split_point(sk, skb, mss_now, 1564 limit = tcp_mss_split_point(sk, skb, mss_now,
1568 cwnd_quota); 1565 cwnd_quota);
1569 1566
@@ -1620,6 +1617,7 @@ void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
1620 */ 1617 */
1621void tcp_push_one(struct sock *sk, unsigned int mss_now) 1618void tcp_push_one(struct sock *sk, unsigned int mss_now)
1622{ 1619{
1620 struct tcp_sock *tp = tcp_sk(sk);
1623 struct sk_buff *skb = tcp_send_head(sk); 1621 struct sk_buff *skb = tcp_send_head(sk);
1624 unsigned int tso_segs, cwnd_quota; 1622 unsigned int tso_segs, cwnd_quota;
1625 1623
@@ -1634,7 +1632,7 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now)
1634 BUG_ON(!tso_segs); 1632 BUG_ON(!tso_segs);
1635 1633
1636 limit = mss_now; 1634 limit = mss_now;
1637 if (tso_segs > 1) 1635 if (tso_segs > 1 && !tcp_urg_mode(tp))
1638 limit = tcp_mss_split_point(sk, skb, mss_now, 1636 limit = tcp_mss_split_point(sk, skb, mss_now,
1639 cwnd_quota); 1637 cwnd_quota);
1640 1638