|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
28 #define AVF_MBOX_LEN 64
29 #define AVF_MBOX_BUF_SZ 4096
30 #define AVF_RXQ_SZ 512
31 #define AVF_TXQ_SZ 512
32 #define AVF_ITR_INT 250
34 #define PCI_VENDOR_ID_INTEL 0x8086
35 #define PCI_DEVICE_ID_INTEL_AVF 0x1889
36 #define PCI_DEVICE_ID_INTEL_X710_VF 0x154c
37 #define PCI_DEVICE_ID_INTEL_X722_VF 0x37cd
45 .subclass_name =
"stats",
59 #define _(v, n) [v] = #n,
74 u32 dyn_ctl0 = 0, icr0_ena = 0;
88 icr0_ena |= (1 << 30);
112 dyn_ctln |= (1 << 1);
116 dyn_ctln |= (1 << 3);
117 dyn_ctln |= ((32 / 2) << 5);
118 dyn_ctln |= (1 << 30);
123 dyn_ctln |= (1 << 0);
156 if (ad->
flags & AVF_DEVICE_F_ELOG)
173 avf_log_err (ad,
"aq_desc_enq failed (timeout %.3fs)", t);
188 if (ad->
flags & AVF_DEVICE_F_ELOG)
192 .format =
"avf[%d] aq enq: s_flags 0x%x r_flags 0x%x opcode 0x%x "
193 "datalen %d retval %d",
194 .format_args =
"i4i2i2i2i2i2",
207 ed->s_flags = dc.
flags;
208 ed->r_flags = d->
flags;
225 if (ad->
flags & AVF_DEVICE_F_ELOG)
229 .format =
"avf[%d] rx ctl reg write: reg 0x%x val 0x%x ",
230 .format_args =
"i4i4i4",
255 rxq->
size = rxq_size;
283 for (
i = 0;
i < n_alloc;
i++)
286 if (ad->
flags & AVF_DEVICE_F_VA_DMA)
307 txq->
size = txq_size;
316 n = (txq->
size / 510) + 1;
366 return (ad->
flags & AVF_DEVICE_F_VA_DMA) ?
409 void *in,
int in_len,
void *out,
int out_len)
418 ASSERT ((ad->
flags & AVF_DEVICE_F_INITIALIZED) == 0 ||
439 avf_log_err (ad,
"send_to_pf failed (timeout %.3fs)", t);
449 if (d->
v_opcode == VIRTCHNL_OP_EVENT)
471 "unexpected message received [v_opcode = %u, "
472 "expected %u, v_retval %d]",
497 if (ad->
flags & AVF_DEVICE_F_ELOG)
501 .format =
"avf[%d] send to pf: v_opcode %s (%d) v_retval 0x%x",
502 .format_args =
"i4t4i4i4",
505 #define _(v, n) [v] = #n,
520 ed->v_opcode_val = op;
553 u32 bitmap = (VIRTCHNL_VF_OFFLOAD_L2 | VIRTCHNL_VF_OFFLOAD_RSS_PF |
554 VIRTCHNL_VF_OFFLOAD_WB_ON_ITR | VIRTCHNL_VF_OFFLOAD_VLAN |
555 VIRTCHNL_VF_OFFLOAD_RX_POLLING |
556 VIRTCHNL_VF_CAP_ADV_LINK_SPEED | VIRTCHNL_VF_OFFLOAD_FDIR_PF |
557 VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF | VIRTCHNL_VF_OFFLOAD_VLAN_V2);
559 avf_log_debug (ad,
"get_vf_resources: bitmap 0x%x (%U)", bitmap,
568 "get_vf_resources: num_vsis %u num_queue_pairs %u "
569 "max_vectors %u max_mtu %u vf_cap_flags 0x%x (%U) "
570 "rss_key_size %u rss_lut_size %u",
577 "get_vf_resources_vsi[%u]: vsi_id %u num_queue_pairs %u vsi_type %u "
578 "qset_handle %u default_mac_addr %U",
602 avf_log_debug (ad,
"config_rss_lut: vsi_id %u rss_lut_size %u lut 0x%U",
604 rl->lut, rl->lut_entries);
626 avf_log_debug (ad,
"config_rss_key: vsi_id %u rss_key_size %u key 0x%U",
652 pi.
flags = FLAG_VF_UNICAST_PROMISC | FLAG_VF_MULTICAST_PROMISC;
654 avf_log_debug (ad,
"config_promisc_mode: unicast %s multicast %s",
655 pi.
flags & FLAG_VF_UNICAST_PROMISC ?
"on" :
"off",
656 pi.
flags & FLAG_VF_MULTICAST_PROMISC ?
"on" :
"off");
678 avf_log_debug (ad,
"config_vsi_queues: vsi_id %u num_queue_pairs %u",
681 for (
i = 0;
i < n_qp;
i++)
697 avf_log_debug (ad,
"config_vsi_queues_rx[%u]: max_pkt_size %u "
698 "ring_len %u databuffer_size %u dma_ring_addr 0x%llx",
711 "dma_ring_addr 0x%llx",
i, txq->
ring_len,
740 avf_log_debug (ad,
"config_irq_map[%u/%u]: vsi_id %u vector_id %u "
752 u8 * macs,
int is_add)
766 avf_log_debug (ad,
"add_del_eth_addr: vsi_id %u num_elements %u is_add %u",
776 VIRTCHNL_OP_DEL_ETH_ADDR, msg, msg_len, 0, 0);
788 avf_log_debug (ad,
"enable_queues: vsi_id %u rx_queues %u tx_queues %u",
829 err =
avf_send_to_pf (
vm, ad, VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS, 0, 0, vc,
844 .inner_ethertype_setting = inner,
848 avf_log_debug (ad,
"disable_vlan_stripping_v2: outer: %U, inner %U",
877 if (rstat == 2 || rstat == 3)
886 avf_log_err (ad,
"reset failed (timeout %.3fs)", t);
904 avf_log_debug (ad,
"request_queues: num_queue_pairs %u", num_queue_pairs);
932 avf_log_err (ad,
"request queues failed (timeout %.3f seconds)", t);
951 u16 rxq_num, txq_num;
1001 ad->
flags |= AVF_DEVICE_F_RX_INT;
1003 wb_on_itr = (ad->
cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) != 0;
1009 "Number of requested RX queues (%u) is "
1010 "higher than mumber of available queues (%u)",
1015 "Number of requested TX queues (%u) is "
1016 "higher than mumber of available queues (%u)",
1022 if (ad->
cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2)
1026 u32 mask = VIRTCHNL_VLAN_ETHERTYPE_8100;
1034 if ((outer || inner) &&
1052 if ((ad->
cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) &&
1056 if ((ad->
cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) &&
1079 ad->
flags |= AVF_DEVICE_F_INITIALIZED;
1090 if (ad->
flags & AVF_DEVICE_F_ERROR)
1093 if ((ad->
flags & AVF_DEVICE_F_INITIALIZED) == 0)
1104 if ((
r & 0xf0000000) != (1ULL << 31))
1112 if ((
r & 0xf0000000) != (1ULL << 31))
1127 if (e->
event == VIRTCHNL_EVENT_LINK_CHANGE)
1134 if (ad->
cap_flags & VIRTCHNL_VF_CAP_ADV_LINK_SPEED)
1139 if (ad->
cap_flags & VIRTCHNL_VF_CAP_ADV_LINK_SPEED)
1141 if (speed == VIRTCHNL_LINK_SPEED_40GB)
1143 else if (speed == VIRTCHNL_LINK_SPEED_25GB)
1145 else if (speed == VIRTCHNL_LINK_SPEED_10GB)
1147 else if (speed == VIRTCHNL_LINK_SPEED_5GB)
1149 else if (speed == VIRTCHNL_LINK_SPEED_2_5GB)
1151 else if (speed == VIRTCHNL_LINK_SPEED_1GB)
1153 else if (speed == VIRTCHNL_LINK_SPEED_100MB)
1156 avf_log_debug (ad,
"event_link_change: status %d speed %u mbps",
1159 if (link_up && (ad->
flags & AVF_DEVICE_F_LINK_UP) == 0)
1161 ad->
flags |= AVF_DEVICE_F_LINK_UP;
1169 else if (!link_up && (ad->
flags & AVF_DEVICE_F_LINK_UP) != 0)
1171 ad->
flags &= ~AVF_DEVICE_F_LINK_UP;
1175 if (ad->
flags & AVF_DEVICE_F_ELOG)
1179 .format =
"avf[%d] link change: link_status %d "
1180 "link_speed %d mbps",
1181 .format_args =
"i4i1i4",
1191 ed->link_status = link_up;
1192 ed->link_speed = mbps;
1197 if (ad->
flags & AVF_DEVICE_F_ELOG)
1201 .format =
"avf[%d] unknown event: event %d severity %d",
1202 .format_args =
"i4i4i1i1",
1212 ed->event = e->
event;
1223 ad->
flags |= AVF_DEVICE_F_ERROR;
1230 u8 *rule,
u32 rule_len,
u8 *program_status,
1237 is_create ? VIRTCHNL_OP_ADD_FDIR_FILTER :
1238 VIRTCHNL_OP_DEL_FDIR_FILTER,
1239 rule, rule_len, program_status, status_len);
1257 clib_panic (
"BUG: unknown avf proceess request type");
1266 uword *event_data = 0;
1277 clib_panic (
"avf process node failed to reply in 5 seconds");
1297 ad->
flags &= ~AVF_DEVICE_F_PROMISC;
1300 ad->
flags |= AVF_DEVICE_F_PROMISC;
1323 uword *event_data = 0, event_type;
1324 int enabled = 0, irq;
1325 f64 last_run_duration = 0;
1326 f64 last_periodic_time = 0;
1349 for (
int i = 0;
i <
vec_len (event_data);
i++)
1361 for (
int i = 0;
i <
vec_len (event_data);
i++)
1397 .name =
"avf-process",
1410 if (ad->
flags & AVF_DEVICE_F_ELOG)
1415 .format =
"avf[%d] irq 0: icr0 0x%x",
1416 .format_args =
"i4i4",
1433 if (icr0 & (1 << 30))
1446 if (ad->
flags & AVF_DEVICE_F_ELOG)
1451 .format =
"avf[%d] irq %d: received",
1452 .format_args =
"i4i2",
1481 ad->
flags &= ~AVF_DEVICE_F_ADMIN_UP;
1555 args->
rv = VNET_API_ERROR_INVALID_VALUE;
1564 args->
rv = VNET_API_ERROR_INVALID_VALUE;
1573 args->
rv = VNET_API_ERROR_INVALID_VALUE;
1597 if ((*adp)->pci_addr.as_u32 == args->
addr.as_u32)
1599 args->
rv = VNET_API_ERROR_ADDRESS_IN_USE;
1602 &args->
addr,
"pci address in use");
1618 ad->
flags |= AVF_DEVICE_F_ELOG;
1627 args->
rv = VNET_API_ERROR_INVALID_INTERFACE;
1698 ad->
flags |= AVF_DEVICE_F_VA_DMA;
1747 if (ad->
flags & AVF_DEVICE_F_RX_INT)
1777 args->
rv = VNET_API_ERROR_INVALID_INTERFACE;
1790 if (ad->
flags & AVF_DEVICE_F_ERROR)
1797 ad->
flags |= AVF_DEVICE_F_ADMIN_UP;
1802 ad->
flags &= ~AVF_DEVICE_F_ADMIN_UP;
1819 if (ad->
cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)
1887 u8 *program_status,
u32 status_len)
1905 .name =
"Adaptive Virtual Function (AVF) interface",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define ETHERNET_INTERFACE_FLAG_DEFAULT_L3
static void clib_spinlock_init(clib_spinlock_t *p)
static char * avf_tx_func_error_strings[]
void vlib_pci_set_private_data(vlib_main_t *vm, vlib_pci_dev_handle_t h, uword private_data)
format_function_t format_avf_vlan_support
#define VNET_HW_IF_RXQ_THREAD_ANY
struct virtchnl_pf_event_t::@36::@37 link_event
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
#define AVF_RESET_MAX_WAIT_TIME
clib_error_t * avf_op_config_rss_key(vlib_main_t *vm, avf_device_t *ad)
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
clib_error_t * avf_rxq_init(vlib_main_t *vm, avf_device_t *ad, u16 qid, u16 rxq_size)
static clib_error_t * avf_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
vlib_pci_dev_handle_t pci_dev_handle
#define VNET_HW_INTERFACE_CAP_SUPPORTS_L4_TX_CKSUM
vnet_hw_interface_capabilities_t caps
#define foreach_virtchnl_op
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
#define clib_memcpy(d, s, n)
@ VNET_HW_INTERFACE_CAP_SUPPORTS_MAC_FILTER
void avf_delete_if(vlib_main_t *vm, avf_device_t *ad, int with_barrier)
u32 ethernet_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
clib_error_t * avf_op_config_rss_lut(vlib_main_t *vm, avf_device_t *ad)
static uword * vlib_process_wait_for_event(vlib_main_t *vm)
static uword pow2_mask(uword x)
static uword pointer_to_uword(const void *p)
u32 vlib_pci_get_numa_node(vlib_main_t *vm, vlib_pci_dev_handle_t h)
u8 * format_ethernet_address(u8 *s, va_list *args)
static void clib_mem_free(void *p)
#define clib_error_return(e, args...)
VNET_DEVICE_CLASS(af_xdp_device_class)
static void avf_irq_0_handler(vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 line)
u32 vlib_pci_dev_handle_t
clib_error_t * vlib_pci_enable_msix_irq(vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 start, u16 count)
#define PCI_DEVICE_ID_INTEL_AVF
void vnet_hw_if_tx_queue_assign_thread(vnet_main_t *vnm, u32 queue_index, u32 thread_index)
struct virtchnl_pf_event_t::@36::@38 link_event_adv
vlib_node_registration_t avf_input_node
(constructor) VLIB_REGISTER_NODE (avf_input_node)
static heap_elt_t * first(heap_header_t *h)
vl_api_tunnel_mode_t mode
static void avf_clear_hw_interface_counters(u32 instance)
static void vlib_physmem_free(vlib_main_t *vm, void *p)
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
#define pool_put(P, E)
Free an object E in pool P.
@ VNET_HW_IF_RX_MODE_POLLING
clib_error_t * avf_op_disable_vlan_stripping_v2(vlib_main_t *vm, avf_device_t *ad, u32 outer, u32 inner)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define AVFINT_DYN_CTLN(x)
@ VNET_HW_INTERFACE_FLAG_LINK_UP
vl_api_dhcp_client_state_t state
clib_error_t * vlib_pci_register_msix_handler(vlib_main_t *vm, vlib_pci_dev_handle_t h, u32 start, u32 count, pci_msix_handler_function_t *msix_handler)
clib_error_t * avf_device_init(vlib_main_t *vm, avf_main_t *am, avf_device_t *ad, avf_create_if_args_t *args)
@ VIRTCHNL_VLAN_UNSUPPORTED
static void vnet_hw_interface_set_link_speed(vnet_main_t *vnm, u32 hw_if_index, u32 link_speed)
static uword vlib_buffer_get_pa(vlib_main_t *vm, vlib_buffer_t *b)
clib_error_t * avf_op_config_vsi_queues(vlib_main_t *vm, avf_device_t *ad)
clib_error_t * avf_op_version(vlib_main_t *vm, avf_device_t *ad, virtchnl_version_info_t *ver)
vnet_hw_if_output_node_runtime_t * r
virtchnl_ether_addr_t list[1]
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
format_function_t format_avf_device
clib_error_t * vlib_pci_map_region(vlib_main_t *vm, vlib_pci_dev_handle_t h, u32 resource, void **result)
vlib_node_registration_t avf_process_node
(constructor) VLIB_REGISTER_NODE (avf_process_node)
#define pool_put_index(p, i)
Free pool element with given index.
#define avf_log_debug(dev, f,...)
virtchnl_vsi_resource_t vsi_res[1]
clib_error_t * avf_op_program_flow(vlib_main_t *vm, avf_device_t *ad, int is_create, u8 *rule, u32 rule_len, u8 *program_status, u32 status_len)
vnet_device_class_t avf_device_class
#define AVF_AQ_ENQ_MAX_WAIT_TIME
#define vlib_log_err(...)
static clib_error_t * vlib_pci_intr_enable(vlib_main_t *vm, vlib_pci_dev_handle_t h)
clib_error_t * vlib_pci_map_dma(vlib_main_t *vm, vlib_pci_dev_handle_t h, void *ptr)
__clib_export u8 * format_clib_error(u8 *s, va_list *va)
format_function_t format_avf_vlan_caps
static void avf_irq_0_set_state(avf_device_t *ad, avf_irq_state_t state)
static u32 random_u32(u32 *seed)
32-bit random number generator
void avf_create_if(vlib_main_t *vm, avf_create_if_args_t *args)
static clib_error_t * avf_add_del_mac_address(vnet_hw_interface_t *hw, const u8 *address, u8 is_add)
static uword vlib_buffer_get_va(vlib_buffer_t *b)
static clib_error_t * vlib_pci_bus_master_enable(vlib_main_t *vm, vlib_pci_dev_handle_t h)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type,...
avf_tx_desc_t * tmp_descs
static void vlib_buffer_free_from_ring(vlib_main_t *vm, u32 *ring, u32 start, u32 ring_size, u32 n_buffers)
Free buffers from ring.
#define pool_foreach(VAR, POOL)
Iterate through pool.
@ VNET_HW_INTERFACE_FLAG_FULL_DUPLEX
uword vlib_pci_get_private_data(vlib_main_t *vm, vlib_pci_dev_handle_t h)
static u64 vlib_physmem_get_pa(vlib_main_t *vm, void *mem)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
union virtchnl_pf_event_t::@36 event_data
u32 calling_process_index
static u32 vlib_get_current_process_node_index(vlib_main_t *vm)
#define ELOG_TYPE_DECLARE(f)
#define PCI_DEVICE_ID_INTEL_X710_VF
static clib_error_t * avf_process_request(vlib_main_t *vm, avf_process_req_t *req)
#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).
clib_error_t * avf_op_get_offload_vlan_v2_caps(vlib_main_t *vm, avf_device_t *ad, virtchnl_vlan_caps_t *vc)
#define VIRTCHNL_VERSION_MINOR
#define vec_dup(V)
Return copy of vector (no header, no alignment)
static void vlib_process_signal_event_pointer(vlib_main_t *vm, uword node_index, uword type_opaque, void *data)
#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)
vnet_main_t * vnet_get_main(void)
#define vlib_worker_thread_barrier_sync(X)
@ VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO
#define clib_ring_new_aligned(ring, size, align)
vlib_global_main_t vlib_global_main
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
const static char * virtchnl_event_names[]
static void avf_irq_n_handler(vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 line)
clib_error_t * avf_init(vlib_main_t *vm)
avf_process_req_type_t type
virtchnl_link_speed_t link_speed
#define vec_foreach_index(var, v)
Iterate over vector indices.
void vnet_hw_if_update_runtime_data(vnet_main_t *vnm, u32 hw_if_index)
void avf_process_one_device(vlib_main_t *vm, avf_device_t *ad, int is_irq)
sll srl srl sll sra u16x4 i
virtchnl_vlan_supported_caps_t stripping_support
static clib_error_t * avf_interface_rx_mode_change(vnet_main_t *vnm, u32 hw_if_index, u32 qid, vnet_hw_if_rx_mode mode)
clib_error_t * avf_op_enable_queues(vlib_main_t *vm, avf_device_t *ad, u32 rx, u32 tx)
static void clib_spinlock_free(clib_spinlock_t *p)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
manual_print typedef address
static_always_inline void vnet_hw_if_rx_queue_set_int_pending(vnet_main_t *vnm, u32 queue_index)
int vlib_pci_supports_virtual_addr_dma(vlib_main_t *vm, vlib_pci_dev_handle_t h)
#define CLIB_MEMORY_BARRIER()
#define clib_ring_free(f)
virtchnl_vlan_offload_caps_t offloads
#define CLIB_CACHE_LINE_BYTES
struct _vlib_node_registration vlib_node_registration_t
void vnet_hw_if_set_rx_queue_file_index(vnet_main_t *vnm, u32 queue_index, u32 file_index)
static void avf_process_handle_request(vlib_main_t *vm, avf_process_req_t *req)
#define avf_log_err(dev, f,...)
virtchnl_eth_stats_t last_cleared_eth_stats
static u8 avf_validate_queue_size(avf_create_if_args_t *args)
static void avf_set_interface_next_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
#define AVF_SEND_TO_PF_MAX_WAIT_TIME
clib_error_t * avf_op_add_del_eth_addr(vlib_main_t *vm, avf_device_t *ad, u8 count, u8 *macs, int is_add)
#define vec_free(V)
Free vector's memory (no header).
#define VIRTCHNL_VERSION_MAJOR
static void avf_reg_write(avf_device_t *ad, u32 addr, u32 val)
vnet_flow_dev_ops_function_t avf_flow_ops_fn
static u32 avf_reg_read(avf_device_t *ad, u32 addr)
static u32 avf_flag_change(vnet_main_t *vnm, vnet_hw_interface_t *hw, u32 flags)
#define pool_foreach_index(i, v)
format_function_t format_vlib_pci_addr
@ AVF_PROCESS_REQ_CONFIG_PROMISC_MDDE
virtchnl_vector_map_t vecmap[1]
clib_error_t * avf_device_reset(vlib_main_t *vm, avf_device_t *ad)
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
vlib_log_class_registration_t avf_log
#define PCI_VENDOR_ID_INTEL
static uword vlib_process_suspend(vlib_main_t *vm, f64 dt)
Suspend a vlib cooperative multi-tasking thread for a period of time.
static vnet_sw_interface_t * vnet_get_hw_sw_interface(vnet_main_t *vnm, u32 hw_if_index)
static_always_inline u32 vlib_buffer_get_default_data_size(vlib_main_t *vm)
#define VLIB_INIT_FUNCTION(x)
format_function_t format_avf_device_name
clib_error_t * avf_op_get_stats(vlib_main_t *vm, avf_device_t *ad, virtchnl_eth_stats_t *es)
void ethernet_delete_interface(vnet_main_t *vnm, u32 hw_if_index)
static uword avf_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
vlib_log_class_registration_t avf_stats_log
virtchnl_status_code_t v_retval
clib_error_t * avf_op_config_promisc_mode(vlib_main_t *vm, avf_device_t *ad, int is_enable)
static void avf_adminq_init(vlib_main_t *vm, avf_device_t *ad)
#define vec_foreach(var, vec)
Vector iterator.
u32 outer_ethertype_setting
static pci_device_id_t avf_pci_device_ids[]
static uword pool_elts(void *v)
Number of active elements in a pool.
clib_error_t * avf_op_get_vf_resources(vlib_main_t *vm, avf_device_t *ad, virtchnl_vf_resource_t *res)
clib_error_t * avf_op_disable_vlan_stripping(vlib_main_t *vm, avf_device_t *ad)
u32 per_interface_next_index
#define AVF_AQ_ENQ_SUSPEND_TIME
format_function_t format_avf_eth_stats
static u32 avf_get_u32(void *start, int offset)
virtchnl_eth_stats_t eth_stats
static void avf_irq_n_set_state(avf_device_t *ad, u8 line, avf_irq_state_t state)
static u8 vlib_buffer_pool_get_default_for_numa(vlib_main_t *vm, u32 numa_node)
static clib_error_t * vlib_physmem_last_error(struct vlib_main_t *vm)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
clib_error_t * avf_op_config_irq_map(vlib_main_t *vm, avf_device_t *ad)
clib_error_t * avf_request_queues(vlib_main_t *vm, avf_device_t *ad, u16 num_queue_pairs)
static u32 vlib_get_n_threads()
u32 vnet_hw_if_register_rx_queue(vnet_main_t *vnm, u32 hw_if_index, u32 queue_id, u32 thread_index)
#define AVF_SEND_TO_PF_SUSPEND_TIME
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)
vnet_interface_output_runtime_t * rt
void avf_arq_slot_init(avf_device_t *ad, u16 slot)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
uword vlib_pci_get_msix_file_index(vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 index)
VLIB_REGISTER_LOG_CLASS(avf_log)
#define ETHERNET_MAX_PACKET_BYTES
@ AVF_PROCESS_EVENT_DELETE_IF
static void * vlib_physmem_alloc_aligned_on_numa(vlib_main_t *vm, uword n_bytes, uword alignment, u32 numa_node)
virtchnl_pf_event_t * events
static void * clib_mem_alloc_aligned(uword size, uword align)
clib_error_t * vlib_pci_device_open(vlib_main_t *vm, vlib_pci_addr_t *addr, pci_device_id_t ids[], vlib_pci_dev_handle_t *handle)
@ VNET_HW_INTERFACE_CAP_SUPPORTS_INT_MODE
#define clib_error_free(e)
@ AVF_PROCESS_EVENT_AQ_INT
#define foreach_avf_tx_func_error
virtchnl_event_codes_t event
virtchnl_vsi_type_t vsi_type
#define avf_stats_log_debug(dev, f,...)
@ AVF_IRQ_STATE_WB_ON_ITR
clib_error_t * avf_txq_init(vlib_main_t *vm, avf_device_t *ad, u16 qid, u16 txq_size)
@ AVF_PROCESS_REQ_PROGRAM_FLOW
static f64 vlib_time_now(vlib_main_t *vm)
void vlib_pci_device_close(vlib_main_t *vm, vlib_pci_dev_handle_t h)
static uword avf_dma_addr(vlib_main_t *vm, avf_device_t *ad, void *p)
format_function_t format_avf_vf_cap_flags
#define clib_panic(format, args...)
u32 vnet_hw_if_register_tx_queue(vnet_main_t *vnm, u32 hw_if_index, u32 queue_id)
static vlib_thread_main_t * vlib_get_thread_main()
#define PCI_DEVICE_ID_INTEL_X722_VF
clib_error_t * avf_send_to_pf(vlib_main_t *vm, avf_device_t *ad, virtchnl_ops_t op, void *in, int in_len, void *out, int out_len)
@ AVF_PROCESS_REQ_ADD_DEL_ETH_ADDR
static __clib_warn_unused_result u32 vlib_buffer_alloc_from_pool(vlib_main_t *vm, u32 *buffers, u32 n_buffers, u8 buffer_pool_index)
Allocate buffers from specific pool into supplied array.
#define AVF_RESET_SUSPEND_TIME
clib_error_t * avf_cmd_rx_ctl_reg_write(vlib_main_t *vm, avf_device_t *ad, u32 reg, u32 val)
clib_error_t * ethernet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, const u8 *address, u32 *hw_if_index_return, ethernet_flag_change_function_t flag_change)
clib_error_t * avf_program_flow(u32 dev_instance, int is_add, u8 *rule, u32 rule_len, u8 *program_status, u32 status_len)
void vnet_hw_if_set_input_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
@ AVF_PROCESS_EVENT_START
static_always_inline avf_device_t * avf_get_device(u32 dev_instance)
VLIB buffer representation.
virtchnl_queue_pair_info_t qpair[1]
static void avf_reg_flush(avf_device_t *ad)
#define VLIB_REGISTER_NODE(x,...)
static uword random_default_seed(void)
Default random seed (unix/linux user-mode)
@ foreach_virtchnl_event_code
clib_error_t * avf_aq_desc_enq(vlib_main_t *vm, avf_device_t *ad, avf_aq_desc_t *dt, void *data, int len)
vl_api_wireguard_peer_flags_t flags