MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-net 1/2] mptcp: fix bad RCVPRUNED mib accounting
@ 2024-07-25 15:53 Paolo Abeni
  2024-07-25 15:53 ` [PATCH mptcp-net 2/2] mptcp: fix duplicate data handling Paolo Abeni
  2024-07-26  0:39 ` [PATCH mptcp-net 1/2] mptcp: fix bad RCVPRUNED mib accounting Mat Martineau
  0 siblings, 2 replies; 6+ messages in thread
From: Paolo Abeni @ 2024-07-25 15:53 UTC (permalink / raw)
  To: mptcp

Since its introduction, the mentioned MIB accounted for the wrong
event: wake-up being skipped as not-needed on some edge condition
instead of incoming skb being dropped after landing in the (subflow)
receive queue.

Move the increment in the correct location.

Fixes: ce599c516386 ("mptcp: properly account bulk freed memory")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/protocol.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b3a48d97f009..13777c35496c 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -350,8 +350,10 @@ static bool __mptcp_move_skb(struct mptcp_sock *msk, struct sock *ssk,
 	skb_orphan(skb);
 
 	/* try to fetch required memory from subflow */
-	if (!mptcp_rmem_schedule(sk, ssk, skb->truesize))
+	if (!mptcp_rmem_schedule(sk, ssk, skb->truesize)) {
+		MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RCVPRUNED);
 		goto drop;
+	}
 
 	has_rxtstamp = TCP_SKB_CB(skb)->has_rxtstamp;
 
@@ -844,10 +846,8 @@ void mptcp_data_ready(struct sock *sk, struct sock *ssk)
 		sk_rbuf = ssk_rbuf;
 
 	/* over limit? can't append more skbs to msk, Also, no need to wake-up*/
-	if (__mptcp_rmem(sk) > sk_rbuf) {
-		MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RCVPRUNED);
+	if (__mptcp_rmem(sk) > sk_rbuf)
 		return;
-	}
 
 	/* Wake-up the reader only for in-sequence data */
 	mptcp_data_lock(sk);
-- 
2.45.2


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

end of thread, other threads:[~2024-07-26 10:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 15:53 [PATCH mptcp-net 1/2] mptcp: fix bad RCVPRUNED mib accounting Paolo Abeni
2024-07-25 15:53 ` [PATCH mptcp-net 2/2] mptcp: fix duplicate data handling Paolo Abeni
2024-07-26  0:42   ` Mat Martineau
2024-07-26 10:33     ` Matthieu Baerts
2024-07-26  9:23   ` MPTCP CI
2024-07-26  0:39 ` [PATCH mptcp-net 1/2] mptcp: fix bad RCVPRUNED mib accounting Mat Martineau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox