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)
161 if (n_left < frame->n_vectors)
169 frame->n_vectors ? NETMAP_TX_ERROR_PENDING_MSGS :
170 NETMAP_TX_ERROR_NO_FREE_SLOTS), n_left);
173 return frame->n_vectors;
185 if (node_index == ~0)
struct netmap_slot slot[0]
vl_api_wireguard_peer_flags_t flags
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 clib_cpu_time_wait(u64 dt)
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)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
u16 current_length
Nbytes between current data and the end of this buffer.
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
VNET_DEVICE_CLASS(af_xdp_device_class)
description fragment has unexpected format
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
u32 per_interface_next_index
#define VNET_DEVICE_CLASS_TX_FN(devclass)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
sll srl srl sll sra u16x4 i
vlib_main_t vlib_node_runtime_t * node
vlib_node_registration_t netmap_input_node
(constructor) VLIB_REGISTER_NODE (netmap_input_node)
static vlib_main_t * vlib_get_main(void)
template key/value backing page structure
u32 next_buffer
Next buffer for this linked-list of buffers.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define clib_unix_warning(format, args...)
struct clib_bihash_value offset
template key/value backing page structure
#define CLIB_MEMORY_BARRIER()
netmap_main_t netmap_main
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.