30 return d->
qword[1] & 0x0f;
35 u32 n_packets,
int use_va_dma)
40 u16 *slot, n_desc_left, n_packets_left = n_packets;
51 while (n_packets_left && n_desc_left)
54 if (n_packets_left < 8 || n_desc_left < 4)
69 if (or_flags & VLIB_BUFFER_NEXT_PRESENT)
89 d[0].
qword[1] = ((
u64) b[0]->current_length) << 34 | bits;
90 d[1].
qword[1] = ((
u64) b[1]->current_length) << 34 | bits;
91 d[2].
qword[1] = ((
u64) b[2]->current_length) << 34 | bits;
92 d[3].
qword[1] = ((
u64) b[3]->current_length) << 34 | bits;
103 txq->
bufs[next] = buffers[0];
111 d[0].
qword[1] = (((
u64) b[0]->current_length) << 34) | bits;
123 u16 rs_slot = slot[0] = (next - 1) & mask;
124 d = txq->
descs + rs_slot;
131 return n_packets - n_packets_left;
142 u8 qid = thread_index;
150 n_left = frame->n_vectors;
156 i32 complete_slot = -1;
167 complete_slot = slot[0];
172 if (complete_slot >= 0)
175 mask = txq->
size - 1;
177 n_free = (complete_slot + 1 -
first) & mask;
185 if (ad->flags & AVF_DEVICE_F_VA_DMA)
201 AVF_TX_ERROR_NO_FREE_SLOTS, n_left);
206 return frame->n_vectors - n_left;
static uword vlib_buffer_get_current_pa(vlib_main_t *vm, vlib_buffer_t *b)
static uword vlib_buffer_get_current_va(vlib_buffer_t *b)
static_always_inline u16 avf_tx_enqueue(vlib_main_t *vm, avf_txq_t *txq, u32 *buffers, u32 n_packets, int use_va_dma)
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
#define clib_memcpy_fast(a, b, c)
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
#define static_always_inline
#define vlib_prefetch_buffer_with_index(vm, bi, type)
Prefetch buffer metadata by buffer index The first 64 bytes of buffer contains most header informatio...
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
VNET_DEVICE_CLASS_TX_FN() avf_device_class(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define VNET_DEVICE_CLASS_TX_FN(devclass)
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 heap_elt_t * first(heap_header_t *h)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define clib_ring_deq(ring)
#define clib_ring_get_first(ring)
#define clib_ring_enq(ring)
static_always_inline u8 avf_tx_desc_get_dtyp(avf_tx_desc_t *d)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define CLIB_MEMORY_BARRIER()
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.