All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH net-next] Squash-to: mptcp: move page frag allocation in mptcp_sendmsg()
@ 2020-10-05  9:00 Paolo Abeni
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Abeni @ 2020-10-05  9:00 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

This, as suggested by Florian, avoid probe coalescing, which
will hit a later WARN_ON_ONCE() and will cause stream corruption.

Additionally bail early when the MPTCP win is closed an no
probe.

Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
 net/mptcp/protocol.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 6b5a8f8d2175..29be694c1d94 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -985,7 +985,9 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
 
 	/* Zero window and all data acked? Probe. */
 	avail_size = mptcp_check_allowed_size(msk, data_seq, avail_size);
-	if (avail_size == 0 && atomic64_read(&msk->snd_una) == msk->snd_nxt) {
+	if (avail_size == 0) {
+		if (skb || atomic64_read(&msk->snd_una) != msk->snd_nxt)
+			return 0;
 		zero_window_probe = true;
 		data_seq = atomic64_read(&msk->snd_una) - 1;
 		avail_size = 1;
-- 
2.26.2

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

* [MPTCP] [PATCH net-next] Squash-to: "mptcp: move page frag allocation in mptcp_sendmsg()"
@ 2020-10-21 16:45 Paolo Abeni
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Abeni @ 2020-10-21 16:45 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1437 bytes --]

better conflict resolution for a recent rebase

Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
 net/mptcp/protocol.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 897c0c1d2888..975a3243d55c 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -978,8 +978,8 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
 	struct mptcp_ext *mpext = NULL;
 	struct sk_buff *skb, *tail;
 	bool can_collapse = false;
-	int avail_size, ret;
-	size_t psize;
+	int avail_size;
+	size_t ret;
 
 	pr_debug("msk=%p ssk=%p sending dfrag at seq=%lld len=%d already sent=%d",
 		 msk, ssk, dfrag->data_seq, dfrag->data_len, info->sent);
@@ -1018,15 +1018,13 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
 			 info->limit > dfrag->data_len))
 		return 0;
 
-	psize = min_t(size_t, info->limit - info->sent, avail_size);
-
-	tail = tcp_build_frag(ssk, psize, info->flags, dfrag->page,
-			      dfrag->offset + info->sent, &psize);
+	ret = info->limit - info->sent;
+	tail = tcp_build_frag(ssk, avail_size, info->flags, dfrag->page,
+			      dfrag->offset + info->sent, &ret);
 	if (!tail) {
 		tcp_remove_empty_skb(sk, tcp_write_queue_tail(ssk));
 		return -ENOMEM;
 	}
-	ret = psize;
 
 	/* if the tail skb is still the cached one, collapsing really happened.
 	 */
-- 
2.26.2

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

end of thread, other threads:[~2020-10-21 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05  9:00 [MPTCP] [PATCH net-next] Squash-to: mptcp: move page frag allocation in mptcp_sendmsg() Paolo Abeni
2020-10-21 16:45 [MPTCP] [PATCH net-next] Squash-to: "mptcp: move page frag allocation in mptcp_sendmsg()" Paolo Abeni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.