Skip to content

Commit 0a567c2

Browse files
author
Paolo Abeni
committed
mptcp: fix bad RCVPRUNED mib accounting
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: ce599c5 ("mptcp: properly account bulk freed memory") Cc: [email protected] Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 2b4a32d commit 0a567c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/mptcp/protocol.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,10 @@ static bool __mptcp_move_skb(struct mptcp_sock *msk, struct sock *ssk,
350350
skb_orphan(skb);
351351

352352
/* try to fetch required memory from subflow */
353-
if (!mptcp_rmem_schedule(sk, ssk, skb->truesize))
353+
if (!mptcp_rmem_schedule(sk, ssk, skb->truesize)) {
354+
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RCVPRUNED);
354355
goto drop;
356+
}
355357

356358
has_rxtstamp = TCP_SKB_CB(skb)->has_rxtstamp;
357359

@@ -844,10 +846,8 @@ void mptcp_data_ready(struct sock *sk, struct sock *ssk)
844846
sk_rbuf = ssk_rbuf;
845847

846848
/* over limit? can't append more skbs to msk, Also, no need to wake-up*/
847-
if (__mptcp_rmem(sk) > sk_rbuf) {
848-
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RCVPRUNED);
849+
if (__mptcp_rmem(sk) > sk_rbuf)
849850
return;
850-
}
851851

852852
/* Wake-up the reader only for in-sequence data */
853853
mptcp_data_lock(sk);

0 commit comments

Comments
 (0)