mptcp: fix bad RCVPRUNED mib accounting

commit 0a567c2a10033bf04ed618368d179bce6977984b upstream.

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: ce599c5163 ("mptcp: properly account bulk freed memory")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Paolo Abeni 2024-07-31 12:10:14 +02:00 committed by Greg Kroah-Hartman
parent 6721cbaa04
commit 19bf32929b

View file

@ -352,8 +352,10 @@ static bool __mptcp_move_skb(struct mptcp_sock *msk, struct sock *ssk,
skb_orphan(skb); skb_orphan(skb);
/* try to fetch required memory from subflow */ /* 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; goto drop;
}
has_rxtstamp = TCP_SKB_CB(skb)->has_rxtstamp; has_rxtstamp = TCP_SKB_CB(skb)->has_rxtstamp;
@ -842,10 +844,8 @@ void mptcp_data_ready(struct sock *sk, struct sock *ssk)
sk_rbuf = ssk_rbuf; sk_rbuf = ssk_rbuf;
/* over limit? can't append more skbs to msk, Also, no need to wake-up*/ /* over limit? can't append more skbs to msk, Also, no need to wake-up*/
if (__mptcp_rmem(sk) > sk_rbuf) { if (__mptcp_rmem(sk) > sk_rbuf)
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RCVPRUNED);
return; return;
}
/* Wake-up the reader only for in-sequence data */ /* Wake-up the reader only for in-sequence data */
mptcp_data_lock(sk); mptcp_data_lock(sk);