summaryrefslogtreecommitdiff
path: root/include/linux/skb_array.h
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2016-06-30 09:45:34 +0300
committerDavid S. Miller <davem@davemloft.net>2016-07-01 12:32:17 +0300
commitbf900b3dbefee49855c17aa09fb4245346a78fb3 (patch)
treebef4e4d436dc3236596c9dd0ed8c80dc76f1e436 /include/linux/skb_array.h
parent59e6ae53248a72d83cec77dd704b6990b2394479 (diff)
downloadlinux-bf900b3dbefee49855c17aa09fb4245346a78fb3.tar.xz
skb_array: add wrappers for resizing
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skb_array.h')
-rw-r--r--include/linux/skb_array.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h
index 2dd0d1e4ee7e..f4dfade428f0 100644
--- a/include/linux/skb_array.h
+++ b/include/linux/skb_array.h
@@ -161,6 +161,15 @@ 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);
}
+static inline int skb_array_resize_multiple(struct skb_array **rings,
+ int nrings, int size, gfp_t gfp)
+{
+ BUILD_BUG_ON(offsetof(struct skb_array, ring));
+ return ptr_ring_resize_multiple((struct ptr_ring **)rings,
+ nrings, size, gfp,
+ __skb_array_destroy_skb);
+}
+
static inline void skb_array_cleanup(struct skb_array *a)
{
ptr_ring_cleanup(&a->ring, __skb_array_destroy_skb);