Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: skbuff: update and rename __kfree_skb_defer()

__kfree_skb_defer() uses the old naming where "defer" meant
slab bulk free/alloc APIs. In the meantime we also made
__kfree_skb_defer() feed the per-NAPI skb cache, which
implies bulk APIs. So take away the 'defer' and add 'napi'.

While at it add a drop reason. This only matters on the
tx_action path, if the skb has a frag_list. But getting
rid of a SKB_DROP_REASON_NOT_SPECIFIED seems like a net
benefit so why not.

Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Link: https://lore.kernel.org/r/20230420020005.815854-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+6 -5
+1 -1
include/linux/skbuff.h
··· 3253 3253 void napi_consume_skb(struct sk_buff *skb, int budget); 3254 3254 3255 3255 void napi_skb_free_stolen_head(struct sk_buff *skb); 3256 - void __kfree_skb_defer(struct sk_buff *skb); 3256 + void __napi_kfree_skb(struct sk_buff *skb, enum skb_drop_reason reason); 3257 3257 3258 3258 /** 3259 3259 * __dev_alloc_pages - allocate page for network Rx
+2 -1
net/core/dev.c
··· 5040 5040 if (skb->fclone != SKB_FCLONE_UNAVAILABLE) 5041 5041 __kfree_skb(skb); 5042 5042 else 5043 - __kfree_skb_defer(skb); 5043 + __napi_kfree_skb(skb, 5044 + get_kfree_skb_cb(skb)->reason); 5044 5045 } 5045 5046 } 5046 5047
+1 -1
net/core/gro.c
··· 633 633 else if (skb->fclone != SKB_FCLONE_UNAVAILABLE) 634 634 __kfree_skb(skb); 635 635 else 636 - __kfree_skb_defer(skb); 636 + __napi_kfree_skb(skb, SKB_CONSUMED); 637 637 break; 638 638 639 639 case GRO_HELD:
+2 -2
net/core/skbuff.c
··· 1226 1226 } 1227 1227 } 1228 1228 1229 - void __kfree_skb_defer(struct sk_buff *skb) 1229 + void __napi_kfree_skb(struct sk_buff *skb, enum skb_drop_reason reason) 1230 1230 { 1231 - skb_release_all(skb, SKB_DROP_REASON_NOT_SPECIFIED, true); 1231 + skb_release_all(skb, reason, true); 1232 1232 napi_skb_cache_put(skb); 1233 1233 } 1234 1234