linux/include/linux/skb_array.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *	Definitions for the 'struct skb_array' datastructure.
 *
 *	Author:
 *		Michael S. Tsirkin <[email protected]>
 *
 *	Copyright (C) 2016 Red Hat, Inc.
 *
 *	Limited-size FIFO of skbs. Can be used more or less whenever
 *	sk_buff_head can be used, except you need to know the queue size in
 *	advance.
 *	Implemented as a type-safe wrapper around ptr_ring.
 */

#ifndef _LINUX_SKB_ARRAY_H
#define _LINUX_SKB_ARRAY_H

#ifdef __KERNEL__
#include <linux/ptr_ring.h>
#include <linux/skbuff.h>
#include <linux/if_vlan.h>
#endif

struct skb_array {};

/* Might be slightly faster than skb_array_full below, but callers invoking
 * this in a loop must use a compiler barrier, for example cpu_relax().
 */
static inline bool __skb_array_full(struct skb_array *a)
{}

static inline bool skb_array_full(struct skb_array *a)
{}

static inline int skb_array_produce(struct skb_array *a, struct sk_buff *skb)
{}

static inline int skb_array_produce_irq(struct skb_array *a, struct sk_buff *skb)
{}

static inline int skb_array_produce_bh(struct skb_array *a, struct sk_buff *skb)
{}

static inline int skb_array_produce_any(struct skb_array *a, struct sk_buff *skb)
{}

/* Might be slightly faster than skb_array_empty below, but only safe if the
 * array is never resized. Also, callers invoking this in a loop must take care
 * to use a compiler barrier, for example cpu_relax().
 */
static inline bool __skb_array_empty(struct skb_array *a)
{}

static inline struct sk_buff *__skb_array_peek(struct skb_array *a)
{}

static inline bool skb_array_empty(struct skb_array *a)
{}

static inline bool skb_array_empty_bh(struct skb_array *a)
{}

static inline bool skb_array_empty_irq(struct skb_array *a)
{}

static inline bool skb_array_empty_any(struct skb_array *a)
{}

static inline struct sk_buff *__skb_array_consume(struct skb_array *a)
{}

static inline struct sk_buff *skb_array_consume(struct skb_array *a)
{}

static inline int skb_array_consume_batched(struct skb_array *a,
					    struct sk_buff **array, int n)
{}

static inline struct sk_buff *skb_array_consume_irq(struct skb_array *a)
{}

static inline int skb_array_consume_batched_irq(struct skb_array *a,
						struct sk_buff **array, int n)
{}

static inline struct sk_buff *skb_array_consume_any(struct skb_array *a)
{}

static inline int skb_array_consume_batched_any(struct skb_array *a,
						struct sk_buff **array, int n)
{}


static inline struct sk_buff *skb_array_consume_bh(struct skb_array *a)
{}

static inline int skb_array_consume_batched_bh(struct skb_array *a,
					       struct sk_buff **array, int n)
{}

static inline int __skb_array_len_with_tag(struct sk_buff *skb)
{}

static inline int skb_array_peek_len(struct skb_array *a)
{}

static inline int skb_array_peek_len_irq(struct skb_array *a)
{}

static inline int skb_array_peek_len_bh(struct skb_array *a)
{}

static inline int skb_array_peek_len_any(struct skb_array *a)
{}

static inline int skb_array_init_noprof(struct skb_array *a, int size, gfp_t gfp)
{}
#define skb_array_init(...)

static void __skb_array_destroy_skb(void *ptr)
{}

static inline void skb_array_unconsume(struct skb_array *a,
				       struct sk_buff **skbs, int n)
{}

static inline int skb_array_resize(struct skb_array *a, int size, gfp_t gfp)
{}

static inline int skb_array_resize_multiple_noprof(struct skb_array **rings,
						   int nrings, unsigned int size,
						   gfp_t gfp)
{}
#define skb_array_resize_multiple(...)

static inline void skb_array_cleanup(struct skb_array *a)
{}

#endif /* _LINUX_SKB_ARRAY_H  */