Messages in this thread Patch in this message | | | From | menglong8.dong@gmail ... | Subject | [PATCH net-next v2 2/9] net: skb: introduce __skb_queue_purge_reason() | Date | Tue, 17 May 2022 16:10:01 +0800 |
| |
From: Menglong Dong <imagedong@tencent.com>
Introduce __skb_queue_purge_reason() to empty a skb list with drop reason and make __skb_queue_purge() an inline call to it.
Reviewed-by: Jiang Biao <benbjiang@tencent.com> Reviewed-by: Hao Peng <flyingpeng@tencent.com> Signed-off-by: Menglong Dong <imagedong@tencent.com> --- include/linux/skbuff.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index dfc568844df2..e9659a63961a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -3323,18 +3323,24 @@ static inline int skb_orphan_frags_rx(struct sk_buff *skb, gfp_t gfp_mask) } /** - * __skb_queue_purge - empty a list + * __skb_queue_purge_reason - empty a list with specific drop reason * @list: list to empty + * @reason: drop reason * * Delete all buffers on an &sk_buff list. Each buffer is removed from * the list and one reference dropped. This function does not take the * list lock and the caller must hold the relevant locks to use it. */ -static inline void __skb_queue_purge(struct sk_buff_head *list) +static inline void __skb_queue_purge_reason(struct sk_buff_head *list, + enum skb_drop_reason reason) { struct sk_buff *skb; while ((skb = __skb_dequeue(list)) != NULL) - kfree_skb(skb); + kfree_skb_reason(skb, reason); +} +static inline void __skb_queue_purge(struct sk_buff_head *list) +{ + __skb_queue_purge_reason(list, SKB_DROP_REASON_NOT_SPECIFIED); } void skb_queue_purge(struct sk_buff_head *list); -- 2.36.1
| |