All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH v2] Squash-to: "mptcp: cleanup mptcp_subflow_discard_data()"
@ 2020-08-27  9:44 Paolo Abeni
  0 siblings, 0 replies; only message in thread
From: Paolo Abeni @ 2020-08-27  9:44 UTC (permalink / raw)
  To: mptcp

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

While discarding old data we also need to flush the
related map, if completed/exausted.

Additionally, use a safer condition to check for to-be-eaten
skbs

Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
v1 -> v2:
 - fix seq check using before - Mat

with this and pending Florian's patches, the kernel survived
the following loop for quite a bit.

while true; do
	./mptcp_connect.sh -d 10 -l 0 -r 0 -e "" -f $((100 * 1024 * 1024)) -m poll
done

I still see poll timeout with both ends not readable - not
investigated yet.
---
 net/mptcp/subflow.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 3585fd63c757..b920aa23c567 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -819,8 +819,10 @@ static void mptcp_subflow_discard_data(struct sock *ssk, struct sk_buff *skb,
 		 subflow->map_subflow_seq);
 	MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DUPDATA);
 	tcp_sk(ssk)->copied_seq += incr;
-	if (incr >= skb->len)
+	if (!before(tcp_sk(ssk)->copied_seq, TCP_SKB_CB(skb)->end_seq))
 		sk_eat_skb(ssk, skb);
+	if (mptcp_subflow_get_map_offset(subflow) >= subflow->map_data_len)
+		subflow->map_valid = 0;
 }
 
 static bool subflow_check_data_avail(struct sock *ssk)
-- 
2.26.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-27  9:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27  9:44 [MPTCP] [PATCH v2] Squash-to: "mptcp: cleanup mptcp_subflow_discard_data()" 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.