diff mbox series

[net-next] mptcp: don't skip needed ack

Message ID 515e80a174ee9bad5e2c6a8338d9362eb43d39b7.1601894086.git.pabeni@redhat.com
State New
Headers show
Series [net-next] mptcp: don't skip needed ack | expand

Commit Message

Paolo Abeni Oct. 5, 2020, 10:36 a.m. UTC
Currently we skip calling tcp_cleanup_rbuf() when packets
are moved into the OoO queue or simply dropped. In both
cases we still increment tp->copied_seq, and we should
ask the TCP stack to check for ack.

Fixes: c76c6956566f ("mptcp: call tcp_cleanup_rbuf on subflows")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/protocol.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Mat Martineau Oct. 5, 2020, 9:59 p.m. UTC | #1
On Mon, 5 Oct 2020, Paolo Abeni wrote:

> Currently we skip calling tcp_cleanup_rbuf() when packets

> are moved into the OoO queue or simply dropped. In both

> cases we still increment tp->copied_seq, and we should

> ask the TCP stack to check for ack.

>

> Fixes: c76c6956566f ("mptcp: call tcp_cleanup_rbuf on subflows")

> Signed-off-by: Paolo Abeni <pabeni@redhat.com>

> ---

> net/mptcp/protocol.c | 6 ++++--

> 1 file changed, 4 insertions(+), 2 deletions(-)


Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>


--
Mat Martineau
Intel
David Miller Oct. 6, 2020, 1:08 p.m. UTC | #2
From: Paolo Abeni <pabeni@redhat.com>

Date: Mon,  5 Oct 2020 12:36:44 +0200

> Currently we skip calling tcp_cleanup_rbuf() when packets

> are moved into the OoO queue or simply dropped. In both

> cases we still increment tp->copied_seq, and we should

> ask the TCP stack to check for ack.

> 

> Fixes: c76c6956566f ("mptcp: call tcp_cleanup_rbuf on subflows")

> Signed-off-by: Paolo Abeni <pabeni@redhat.com>


Applied.
diff mbox series

Patch

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 34c037731f35..f483eab0081a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -454,10 +454,12 @@  static bool __mptcp_move_skbs_from_subflow(struct mptcp_sock *msk,
 	unsigned int moved = 0;
 	bool more_data_avail;
 	struct tcp_sock *tp;
+	u32 old_copied_seq;
 	bool done = false;
 
 	pr_debug("msk=%p ssk=%p", msk, ssk);
 	tp = tcp_sk(ssk);
+	old_copied_seq = tp->copied_seq;
 	do {
 		u32 map_remaining, offset;
 		u32 seq = tp->copied_seq;
@@ -516,8 +518,8 @@  static bool __mptcp_move_skbs_from_subflow(struct mptcp_sock *msk,
 	} while (more_data_avail);
 
 	*bytes += moved;
-	if (moved)
-		tcp_cleanup_rbuf(ssk, moved);
+	if (tp->copied_seq != old_copied_seq)
+		tcp_cleanup_rbuf(ssk, 1);
 
 	return done;
 }