From: Philippe Gerum <rpm@xenomai.org>
To: Brandon Ho <brandonho667@gmail.com>
Cc: xenomai@lists.linux.dev, Brandon Ho <brho@relativityspace.com>
Subject: Re: [PATCH] release oob skb in __consume_stateless_skb
Date: Fri, 03 Apr 2026 14:53:36 +0200 [thread overview]
Message-ID: <871pgw19yn.fsf@xenomai.org> (raw)
In-Reply-To: <20260331223817.136912-1-brho@relativityspace.com> (Brandon Ho's message of "Tue, 31 Mar 2026 15:37:39 -0700")
Brandon Ho <brandonho667@gmail.com> writes:
> When an oob-enabled driver receives packets, those skbs are allocated
> from oob pools. The evl core may leave some of these packets to the
> regular network stack for handling based on eBPF filter criteria.
> When the regular netstack eventually consumes these skbs via
> __consume_stateless_skb, the current implementation does not release
> them back to their oob pools, causing a resource leak.
>
> This patch adds a call to skb_release_oob() in __consume_stateless_skb
> to properly return oob skbs to their pools before the standard skb
> cleanup occurs.
>
> Target kernel series v6.12.y-cip-evl-rebase.
>
> Signed-off-by: Brandon Ho <brho@relativityspace.com>
> ---
> kernel/evl/net/skb.c | 3 +++
> net/core/skbuff.c | 2 ++
> 2 files changed, 5 insertions(+)
>
> diff --git a/kernel/evl/net/skb.c b/kernel/evl/net/skb.c
> index 8efdca1da..302f79dfd 100644
> --- a/kernel/evl/net/skb.c
> +++ b/kernel/evl/net/skb.c
> @@ -55,6 +55,9 @@
> * -> free_skb_oob(skb)
> * -> dev_kfree_skb(skb)
> * -> consume_skb(skb) [1]
> + * |
> + * __consume_stateless_skb(skb)
> + * -> free_skb_oob(skb)
> */
>
> #define SKB_RECYCLING_THRESHOLD 32
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index e297781da..e08d0bc54 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -1645,6 +1645,8 @@ EXPORT_SYMBOL(consume_skb);
> void __consume_stateless_skb(struct sk_buff *skb)
> {
> trace_consume_skb(skb, __builtin_return_address(0));
> + if (skb_release_oob(skb))
> + return;
> skb_release_data(skb, SKB_CONSUMED);
> kfree_skbmem(skb);
> }
Merged, thanks (split between dovetail and evl trees).
--
Philippe.
prev parent reply other threads:[~2026-04-03 12:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 22:37 [PATCH] release oob skb in __consume_stateless_skb Brandon Ho
2026-04-03 12:53 ` Philippe Gerum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871pgw19yn.fsf@xenomai.org \
--to=rpm@xenomai.org \
--cc=brandonho667@gmail.com \
--cc=brho@relativityspace.com \
--cc=xenomai@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox