From: Jason Wang Date: Wed, 17 May 2017 04:14:38 +0000 (+0800) Subject: skb_array: introduce skb_array_unconsume X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3acb696015a222f4b25c1b5dce4e36b2d4980da6;p=openwrt%2Fstaging%2Fblogic.git skb_array: introduce skb_array_unconsume Signed-off-by: Jason Wang Signed-off-by: David S. Miller --- diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h index f4dfade428f0..79850b638bf2 100644 --- a/include/linux/skb_array.h +++ b/include/linux/skb_array.h @@ -156,6 +156,12 @@ static void __skb_array_destroy_skb(void *ptr) kfree_skb(ptr); } +static inline void skb_array_unconsume(struct skb_array *a, + struct sk_buff **skbs, int n) +{ + ptr_ring_unconsume(&a->ring, (void **)skbs, n, __skb_array_destroy_skb); +} + static inline int skb_array_resize(struct skb_array *a, int size, gfp_t gfp) { return ptr_ring_resize(&a->ring, size, gfp, __skb_array_destroy_skb);