|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
22 .class_name =
"interface",
23 .subclass_name =
"rx-queue",
26 #define log_debug(fmt, ...) vlib_log_debug (if_rxq_log.class, fmt, __VA_ARGS__)
27 #define log_err(fmt, ...) vlib_log_err (if_rxq_log.class, fmt, __VA_ARGS__)
36 if (
thread_index != 0 && (thread_index < vdm->first_worker_thread_index ||
50 return ((
u64) hw_if_index << 32) | queue_id;
74 clib_panic (
"Trying to register already registered queue id (%u) in the "
92 log_debug (
"register: interface %v queue-id %u thread %u",
hi->name,
110 for (
int i = 0;
i <
vec_len (
hi->rx_queue_indices);
i++)
111 if (
hi->rx_queue_indices[
i] == queue_index)
129 log_debug (
"unregister_all: interface %v",
hi->name);
131 for (
int i = 0;
i <
vec_len (
hi->rx_queue_indices);
i++)
152 log_debug (
"set_file_index: interface %v queue-id %u file-index %u",
177 mode =
hi->default_rx_mode;
181 log_debug (
"set_rx_queue_mode: interface %v queue-id %u mode "
187 if (dc->rx_mode_change_function)
193 log_err (
"setting rx mode on the interface %v queue-id %u failed.\n"
197 return VNET_API_ERROR_UNSUPPORTED;
202 log_debug (
"set_rx_queue_mode: interface %v queue-id %u mode set to %U",
226 log_debug (
"set_rx_queue_thread_index: interface %v queue-id %u "
227 "thread-index set to %u",
239 ASSERT (
node->state == VLIB_NODE_STATE_INTERRUPT);
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
uword last_worker_thread_index
vnet_device_main_t vnet_device_main
vnet_interface_main_t * im
clib_file_main_t file_main
static void clib_file_set_polling_thread(clib_file_main_t *um, uword index, u32 thread_index)
struct _vnet_device_class vnet_device_class_t
int vnet_hw_if_set_rx_queue_mode(vnet_main_t *vnm, u32 queue_index, vnet_hw_if_rx_mode mode)
static_always_inline vnet_hw_if_rx_queue_t * vnet_hw_if_get_rx_queue(vnet_main_t *vnm, u32 queue_index)
static_always_inline int clib_interrupt_get_next(void *in, int last)
vlib_main_t vlib_node_runtime_t * node
vl_api_tunnel_mode_t mode
@ VNET_HW_IF_RX_MODE_POLLING
void vnet_hw_if_unregister_all_rx_queues(vnet_main_t *vnm, u32 hw_if_index)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vnet_device_class_t * vnet_get_device_class(vnet_main_t *vnm, u32 dev_class_index)
vnet_hw_if_rx_queue_t * hw_if_rx_queues
#define pool_put_index(p, i)
Free pool element with given index.
__clib_export u8 * format_clib_error(u8 *s, va_list *va)
VLIB_REGISTER_LOG_CLASS(if_rxq_log, static)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
format_function_t format_vnet_hw_if_rx_mode
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
u32 vnet_hw_if_get_rx_queue_index_by_id(vnet_main_t *vnm, u32 hw_if_index, u32 queue_id)
static_always_inline void clib_interrupt_clear(void *in, int int_num)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_main_t * vnet_get_main(void)
static u64 rx_queue_key(u32 hw_if_index, u32 queue_id)
static void hash_unset_mem_free(uword **h, const void *key)
sll srl srl sll sra u16x4 i
static u32 next_thread_index(vnet_main_t *vnm, u32 thread_index)
static void hash_set_mem_alloc(uword **h, const void *key, uword v)
@ VNET_HW_IF_RX_MODE_DEFAULT
void vnet_hw_if_set_rx_queue_file_index(vnet_main_t *vnm, u32 queue_index, u32 file_index)
uword first_worker_thread_index
#define vec_free(V)
Free vector's memory (no header).
format_function_t format_vlib_node_name
#define hash_get_mem(h, key)
vnet_hw_if_rx_mode vnet_hw_if_get_rx_queue_mode(vnet_main_t *vnm, u32 queue_index)
#define log_debug(fmt,...)
void vnet_hw_if_unregister_rx_queue(vnet_main_t *vnm, u32 queue_index)
u32 vnet_hw_if_register_rx_queue(vnet_main_t *vnm, u32 hw_if_index, u32 queue_id, u32 thread_index)
static vlib_main_t * vlib_get_main(void)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
vnet_interface_output_runtime_t * rt
#define clib_error_free(e)
void vnet_hw_if_set_rx_queue_thread_index(vnet_main_t *vnm, u32 queue_index, u32 thread_index)
uword * rxq_index_by_hw_if_index_and_queue_id
#define clib_panic(format, args...)
uword next_worker_thread_index
#define vec_del1(v, i)
Delete the element at index I.
vnet_interface_main_t interface_main
void vnet_hw_if_set_input_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
@ VNET_HW_IF_RX_MODE_UNKNOWN
void vnet_hw_if_generate_rxq_int_poll_vector(vlib_main_t *vm, vlib_node_runtime_t *node)