[PATCH mptcp-next v2 01/12] mptcp: leverage skb deferral free

Paolo Abeni posted 12 patches 3 weeks, 1 day ago
There is a newer version of this series
[PATCH mptcp-next v2 01/12] mptcp: leverage skb deferral free
Posted by Paolo Abeni 3 weeks, 1 day ago
Usage of the skb deferral API is straight-forward; with multiple
subflows actives this allow moving part of the received application
load into multiple CPUs.

Also fix a typo in the related comment.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/protocol.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 7933291e991ce..9d95d24781509 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1943,12 +1943,13 @@ static int __mptcp_recvmsg_mskq(struct sock *sk,
 		}
 
 		if (!(flags & MSG_PEEK)) {
-			/* avoid the indirect call, we know the destructor is sock_wfree */
+			/* avoid the indirect call, we know the destructor is sock_rfree */
 			skb->destructor = NULL;
+			skb->sk = NULL;
 			atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
 			sk_mem_uncharge(sk, skb->truesize);
 			__skb_unlink(skb, &sk->sk_receive_queue);
-			__kfree_skb(skb);
+			skb_attempt_defer_free(skb);
 			msk->bytes_consumed += count;
 		}
 
-- 
2.51.0
Re: [PATCH mptcp-next v2 01/12] mptcp: leverage skb deferral free
Posted by Matthieu Baerts 3 weeks ago
Hi Paolo,

On 18/09/2025 19:14, Paolo Abeni wrote:
> Usage of the skb deferral API is straight-forward; with multiple
> subflows actives this allow moving part of the received application
> load into multiple CPUs.
> 
> Also fix a typo in the related comment.

Thank you, it looks good to me!

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-next v2 01/12] mptcp: leverage skb deferral free
Posted by Geliang Tang 3 weeks ago
Hi Paolo,

Thanks for this patch.

On Thu, 2025-09-18 at 19:14 +0200, Paolo Abeni wrote:
> Usage of the skb deferral API is straight-forward; with multiple
> subflows actives this allow moving part of the received application
> load into multiple CPUs.
> 
> Also fix a typo in the related comment.
> 
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>

LGTM!

Reviewed-by: Geliang Tang <geliang@kernel.org>
Tested-by: Geliang Tang <geliang@kernel.org>

Thanks,
-Geliang

> ---
>  net/mptcp/protocol.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 7933291e991ce..9d95d24781509 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -1943,12 +1943,13 @@ static int __mptcp_recvmsg_mskq(struct sock
> *sk,
>  		}
>  
>  		if (!(flags & MSG_PEEK)) {
> -			/* avoid the indirect call, we know the
> destructor is sock_wfree */
> +			/* avoid the indirect call, we know the
> destructor is sock_rfree */
>  			skb->destructor = NULL;
> +			skb->sk = NULL;
>  			atomic_sub(skb->truesize, &sk-
> >sk_rmem_alloc);
>  			sk_mem_uncharge(sk, skb->truesize);
>  			__skb_unlink(skb, &sk->sk_receive_queue);
> -			__kfree_skb(skb);
> +			skb_attempt_defer_free(skb);
>  			msk->bytes_consumed += count;
>  		}
>