skb_array: introduce skb_array_unconsume
authorJason Wang <jasowang@redhat.com>
Wed, 17 May 2017 04:14:38 +0000 (12:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 May 2017 14:07:39 +0000 (10:07 -0400)
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skb_array.h

index f4dfade428f0c85f28956476512f28aa74328b08..79850b638bf2830a8c338fdef1cfffc1d4d1bcf2 100644 (file)
@@ -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);