|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
50 struct rte_eth_dev_info dev_info;
60 if (xd->
flags & DPDK_DEVICE_FLAG_ADMIN_UP)
67 if (xd->
pmd == VNET_DPDK_PMD_I40E)
69 if ((xd->
flags & DPDK_DEVICE_FLAG_RX_FLOW_OFFLOAD) != 0)
70 xd->
port_conf.fdir_conf.mode = RTE_FDIR_MODE_PERFECT;
72 xd->
port_conf.fdir_conf.mode = RTE_FDIR_MODE_NONE;
75 rte_eth_dev_info_get (xd->
port_id, &dev_info);
77 bitmap = xd->
port_conf.txmode.offloads & ~dev_info.tx_offload_capa;
80 dpdk_log_warn (
"unsupported tx offloads requested on port %u: %U",
85 bitmap = xd->
port_conf.rxmode.offloads & ~dev_info.rx_offload_capa;
88 dpdk_log_warn (
"unsupported rx offloads requested on port %u: %U",
113 rte_eth_tx_queue_setup (xd->
port_id, j,
139 SOCKET_ID_ANY, 0, mp);
150 rte_eth_dev_set_mtu (xd->
port_id,
hi->max_packet_bytes);
152 if (xd->
flags & DPDK_DEVICE_FLAG_ADMIN_UP)
161 xd->
flags |= DPDK_DEVICE_FLAG_PMD_INIT_FAIL;
197 if (rte_eth_dev_rx_intr_enable (xd->
port_id, 0))
199 dpdk_log_info (
"probe for interrupt mode for device %U. Failed.\n",
204 xd->
flags |= DPDK_DEVICE_FLAG_INT_SUPPORTED;
205 if (!(xd->
flags & DPDK_DEVICE_FLAG_INT_UNMASKABLE))
206 rte_eth_dev_rx_intr_disable (xd->
port_id, 0);
207 dpdk_log_info (
"Probe for interrupt mode for device %U. Success.\n",
211 if (xd->
flags & DPDK_DEVICE_FLAG_INT_SUPPORTED)
218 rxq->
efd = rte_eth_dev_rx_intr_ctl_q_get_fd (xd->
port_id, q);
221 xd->
flags &= ~DPDK_DEVICE_FLAG_INT_SUPPORTED;
227 f.file_descriptor = rxq->
efd;
234 if (xd->
flags & DPDK_DEVICE_FLAG_INT_UNMASKABLE)
251 if (xd->
flags & DPDK_DEVICE_FLAG_PMD_INIT_FAIL)
265 rv = rte_eth_dev_default_mac_addr_set (xd->
port_id,
271 if (xd->
flags & DPDK_DEVICE_FLAG_PROMISC)
272 rte_eth_promiscuous_enable (xd->
port_id);
274 rte_eth_promiscuous_disable (xd->
port_id);
276 rte_eth_allmulticast_enable (xd->
port_id);
285 if (xd->
flags & DPDK_DEVICE_FLAG_PMD_INIT_FAIL)
288 rte_eth_allmulticast_disable (xd->
port_id);
289 rte_eth_dev_stop (xd->
port_id);
300 enum rte_eth_event_type
type,
void *param)
302 struct rte_eth_link link;
304 RTE_SET_USED (param);
305 if (
type != RTE_ETH_EVENT_INTR_LSC)
311 rte_eth_link_get_nowait (port_id, &link);
312 u8 link_up = link.link_status;
315 port_id, (
unsigned) link.link_speed,
316 (link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
317 "full-duplex" :
"half-duplex");
326 enum rte_eth_event_type
type,
328 void *ret_param __attribute__ ((unused)))
334 struct rte_pci_device *
337 const struct rte_bus *
bus;
339 bus = rte_bus_find_by_device (info->device);
340 if (
bus && !strcmp (
bus->name,
"pci"))
341 return RTE_DEV_TO_PCI (info->device);
347 struct rte_vmbus_device *
350 const struct rte_bus *
bus;
352 bus = rte_bus_find_by_device (info->device);
353 if (
bus && !strcmp (
bus->name,
"vmbus"))
354 return container_of (info->device,
struct rte_vmbus_device, device);
static void clib_spinlock_init(clib_spinlock_t *p)
clib_file_main_t file_main
@ VNET_SW_INTERFACE_FLAG_ERROR
void dpdk_device_start(dpdk_device_t *xd)
struct rte_pci_device * dpdk_get_pci_device(const struct rte_eth_dev_info *info)
static_always_inline u8 vnet_hw_if_get_rx_queue_numa_node(vnet_main_t *vnm, u32 queue_index)
static_always_inline vnet_hw_if_rx_queue_t * vnet_hw_if_get_rx_queue(vnet_main_t *vnm, u32 queue_index)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define clib_error_return(e, args...)
static void dpdk_setup_interrupts(dpdk_device_t *xd)
@ VNET_HW_IF_RX_MODE_POLLING
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
void dpdk_device_setup(dpdk_device_t *xd)
int dpdk_port_state_callback(dpdk_portid_t port_id, enum rte_eth_event_type type, void *param, void *ret_param)
static_always_inline vlib_buffer_pool_t * vlib_get_buffer_pool(vlib_main_t *vm, u8 buffer_pool_index)
vnet_sw_interface_flags_t flags
#define dpdk_log_info(...)
dpdk_tx_queue_t * tx_queues
#define vec_elt(v, i)
Get vector value at index i.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define UNIX_FILE_EVENT_EDGE_TRIGGERED
struct rte_vmbus_device * dpdk_get_vmbus_device(const struct rte_eth_dev_info *info)
#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)
static_always_inline uword vlib_get_thread_index(void)
struct rte_eth_conf port_conf
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
#define dpdk_log_warn(...)
void vnet_hw_if_update_runtime_data(vnet_main_t *vnm, u32 hw_if_index)
struct rte_eth_txconf tx_conf
static_always_inline void vnet_hw_if_rx_queue_set_int_pending(vnet_main_t *vnm, u32 queue_index)
#define CLIB_CACHE_LINE_BYTES
void vnet_hw_if_set_rx_queue_file_index(vnet_main_t *vnm, u32 queue_index, u32 file_index)
@ UNIX_FILE_UPDATE_DELETE
struct rte_mempool ** dpdk_mempool_by_buffer_pool_index
#define dpdk_log_err(...)
static int dpdk_port_state_callback_inline(dpdk_portid_t port_id, enum rte_eth_event_type type, void *param)
description fragment has unexpected format
void dpdk_device_stop(dpdk_device_t *xd)
void dpdk_device_error(dpdk_device_t *xd, char *str, int rv)
static clib_error_t * dpdk_rx_read_ready(clib_file_t *uf)
static uword clib_file_add(clib_file_main_t *um, clib_file_t *template)
static u8 vlib_buffer_pool_get_default_for_numa(vlib_main_t *vm, u32 numa_node)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
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)
format_function_t format_dpdk_tx_offload_caps
@ VNET_HW_INTERFACE_CAP_SUPPORTS_INT_MODE
#define clib_error_free(e)
static vlib_thread_main_t * vlib_get_thread_main()
format_function_t format_dpdk_device_name
void vl_api_force_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
vl_api_fib_path_type_t type
format_function_t format_dpdk_rx_offload_caps
dpdk_rx_queue_t * rx_queues