26 #define AVF_MBOX_LEN 64 27 #define AVF_MBOX_BUF_SZ 512 28 #define AVF_RXQ_SZ 512 29 #define AVF_TXQ_SZ 512 30 #define AVF_ITR_INT 250 32 #define PCI_VENDOR_ID_INTEL 0x8086 33 #define PCI_DEVICE_ID_INTEL_AVF 0x1889 34 #define PCI_DEVICE_ID_INTEL_X710_VF 0x154c 35 #define PCI_DEVICE_ID_INTEL_X722_VF 0x37cd 48 #define _(v, n) [v] = #n, 63 u32 dyn_ctl0 = 0, icr0_ena = 0;
77 icr0_ena |= (1 << 30);
101 dyn_ctln |= (1 << 1);
105 dyn_ctln |= (1 << 3);
106 dyn_ctln |= ((32 / 2) << 5);
107 dyn_ctln |= (1 << 30);
112 dyn_ctln |= (1 << 0);
145 if (ad->
flags & AVF_DEVICE_F_ELOG)
162 avf_log_err (ad,
"aq_desc_enq failed (timeout %.3fs)", t);
177 if (ad->
flags & AVF_DEVICE_F_ELOG)
182 .format =
"avf[%d] aq enq: s_flags 0x%x r_flags 0x%x opcode 0x%x " 183 "datalen %d retval %d",
184 .format_args =
"i4i2i2i2i2i2",
197 ed->s_flags = dc.
flags;
198 ed->r_flags = d->
flags;
216 if (ad->
flags & AVF_DEVICE_F_ELOG)
221 .format =
"avf[%d] rx ctl reg write: reg 0x%x val 0x%x ",
222 .format_args =
"i4i4i4",
248 rxq->
size = rxq_size;
276 for (i = 0; i < n_alloc; i++)
279 if (ad->
flags & AVF_DEVICE_F_VA_DMA)
302 ad->
flags |= AVF_DEVICE_F_SHARED_TXQ_LOCK;
308 txq->
size = txq_size;
352 return (ad->
flags & AVF_DEVICE_F_VA_DMA) ?
395 void *in,
int in_len,
void *out,
int out_len)
404 ASSERT ((ad->
flags & AVF_DEVICE_F_INITIALIZED) == 0 ||
425 avf_log_err (ad,
"send_to_pf failed (timeout %.3fs)", t);
435 if (d->
v_opcode == VIRTCHNL_OP_EVENT)
458 "unexpected message receiver [v_opcode = %u, " 459 "expected %u, v_retval %d]", d->
v_opcode, op,
484 if (ad->
flags & AVF_DEVICE_F_ELOG)
489 .format =
"avf[%d] send to pf: v_opcode %s (%d) v_retval 0x%x",
490 .format_args =
"i4t4i4i4",
493 #define _(v, n) [v] = #n, 508 ed->v_opcode_val = op;
542 u32 bitmap = (VIRTCHNL_VF_OFFLOAD_L2 | VIRTCHNL_VF_OFFLOAD_RSS_PF |
543 VIRTCHNL_VF_OFFLOAD_WB_ON_ITR | VIRTCHNL_VF_OFFLOAD_VLAN |
544 VIRTCHNL_VF_OFFLOAD_RX_POLLING |
545 VIRTCHNL_VF_CAP_ADV_LINK_SPEED);
548 err =
avf_send_to_pf (vm, ad, VIRTCHNL_OP_GET_VF_RESOURCES, &bitmap,
554 avf_log_debug (ad,
"get_vf_reqources: num_vsis %u num_queue_pairs %u " 555 "max_vectors %u max_mtu %u vf_offload_flags 0x%04x " 556 "rss_key_size %u rss_lut_size %u",
562 "num_queue_pairs %u vsi_type %u qset_handle %u " 563 "default_mac_addr %U", i,
590 avf_log_debug (ad,
"config_rss_lut: vsi_id %u rss_lut_size %u lut 0x%U",
592 rl->lut, rl->lut_entries);
594 return avf_send_to_pf (vm, ad, VIRTCHNL_OP_CONFIG_RSS_LUT, msg, msg_len, 0,
614 avf_log_debug (ad,
"config_rss_key: vsi_id %u rss_key_size %u key 0x%U",
618 return avf_send_to_pf (vm, ad, VIRTCHNL_OP_CONFIG_RSS_KEY, msg, msg_len, 0,
627 return avf_send_to_pf (vm, ad, VIRTCHNL_OP_DISABLE_VLAN_STRIPPING, 0, 0, 0,
639 pi.
flags = FLAG_VF_UNICAST_PROMISC | FLAG_VF_MULTICAST_PROMISC;
641 avf_log_debug (ad,
"config_promisc_mode: unicast %s multicast %s",
642 pi.
flags & FLAG_VF_UNICAST_PROMISC ?
"on" :
"off",
643 pi.
flags & FLAG_VF_MULTICAST_PROMISC ?
"on" :
"off");
645 return avf_send_to_pf (vm, ad, VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, &pi,
665 avf_log_debug (ad,
"config_vsi_queues: vsi_id %u num_queue_pairs %u",
668 for (i = 0; i < n_qp; i++)
684 avf_log_debug (ad,
"config_vsi_queues_rx[%u]: max_pkt_size %u " 685 "ring_len %u databuffer_size %u dma_ring_addr 0x%llx",
698 "dma_ring_addr 0x%llx", i, txq->
ring_len,
702 return avf_send_to_pf (vm, ad, VIRTCHNL_OP_CONFIG_VSI_QUEUES, msg, msg_len,
727 avf_log_debug (ad,
"config_irq_map[%u/%u]: vsi_id %u vector_id %u " 733 return avf_send_to_pf (vm, ad, VIRTCHNL_OP_CONFIG_IRQ_MAP, msg, msg_len, 0,
752 avf_log_debug (ad,
"add_eth_addr: vsi_id %u num_elements %u",
755 for (i = 0; i <
count; i++)
761 return avf_send_to_pf (vm, ad, VIRTCHNL_OP_ADD_ETH_ADDR, msg, msg_len, 0,
774 avf_log_debug (ad,
"enable_queues: vsi_id %u rx_queues %u tx_queues %u",
826 if (rstat == 2 || rstat == 3)
835 avf_log_err (ad,
"reset failed (timeout %.3fs)", t);
853 avf_log_debug (ad,
"request_queues: num_queue_pairs %u", num_queue_pairs);
855 error =
avf_send_to_pf (vm, ad, VIRTCHNL_OP_REQUEST_QUEUES, &res_req,
881 avf_log_err (ad,
"request queues failed (timeout %.3f seconds)", t);
943 wb_on_itr = (ad->
feature_bitmap & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) != 0;
963 avf_log_warn (ad,
"Requested more rx queues than queue pairs available." 964 "Using %u rx queues.", args->
rxq_num);
967 for (i = 0; i < args->
rxq_num; i++)
977 ad->
flags |= AVF_DEVICE_F_RX_INT;
1011 ad->
flags |= AVF_DEVICE_F_INITIALIZED;
1023 if (ad->
flags & AVF_DEVICE_F_ERROR)
1026 if ((ad->
flags & AVF_DEVICE_F_INITIALIZED) == 0)
1037 if ((r & 0xf0000000) != (1ULL << 31))
1045 if ((r & 0xf0000000) != (1ULL << 31))
1060 if (e->
event == VIRTCHNL_EVENT_LINK_CHANGE)
1074 if (speed == VIRTCHNL_LINK_SPEED_40GB)
1076 else if (speed == VIRTCHNL_LINK_SPEED_25GB)
1078 else if (speed == VIRTCHNL_LINK_SPEED_10GB)
1080 else if (speed == VIRTCHNL_LINK_SPEED_5GB)
1082 else if (speed == VIRTCHNL_LINK_SPEED_2_5GB)
1084 else if (speed == VIRTCHNL_LINK_SPEED_1GB)
1086 else if (speed == VIRTCHNL_LINK_SPEED_100MB)
1089 avf_log_debug (ad,
"event_link_change: status %d speed %u mbps",
1092 if (link_up && (ad->
flags & AVF_DEVICE_F_LINK_UP) == 0)
1094 ad->
flags |= AVF_DEVICE_F_LINK_UP;
1102 else if (!link_up && (ad->
flags & AVF_DEVICE_F_LINK_UP) != 0)
1104 ad->
flags &= ~AVF_DEVICE_F_LINK_UP;
1108 if (ad->
flags & AVF_DEVICE_F_ELOG)
1112 .format =
"avf[%d] link change: link_status %d " 1113 "link_speed %d mbps",
1114 .format_args =
"i4i1i4",
1124 ed->link_status = link_up;
1125 ed->link_speed = mbps;
1130 if (ad->
flags & AVF_DEVICE_F_ELOG)
1134 .format =
"avf[%d] unknown event: event %d severity %d",
1135 .format_args =
"i4i4i1i1",
1145 ed->event = e->
event;
1156 ad->
flags |= AVF_DEVICE_F_ERROR;
1171 ad->
flags &= ~AVF_DEVICE_F_PROMISC;
1174 ad->
flags |= AVF_DEVICE_F_PROMISC;
1180 promisc_enabled = ((ad->
flags & AVF_DEVICE_F_PROMISC) != 0);
1194 uword *event_data = 0, event_type;
1195 int enabled = 0, irq;
1196 f64 last_run_duration = 0;
1197 f64 last_periodic_time = 0;
1220 for (
int i = 0; i <
vec_len (event_data); i++)
1233 for (
int i = 0; i <
vec_len (event_data); i++)
1265 vec_add1 (dev_pointers, avf_get_device (i));
1273 last_run_duration =
vlib_time_now (vm) - last_periodic_time;
1282 .name =
"avf-process",
1295 if (ad->
flags & AVF_DEVICE_F_ELOG)
1300 .format =
"avf[%d] irq 0: icr0 0x%x",
1301 .format_args =
"i4i4",
1318 if (icr0 & (1 << 30))
1330 if (ad->
flags & AVF_DEVICE_F_ELOG)
1335 .format =
"avf[%d] irq %d: received",
1336 .format_args =
"i4i2",
1364 ad->
flags &= ~AVF_DEVICE_F_ADMIN_UP;
1438 args->
rv = VNET_API_ERROR_INVALID_VALUE;
1453 ad->
flags |= AVF_DEVICE_F_ELOG;
1460 args->
rv = VNET_API_ERROR_INVALID_INTERFACE;
1531 ad->
flags |= AVF_DEVICE_F_VA_DMA;
1584 args->
rv = VNET_API_ERROR_INVALID_INTERFACE;
1597 if (ad->
flags & AVF_DEVICE_F_ERROR)
1604 ad->
flags |= AVF_DEVICE_F_ADMIN_UP;
1609 ad->
flags &= ~AVF_DEVICE_F_ADMIN_UP;
1653 if (node_index == ~0)
1680 .name =
"Adaptive Virtual Function (AVF) interface",
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
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_add_eth_addr(vlib_main_t *vm, avf_device_t *ad, u8 count, u8 *macs)
vlib_node_registration_t avf_process_node
(constructor) VLIB_REGISTER_NODE (avf_process_node)
#define vec_foreach_index(var, v)
Iterate over vector indices.
virtchnl_queue_pair_info_t qpair[1]
u8 * format_clib_error(u8 *s, va_list *va)
static clib_error_t * vlib_pci_intr_enable(vlib_main_t *vm, vlib_pci_dev_handle_t h)
#define PCI_DEVICE_ID_INTEL_AVF
static void avf_irq_0_set_state(avf_device_t *ad, avf_irq_state_t state)
static uword random_default_seed(void)
Default random seed (unix/linux user-mode)
static clib_error_t * vlib_pci_bus_master_enable(vlib_main_t *vm, vlib_pci_dev_handle_t h)
static void * vlib_physmem_alloc_aligned_on_numa(vlib_main_t *vm, uword n_bytes, uword alignment, u32 numa_node)
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...
void avf_arq_slot_init(avf_device_t *ad, u16 slot)
vl_api_wireguard_peer_flags_t flags
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)
void avf_create_if(vlib_main_t *vm, avf_create_if_args_t *args)
static uword * vlib_process_wait_for_event(vlib_main_t *vm)
void ethernet_delete_interface(vnet_main_t *vnm, u32 hw_if_index)
clib_error_t * avf_device_init(vlib_main_t *vm, avf_main_t *am, avf_device_t *ad, avf_create_if_args_t *args)
vnet_main_t * vnet_get_main(void)
#define avf_log_warn(dev, f,...)
#define AVF_AQ_ENQ_SUSPEND_TIME
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)
static uword vlib_buffer_get_pa(vlib_main_t *vm, vlib_buffer_t *b)
virtchnl_vsi_type_t vsi_type
#define AVF_SEND_TO_PF_SUSPEND_TIME
void vlib_pci_device_close(vlib_main_t *vm, vlib_pci_dev_handle_t h)
virtchnl_vector_map_t vecmap[1]
#define clib_memcpy_fast(a, b, c)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
#define clib_ring_new_aligned(ring, size, align)
virtchnl_link_speed_t link_speed
static uword avf_dma_addr(vlib_main_t *vm, avf_device_t *ad, void *p)
static clib_error_t * vlib_physmem_last_error(struct vlib_main_t *vm)
clib_error_t * avf_aq_desc_enq(vlib_main_t *vm, avf_device_t *ad, avf_aq_desc_t *dt, void *data, int len)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
format_function_t format_avf_device
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
static void avf_irq_n_handler(vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 line)
struct virtchnl_pf_event_t::@33::@35 link_event_adv
clib_error_t * avf_init(vlib_main_t *vm)
clib_error_t * vlib_pci_enable_msix_irq(vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 start, u16 count)
clib_error_t * avf_rxq_init(vlib_main_t *vm, avf_device_t *ad, u16 qid, u16 rxq_size)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
#define ETHERNET_INTERFACE_FLAG_DEFAULT_L3
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
void avf_process_one_device(vlib_main_t *vm, avf_device_t *ad, int is_irq)
vnet_device_class_t avf_device_class
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define vlib_worker_thread_barrier_sync(X)
void avf_delete_if(vlib_main_t *vm, avf_device_t *ad, int with_barrier)
static vnet_sw_interface_t * vnet_get_hw_sw_interface(vnet_main_t *vnm, u32 hw_if_index)
static uword vlib_process_suspend(vlib_main_t *vm, f64 dt)
Suspend a vlib cooperative multi-tasking thread for a period of time.
vnet_hw_interface_rx_mode
#define AVF_RESET_SUSPEND_TIME
VNET_DEVICE_CLASS(af_xdp_device_class)
u8 * format_ethernet_address(u8 *s, va_list *args)
clib_error_t * vlib_pci_map_dma(vlib_main_t *vm, vlib_pci_dev_handle_t h, void *ptr)
#define VLIB_INIT_FUNCTION(x)
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...
#define AVF_SEND_TO_PF_MAX_WAIT_TIME
static uword pow2_mask(uword x)
static u32 avf_reg_read(avf_device_t *ad, u32 addr)
static_always_inline void vnet_device_input_set_interrupt_pending(vnet_main_t *vnm, u32 hw_if_index, u16 queue_id)
static void avf_irq_0_handler(vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 line)
vnet_hw_interface_flags_t flags
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define clib_error_return(e, args...)
static void avf_set_interface_next_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
static const char * virtchnl_event_names[]
vlib_pci_dev_handle_t pci_dev_handle
clib_error_t * avf_op_config_rss_lut(vlib_main_t *vm, avf_device_t *ad)
#define vlib_log_debug(...)
virtchnl_ether_addr_t list[1]
static void clib_spinlock_init(clib_spinlock_t *p)
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.
static u32 avf_flag_change(vnet_main_t *vnm, vnet_hw_interface_t *hw, u32 flags)
static heap_elt_t * first(heap_header_t *h)
virtchnl_eth_stats_t last_cleared_eth_stats
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
void vlib_pci_set_private_data(vlib_main_t *vm, vlib_pci_dev_handle_t h, uword private_data)
static u32 avf_get_u32(void *start, int offset)
#define AVF_RESET_MAX_WAIT_TIME
static void avf_clear_hw_interface_counters(u32 instance)
#define pool_put(P, E)
Free an object E in pool P.
#define vec_dup(V)
Return copy of vector (no header, no alignment)
static void avf_adminq_init(vlib_main_t *vm, avf_device_t *ad)
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)
#define VIRTCHNL_VERSION_MAJOR
uword vlib_pci_get_private_data(vlib_main_t *vm, vlib_pci_dev_handle_t h)
clib_error_t * avf_op_disable_vlan_stripping(vlib_main_t *vm, avf_device_t *ad)
static void avf_reg_flush(avf_device_t *ad)
u32 vlib_pci_dev_handle_t
vl_api_tunnel_mode_t mode
clib_error_t * avf_device_reset(vlib_main_t *vm, avf_device_t *ad)
#define PCI_DEVICE_ID_INTEL_X710_VF
clib_error_t * avf_op_config_irq_map(vlib_main_t *vm, avf_device_t *ad)
#define PCI_VENDOR_ID_INTEL
clib_error_t * avf_request_queues(vlib_main_t *vm, avf_device_t *ad, u16 num_queue_pairs)
static_always_inline u32 vlib_buffer_get_default_data_size(vlib_main_t *vm)
u32 vlib_pci_get_numa_node(vlib_main_t *vm, vlib_pci_dev_handle_t h)
#define VLIB_REGISTER_NODE(x,...)
static void vlib_physmem_free(vlib_main_t *vm, void *p)
vlib_node_registration_t avf_input_node
(constructor) VLIB_REGISTER_NODE (avf_input_node)
#define avf_log_debug(dev, f,...)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
vlib_log_class_t log_class
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
static void avf_irq_n_set_state(avf_device_t *ad, u8 line, avf_irq_state_t state)
#define ELOG_TYPE_DECLARE(f)
static_always_inline avf_device_t * avf_get_device(u32 dev_instance)
u32 per_interface_next_index
virtchnl_status_code_t v_retval
clib_error_t * avf_op_enable_queues(vlib_main_t *vm, avf_device_t *ad, u32 rx, u32 tx)
#define pool_put_index(p, i)
Free pool element with given index.
void vnet_hw_interface_assign_rx_thread(vnet_main_t *vnm, u32 hw_if_index, u16 queue_id, uword thread_index)
union virtchnl_pf_event_t::@33 event_data
#define AVFINT_DYN_CTLN(x)
struct virtchnl_pf_event_t::@33::@34 link_event
static void clib_mem_free(void *p)
clib_error_t * avf_txq_init(vlib_main_t *vm, avf_device_t *ad, u16 qid, u16 txq_size)
virtchnl_pf_event_t * events
virtchnl_event_codes_t event
#define AVF_AQ_ENQ_MAX_WAIT_TIME
static void avf_reg_write(avf_device_t *ad, u32 addr, u32 val)
static uword pointer_to_uword(const void *p)
static char * avf_tx_func_error_strings[]
virtchnl_eth_stats_t eth_stats
static vlib_main_t * vlib_get_main(void)
clib_error_t * avf_config_promisc_mode(vlib_main_t *vm, avf_device_t *ad, int is_enable)
#define PCI_DEVICE_ID_INTEL_X722_VF
clib_error_t * avf_op_config_rss_key(vlib_main_t *vm, avf_device_t *ad)
static u64 vlib_physmem_get_pa(vlib_main_t *vm, void *mem)
static u32 vlib_get_current_process_node_index(vlib_main_t *vm)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
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_cmd_rx_ctl_reg_write(vlib_main_t *vm, avf_device_t *ad, u32 reg, u32 val)
format_function_t format_avf_device_name
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
#define foreach_virtchnl_op
VLIB buffer representation.
#define foreach_avf_tx_func_error
#define clib_error_free(e)
clib_error_t * vlib_pci_map_region(vlib_main_t *vm, vlib_pci_dev_handle_t h, u32 resource, void **result)
clib_error_t * avf_op_get_stats(vlib_main_t *vm, avf_device_t *ad, virtchnl_eth_stats_t *es)
virtchnl_vsi_resource_t vsi_res[1]
int vnet_hw_interface_unassign_rx_thread(vnet_main_t *vnm, u32 hw_if_index, u16 queue_id)
int vlib_pci_supports_virtual_addr_dma(vlib_main_t *vm, vlib_pci_dev_handle_t h)
static void * clib_mem_alloc_aligned(uword size, uword align)
static uword avf_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
static u32 random_u32(u32 *seed)
32-bit random number generator
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
avf_per_thread_data_t * per_thread_data
static uword vlib_buffer_get_va(vlib_buffer_t *b)
static vlib_thread_main_t * vlib_get_thread_main()
vl_api_dhcp_client_state_t state
#define ETHERNET_MAX_PACKET_BYTES
#define vec_foreach(var, vec)
Vector iterator.
#define vlib_log_err(...)
#define CLIB_MEMORY_BARRIER()
static clib_error_t * avf_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
#define avf_log_err(dev, f,...)
#define pool_foreach_index(i, v, body)
Iterate pool by index.
#define CLIB_CACHE_LINE_BYTES
static clib_error_t * avf_interface_rx_mode_change(vnet_main_t *vnm, u32 hw_if_index, u32 qid, vnet_hw_interface_rx_mode mode)
#define VIRTCHNL_VERSION_MINOR
static u8 vlib_buffer_pool_get_default_for_numa(vlib_main_t *vm, u32 numa_node)
#define clib_ring_free(f)
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)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static void vnet_hw_interface_set_link_speed(vnet_main_t *vnm, u32 hw_if_index, u32 link_speed)
static void vnet_hw_interface_set_input_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
format_function_t format_vlib_pci_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.
u32 ethernet_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
static uword pool_elts(void *v)
Number of active elements in a pool.