]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
skb_array: introduce batch dequeuing
authorJason Wang <jasowang@redhat.com>
Wed, 17 May 2017 04:14:40 +0000 (12:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 May 2017 14:07:40 +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 79850b638bf2830a8c338fdef1cfffc1d4d1bcf2..35226cd4efb0f32afcf38cc4a97441e9524424f0 100644 (file)
@@ -97,21 +97,46 @@ static inline struct sk_buff *skb_array_consume(struct skb_array *a)
        return ptr_ring_consume(&a->ring);
 }
 
+static inline int skb_array_consume_batched(struct skb_array *a,
+                                           struct sk_buff **array, int n)
+{
+       return ptr_ring_consume_batched(&a->ring, (void **)array, n);
+}
+
 static inline struct sk_buff *skb_array_consume_irq(struct skb_array *a)
 {
        return ptr_ring_consume_irq(&a->ring);
 }
 
+static inline int skb_array_consume_batched_irq(struct skb_array *a,
+                                               struct sk_buff **array, int n)
+{
+       return ptr_ring_consume_batched_irq(&a->ring, (void **)array, n);
+}
+
 static inline struct sk_buff *skb_array_consume_any(struct skb_array *a)
 {
        return ptr_ring_consume_any(&a->ring);
 }
 
+static inline int skb_array_consume_batched_any(struct skb_array *a,
+                                               struct sk_buff **array, int n)
+{
+       return ptr_ring_consume_batched_any(&a->ring, (void **)array, n);
+}
+
+
 static inline struct sk_buff *skb_array_consume_bh(struct skb_array *a)
 {
        return ptr_ring_consume_bh(&a->ring);
 }
 
+static inline int skb_array_consume_batched_bh(struct skb_array *a,
+                                              struct sk_buff **array, int n)
+{
+       return ptr_ring_consume_batched_bh(&a->ring, (void **)array, n);
+}
+
 static inline int __skb_array_len_with_tag(struct sk_buff *skb)
 {
        if (likely(skb)) {