net: skb: introduce the function kfree_skb_list_reason()
authorMenglong Dong <imagedong@tencent.com>
Fri, 4 Mar 2022 06:00:41 +0000 (14:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Mar 2022 12:17:11 +0000 (12:17 +0000)
To report reasons of skb drops, introduce the function
kfree_skb_list_reason() and make kfree_skb_list() an inline call to
it. This function will be used in the next commit in
__dev_xmit_skb().

Signed-off-by: Menglong Dong <imagedong@tencent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/skbuff.c

index 1ffe64616741bcfc62fc29366dd5e98ede2365c1..1f2de153755cd9d0b66931d333d997a226a9537d 100644 (file)
@@ -1202,10 +1202,16 @@ static inline void kfree_skb(struct sk_buff *skb)
 }
 
 void skb_release_head_state(struct sk_buff *skb);
-void kfree_skb_list(struct sk_buff *segs);
+void kfree_skb_list_reason(struct sk_buff *segs,
+                          enum skb_drop_reason reason);
 void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt);
 void skb_tx_error(struct sk_buff *skb);
 
+static inline void kfree_skb_list(struct sk_buff *segs)
+{
+       kfree_skb_list_reason(segs, SKB_DROP_REASON_NOT_SPECIFIED);
+}
+
 #ifdef CONFIG_TRACEPOINTS
 void consume_skb(struct sk_buff *skb);
 #else
index 23f3ba3436617a42351891a54531a6ea6f20809f..10bde7c6db445a876e6ca06e8fc8a33a0008c934 100644 (file)
@@ -777,16 +777,17 @@ void kfree_skb_reason(struct sk_buff *skb, enum skb_drop_reason reason)
 }
 EXPORT_SYMBOL(kfree_skb_reason);
 
-void kfree_skb_list(struct sk_buff *segs)
+void kfree_skb_list_reason(struct sk_buff *segs,
+                          enum skb_drop_reason reason)
 {
        while (segs) {
                struct sk_buff *next = segs->next;
 
-               kfree_skb(segs);
+               kfree_skb_reason(segs, reason);
                segs = next;
        }
 }
-EXPORT_SYMBOL(kfree_skb_list);
+EXPORT_SYMBOL(kfree_skb_list_reason);
 
 /* Dump skb information and contents.
  *