|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
20 #include <sys/ioctl.h>
26 #include <vnet/devices/netmap/net_netmap.h>
27 #include <vnet/devices/netmap/netmap.h>
29 #define foreach_netmap_tx_func_error \
30 _(NO_FREE_SLOTS, "no free tx slots") \
31 _(PENDING_MSGS, "pending msgs in tx ring")
35 #define _(f,s) NETMAP_TX_ERROR_##f,
62 u32 dev_instance = va_arg (*args,
u32);
63 int verbose = va_arg (*args,
int);
68 s =
format (s,
"NETMAP interface");
71 s =
format (s,
"\n%U version %d flags 0x%x"
72 "\n%U region %u memsize 0x%x offset 0x%x"
73 "\n%U tx_slots %u rx_slots %u tx_rings %u rx_rings %u",
92 s =
format (s,
"Unimplemented...");
103 f64 const time_constant = 1e3;
110 cur_ring = nif->first_tx_ring;
112 while (
n_left && cur_ring <= nif->last_tx_ring)
114 struct netmap_ring *ring = NETMAP_TXRING (nif->nifp, cur_ring);
115 int n_free_slots = nm_ring_space (ring);
118 if (nm_tx_pending (ring))
124 if (nm_tx_pending (ring) && !n_free_slots)
131 while (
n_left && n_free_slots)
169 frame->n_vectors ? NETMAP_TX_ERROR_PENDING_MSGS :
170 NETMAP_TX_ERROR_NO_FREE_SLOTS),
n_left);
173 return frame->n_vectors;
u32 next_buffer
Next buffer for this linked-list of buffers.
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
netmap_main_t netmap_main
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
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.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
nat44_ei_interface_t * interfaces
vlib_main_t vlib_node_runtime_t * node
VNET_DEVICE_CLASS(af_xdp_device_class)
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
@ VNET_HW_INTERFACE_FLAG_LINK_UP
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
#define VNET_DEVICE_CLASS_TX_FN(devclass)
#define clib_unix_warning(format, args...)
static void clib_cpu_time_wait(u64 dt)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
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 CLIB_MEMORY_BARRIER()
u16 current_length
Nbytes between current data and the end of this buffer.
template key/value backing page structure
description fragment has unexpected format
u32 per_interface_next_index
static vlib_main_t * vlib_get_main(void)
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
struct netmap_slot slot[0]
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
vlib_node_registration_t netmap_input_node
(constructor) VLIB_REGISTER_NODE (netmap_input_node)
VLIB buffer representation.
vl_api_wireguard_peer_flags_t flags