18 #ifndef _VNET_DEVICES_VIRTIO_VIRTIO_BUFFERING_H_ 19 #define _VNET_DEVICES_VIRTIO_VIRTIO_BUFFERING_H_ 21 #define VIRTIO_BUFFERING_DEFAULT_SIZE 1024 22 #define VIRTIO_BUFFERING_TIMEOUT 1e-5 80 buffering->
size, n_buffers);
164 mask = buffering->
size - 1;
170 buffering->
back = (buffering->
back + 1) & mask;
187 buffering->
front = (buffering->
front + 1) & mask;
200 buffering->
back = (buffering->
back - 1) & mask;
238 s =
format (s,
"packet-buffering: enable\n");
240 s =
format (s,
"packet-buffering: disable\n");
243 "%Usize %u n_buffers %u front %u back %u",
static_always_inline u8 virtio_vring_buffering_is_full(virtio_vring_buffering_t *buffering)
static_always_inline u16 virtio_vring_n_buffers(virtio_vring_buffering_t *buffering)
#define VIRTIO_BUFFERING_DEFAULT_SIZE
static_always_inline u8 virtio_vring_buffering_is_timeout(vlib_main_t *vm, virtio_vring_buffering_t *buffering)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
static_always_inline u32 virtio_vring_buffering_read_from_front(virtio_vring_buffering_t *buffering)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static_always_inline void virtio_vring_buffering_set_timeout(vlib_main_t *vm, virtio_vring_buffering_t *buffering, f64 timeout_expire)
#define static_always_inline
description fragment has unexpected format
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
#define clib_error_return(e, args...)
static_always_inline void virtio_vring_buffering_buffers_free(vlib_main_t *vm, virtio_vring_buffering_t *buffering)
static_always_inline u32 virtio_vring_buffering_read_from_back(virtio_vring_buffering_t *buffering)
static void vlib_buffer_free_from_ring(vlib_main_t *vm, u32 *ring, u32 start, u32 ring_size, u32 n_buffers)
Free buffers from ring.
static_always_inline u8 virtio_vring_buffering_is_enable(virtio_vring_buffering_t *buffering)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
#define VIRTIO_BUFFERING_TIMEOUT
static_always_inline void virtio_vring_buffering_schedule_node_on_dispatcher(vlib_main_t *vm, virtio_vring_buffering_t *buffering)
static void clib_mem_free(void *p)
static void * clib_mem_alloc(uword size)
static_always_inline u8 virtio_vring_buffering_is_empty(virtio_vring_buffering_t *buffering)
static uword is_pow2(uword x)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static_always_inline u16 virtio_vring_buffering_store_packets(virtio_vring_buffering_t *buffering, u32 *bi, u16 n_store)
static_always_inline clib_error_t * virtio_vring_buffering_init(virtio_vring_buffering_t **buffering, u32 node_index, u16 size)
static_always_inline u8 * virtio_vring_buffering_format(u8 *s, va_list *args)
static_always_inline void virtio_vring_buffering_set_is_enable(virtio_vring_buffering_t *buffering, u8 is_enable)
#define CLIB_CACHE_LINE_BYTES
static_always_inline void virtio_vring_buffering_free(vlib_main_t *vm, virtio_vring_buffering_t *buffering)