release oob skb in __consume_stateless_skb
PATCH 1/1 release oob skb in __consume_stateless_skb
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.
--- kernel/evl/net/skb.c | 3 +++ net/core/skbuff.c | 2 ++ 2 files changed, 5 insertions(+)
kernel/evl/net/skb.c +3 -0
@@ -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
net/core/skbuff.c +2 -0
@@ -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); }
Signature · 1 line
2.43.0
Philippe Gerum
AppliedQuoted 38 lines · Brandon Ho
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_skbto 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 <[email protected]>--- kernel/evl/net/skb.c | 3 +++ net/core/skbuff.c | 2 ++ 2 files changed, 5 insertions(+)kernel/evl/net/skb.c +3
-0@@ -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 32net/core/skbuff.c +0
-0
net/core/skbuff.c EXPORT_SYMBOL(consume_skb); · line 1652
Quoted 8 lines
net/core/skbuff.c +2
-0@@ -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).
Signature · 1 line
Philippe.