]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: skbuff: update and rename __kfree_skb_defer()
authorJakub Kicinski <kuba@kernel.org>
Thu, 20 Apr 2023 02:00:05 +0000 (19:00 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Apr 2023 02:25:08 +0000 (19:25 -0700)
__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>
include/linux/skbuff.h
net/core/dev.c
net/core/gro.c
net/core/skbuff.c

index db5973559042ef5a0f6d9f2f980f65408d1ed5db..03aa7ed076f0f0528b56099e95a910c0fe29a5f2 100644 (file)
@@ -3253,7 +3253,7 @@ static inline struct sk_buff *napi_alloc_skb(struct napi_struct *napi,
 void napi_consume_skb(struct sk_buff *skb, int budget);
 
 void napi_skb_free_stolen_head(struct sk_buff *skb);
-void __kfree_skb_defer(struct sk_buff *skb);
+void __napi_kfree_skb(struct sk_buff *skb, enum skb_drop_reason reason);
 
 /**
  * __dev_alloc_pages - allocate page for network Rx
index 3fc4dba71f9dd250c59c0a070566791f0cd27ec4..1551aabac3437938566813363d748ac639fb0075 100644 (file)
@@ -5040,7 +5040,8 @@ static __latent_entropy void net_tx_action(struct softirq_action *h)
                        if (skb->fclone != SKB_FCLONE_UNAVAILABLE)
                                __kfree_skb(skb);
                        else
-                               __kfree_skb_defer(skb);
+                               __napi_kfree_skb(skb,
+                                                get_kfree_skb_cb(skb)->reason);
                }
        }
 
index a606705a08595ce948f24e89d0c33f59948b5c07..2d84165cb4f1dedbd711f519925885ba7da02709 100644 (file)
@@ -633,7 +633,7 @@ static gro_result_t napi_skb_finish(struct napi_struct *napi,
                else if (skb->fclone != SKB_FCLONE_UNAVAILABLE)
                        __kfree_skb(skb);
                else
-                       __kfree_skb_defer(skb);
+                       __napi_kfree_skb(skb, SKB_CONSUMED);
                break;
 
        case GRO_HELD:
index 768f9d04911fb16a40e057aec7bfa2381a40d7a7..8764653bede7f4692554997d96d29cbbe64f5cb8 100644 (file)
@@ -1226,9 +1226,9 @@ static void napi_skb_cache_put(struct sk_buff *skb)
        }
 }
 
-void __kfree_skb_defer(struct sk_buff *skb)
+void __napi_kfree_skb(struct sk_buff *skb, enum skb_drop_reason reason)
 {
-       skb_release_all(skb, SKB_DROP_REASON_NOT_SPECIFIED, true);
+       skb_release_all(skb, reason, true);
        napi_skb_cache_put(skb);
 }