diff options
author | Eric Dumazet <edumazet@google.com> | 2023-08-18 12:40:39 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-08-19 17:30:15 +0300 |
commit | 4025d3e73abde4f65f4b04d4b1d8449b00e31473 (patch) | |
tree | 5df10d7dc158df683039b2cf1b1097a3fc2246ee /net/core/skbuff.c | |
parent | 5b0a1414e0b0de1efbeeb14083b9a2f2ddef85a0 (diff) | |
download | linux-4025d3e73abde4f65f4b04d4b1d8449b00e31473.tar.xz |
net: add skb_queue_purge_reason and __skb_queue_purge_reason
skb_queue_purge() and __skb_queue_purge() become wrappers
around the new generic functions.
New SKB_DROP_REASON_QUEUE_PURGE drop reason is added,
but users can start adding more specific reasons.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 9b5bc621daf7..117d36b1fae3 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -3701,20 +3701,23 @@ struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list) EXPORT_SYMBOL(skb_dequeue_tail); /** - * skb_queue_purge - empty a list + * skb_queue_purge_reason - empty a list * @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 takes the list * lock and is atomic with respect to other list locking functions. */ -void skb_queue_purge(struct sk_buff_head *list) +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); } -EXPORT_SYMBOL(skb_queue_purge); +EXPORT_SYMBOL(skb_queue_purge_reason); /** * skb_rbtree_purge - empty a skb rbtree |