netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] tcp: Honor the eor bit in tcp_mtu_probe
@ 2018-02-05 15:11 Ilya Lesokhin
  2018-02-05 15:52 ` Eric Dumazet
  2018-02-06 21:29 ` kbuild test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Ilya Lesokhin @ 2018-02-05 15:11 UTC (permalink / raw)
  To: netdev, kafai; +Cc: borisp, Ilya Lesokhin

Avoid SKB coalescing if eor bit is set in one of the relevant
SKBs.

Fixes: c134ecb87817 ("tcp: Make use of MSG_EOR in tcp_sendmsg")
Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
---
 net/ipv4/tcp_output.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index e9f985e42405..c8cc679f1779 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2099,6 +2099,17 @@ static int tcp_mtu_probe(struct sock *sk)
 			return 0;
 	}
 
+	len = probe_size;
+	tcp_for_write_queue_from_safe(skb, next, sk) {
+		if (len <= skb->len)
+			break;
+
+		if (unlikely(TCP_SKB_CB(skb)->eor))
+			return -1;
+
+		len -= skb->len;
+	}
+
 	/* We're allowed to probe.  Build it now. */
 	nskb = sk_stream_alloc_skb(sk, probe_size, GFP_ATOMIC, false);
 	if (!nskb)
-- 
2.15.0.317.g14c63a9

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-06 21:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-05 15:11 [PATCH 1/1] tcp: Honor the eor bit in tcp_mtu_probe Ilya Lesokhin
2018-02-05 15:52 ` Eric Dumazet
2018-02-05 17:10   ` Eric Dumazet
2018-02-06 21:29 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).