|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
9 #define AF_XDP_TX_RETRIES 5
25 XSK_UNALIGNED_BUF_OFFSET_SHIFT,
"wrong size");
31 compl = xsk_ring_cons__comp_addr (&txq->
cq, idx);
39 #ifdef CLIB_HAVE_VEC256
44 const u32x8
mask = { 0, 2, 4, 6, 1, 3, 5, 7 };
48 *(u32x4u *) (bi + 0) = u32x8_extract_lo (b2);
49 *(u32x4u *) (bi + 4) = u32x8_extract_lo (b3);
77 compl = xsk_ring_cons__comp_addr (&txq->
cq, 0);
83 xsk_ring_cons__release (&txq->
cq,
n_free);
93 xsk_ring_prod__submit (&txq->
tx, n_tx);
95 if (!xsk_ring_prod__needs_wakeup (&txq->
tx))
102 if (xsk_ring_prod__needs_wakeup (&txq->
tx))
104 struct pollfd fd = { .fd = txq->
xsk_fd, .events = POLLIN | POLLOUT };
105 int ret = poll (&fd, 1, 0);
110 AF_XDP_TX_ERROR_SYSCALL_FAILURES, 1);
128 struct xdp_desc *desc;
134 n_tx = xsk_ring_prod__reserve (&txq->
tx, n_tx, &idx);
142 desc = xsk_ring_prod__tx_desc (&txq->
tx, idx);
153 b[0]->current_data) << XSK_UNALIGNED_BUF_OFFSET_SHIFT;
161 b[1]->current_data) << XSK_UNALIGNED_BUF_OFFSET_SHIFT;
169 b[2]->current_data) << XSK_UNALIGNED_BUF_OFFSET_SHIFT;
177 b[3]->current_data) << XSK_UNALIGNED_BUF_OFFSET_SHIFT;
191 b[0]->current_data) << XSK_UNALIGNED_BUF_OFFSET_SHIFT;
202 desc = xsk_ring_prod__tx_desc (&txq->
tx, 0);
226 n_tx =
frame->n_vectors;
247 AF_XDP_TX_ERROR_NO_FREE_SLOTS, n_tx - n);
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
foreach_avx2_vec256i static foreach_avx2_vec256u u32x8 u32x8_permute(u32x8 v, u32x8 idx)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define AF_XDP_TX_RETRIES
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
static uword pointer_to_uword(const void *p)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_get_buffers(vm, from, b, n_left_from)
vlib_main_t vlib_node_runtime_t * node
af_xdp_device_t * devices
vlib_buffer_main_t * buffer_main
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define af_xdp_device_error(dev, fmt,...)
static vlib_buffer_known_state_t vlib_buffer_is_known(vlib_main_t *vm, u32 buffer_index)
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
clib_spinlock_t syscall_lock
#define VNET_DEVICE_CLASS_TX_FN(devclass)
static_always_inline u32 af_xdp_device_output_tx_try(vlib_main_t *vm, const vlib_node_runtime_t *node, af_xdp_device_t *ad, af_xdp_txq_t *txq, u32 n_tx, u32 *bi)
af_xdp_main_t af_xdp_main
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
struct clib_bihash_value offset
template key/value backing page structure
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define static_always_inline
static_always_inline void af_xdp_device_output_free(vlib_main_t *vm, const vlib_node_runtime_t *node, af_xdp_txq_t *txq)
sll srl srl sll sra u16x4 i
#define STATIC_ASSERT(truth,...)
u16 current_length
Nbytes between current data and the end of this buffer.
VNET_DEVICE_CLASS_TX_FN() af_xdp_device_class(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
template key/value backing page structure
#define CLIB_LOG2_CACHE_LINE_BYTES
@ VLIB_BUFFER_KNOWN_ALLOCATED
static_always_inline void af_xdp_device_output_tx_db(vlib_main_t *vm, const vlib_node_runtime_t *node, af_xdp_device_t *ad, af_xdp_txq_t *txq, const u32 n_tx)
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
VLIB buffer representation.