24 #define foreach_netmap_tx_func_error \ 25 _(NO_FREE_SLOTS, "no free tx slots") \ 26 _(PENDING_MSGS, "pending msgs in tx ring") 29 #define _(f,s) NETMAP_TX_ERROR_##f, 54 u32 dev_instance = va_arg (*args,
u32);
55 int verbose = va_arg (*args,
int);
60 s =
format (s,
"NETMAP interface");
63 s =
format (s,
"\n%U version %d flags 0x%x" 64 "\n%U region %u memsize 0x%x offset 0x%x" 65 "\n%U tx_slots %u rx_slots %u tx_rings %u rx_rings %u",
84 s =
format (s,
"Unimplemented...");
96 f64 const time_constant = 1e3;
101 cur_ring = nif->first_tx_ring;
103 while(n_left && cur_ring <= nif->last_tx_ring)
121 while (n_left && n_free_slots)
151 if (n_left < frame->n_vectors)
156 (n_left == frame->
n_vectors ? NETMAP_TX_ERROR_PENDING_MSGS : NETMAP_TX_ERROR_NO_FREE_SLOTS), n_left);
171 if (node_index == ~0)
228 .no_flatten_output_chains = 1,
struct netmap_slot slot[0]
always_inline void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
sll srl srl sll sra u16x4 i
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
static void netmap_set_interface_next_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
static uword netmap_interface_tx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static u8 * format_netmap_device_name(u8 *s, va_list *args)
static u8 * format_netmap_tx_trace(u8 *s, va_list *args)
#define VNET_HW_INTERFACE_FLAG_LINK_UP
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
always_inline vlib_main_t * vlib_get_main(void)
VNET_DEVICE_CLASS(af_packet_device_class)
static u8 * format_netmap_device(u8 *s, va_list *args)
#define foreach_netmap_tx_func_error
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
u32 per_interface_next_index
static char * netmap_tx_func_error_strings[]
#define pool_elt_at_index(p, i)
void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
u16 current_length
Nbytes between current data and the end of this buffer.
always_inline void * vlib_frame_args(vlib_frame_t *f)
static void netmap_clear_hw_interface_counters(u32 instance)
#define clib_memcpy(a, b, c)
always_inline vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP
netmap_main_t netmap_main
vlib_node_registration_t netmap_input_node
(constructor) VLIB_REGISTER_NODE (netmap_input_node)
u32 next_buffer
Next buffer for this linked-list of buffers.
static clib_error_t * netmap_subif_add_del_function(vnet_main_t *vnm, u32 hw_if_index, struct vnet_sw_interface_t *st, int is_add)
static uint32_t nm_ring_space(struct netmap_ring *ring)
always_inline uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
always_inline void clib_cpu_time_wait(u64 dt)
static clib_error_t * netmap_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
vnet_device_class_t netmap_device_class
static int nm_tx_pending(struct netmap_ring *ring)
#define NETMAP_TXRING(nifp, index)
#define CLIB_MEMORY_BARRIER()
uword runtime_data[(128-1 *sizeof(vlib_node_function_t *)-1 *sizeof(vlib_error_t *)-11 *sizeof(u32)-5 *sizeof(u16))/sizeof(uword)]
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define NETMAP_BUF(ring, index)