30 #include <sys/mount.h> 41 &rte_pktmbuf_pool_init,
44 #define LINK_STATE_ELOGS 0 46 #define DEFAULT_HUGE_DIR "/run/vpp/hugepages" 47 #define VPP_RUN_DIR "/run/vpp" 60 .mq_mode = ETH_MQ_TX_NONE,
168 if (xd->
pmd == VNET_DPDK_PMD_ENIC)
170 struct rte_eth_dev_info dev_info;
179 "Cisco VIC mtu can only be changed " 180 "using CIMC then rebooting the server!");
191 rv = rte_eth_dev_configure
196 "rte_eth_dev_configure[%d]: err %d",
249 vlib_pci_addr_t last_pci_addr;
250 u32 last_pci_addr_port = 0;
254 u32 next_cpu = 0, next_hqos_cpu = 0;
255 u8 af_packet_port_id = 0;
256 last_pci_addr.as_u32 = ~0;
265 if (tr && tr->
count > 0)
284 if (tr_hqos && tr_hqos->
count > 0)
297 if (rte_netmap_probe () < 0)
301 nports = rte_eth_dev_count ();
308 clib_warning (
"DPDK drivers found %d ports...", nports);
323 for (i = 0; i < nports; i++)
328 struct rte_eth_dev_info dev_info;
330 struct rte_eth_link l;
332 vlib_pci_addr_t pci_addr;
335 rte_eth_dev_info_get (i, &dev_info);
336 if (dev_info.pci_dev)
338 pci_addr.domain = dev_info.pci_dev->addr.domain;
339 pci_addr.bus = dev_info.pci_dev->addr.bus;
340 pci_addr.slot = dev_info.pci_dev->addr.devid;
341 pci_addr.function = dev_info.pci_dev->addr.function;
359 if (dev_info.pci_dev)
361 struct rte_eth_dev_info di = { 0 };
362 rte_eth_dev_info_get (i + 1, &di);
363 if (di.pci_dev && pci_addr.as_u32 != last_pci_addr.as_u32 &&
364 memcmp (&dev_info.pci_dev->addr, &di.pci_dev->addr,
365 sizeof (
struct rte_pci_addr)) == 0)
368 last_pci_addr.as_u32 = pci_addr.as_u32;
369 last_pci_addr_port =
i;
371 else if (pci_addr.as_u32 == last_pci_addr.as_u32)
374 format (0,
"%u", i - last_pci_addr_port);
378 last_pci_addr.as_u32 = ~0;
382 last_pci_addr.as_u32 = ~0;
385 sizeof (
struct rte_eth_txconf));
388 xd->
tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
393 xd->
tx_conf.txq_flags &= ~ETH_TXQ_FLAGS_NOMULTSEGS;
399 sizeof (
struct rte_eth_conf));
403 if (devconf->num_tx_queues > 0
404 && devconf->num_tx_queues < xd->
tx_q_used)
407 if (devconf->num_rx_queues > 1 && dm->
use_rss == 0)
412 if (devconf->num_rx_queues > 1
413 && dev_info.max_rx_queues >= devconf->num_rx_queues)
416 xd->
port_conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
417 if (devconf->rss_fn == 0)
418 xd->
port_conf.rx_adv_conf.rss_conf.rss_hf =
419 ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP;
421 xd->
port_conf.rx_adv_conf.rss_conf.rss_hf = devconf->rss_fn;
429 if ((!dev_info.driver_name) && (dev_info.pci_dev))
430 #if RTE_VERSION < RTE_VERSION_NUM(16, 11, 0, 0) 431 dev_info.driver_name = dev_info.pci_dev->driver->name;
433 dev_info.driver_name = dev_info.pci_dev->driver->driver.name;
435 ASSERT (dev_info.driver_name);
441 #define _(s,f) else if (dev_info.driver_name && \ 442 !strcmp(dev_info.driver_name, s)) \ 443 xd->pmd = VNET_DPDK_PMD_##f; 455 case VNET_DPDK_PMD_E1000EM:
456 case VNET_DPDK_PMD_IGB:
457 case VNET_DPDK_PMD_IGBVF:
462 case VNET_DPDK_PMD_IXGBE:
463 case VNET_DPDK_PMD_IXGBEVF:
464 case VNET_DPDK_PMD_THUNDERX:
469 case VNET_DPDK_PMD_DPAA2:
474 case VNET_DPDK_PMD_ENIC:
475 rte_eth_link_get_nowait (i, &l);
478 if (l.link_speed == 40000)
491 case VNET_DPDK_PMD_I40E:
492 case VNET_DPDK_PMD_I40EVF:
498 switch (dev_info.pci_dev->id.device_id)
510 rte_eth_link_get_nowait (i, &l);
519 case VNET_DPDK_PMD_CXGBE:
520 switch (dev_info.pci_dev->id.device_id)
541 case VNET_DPDK_PMD_FM10K:
548 case VNET_DPDK_PMD_VIRTIO:
555 case VNET_DPDK_PMD_VMXNET3:
557 xd->
tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
560 case VNET_DPDK_PMD_AF_PACKET:
565 case VNET_DPDK_PMD_BOND:
574 if (devconf->num_rx_desc)
577 if (devconf->num_tx_desc)
592 xd->
port_conf.rxmode.max_rx_pkt_len = dev_info.max_rx_pktlen;
610 xd->
port_conf.rxmode.max_rx_pkt_len += 4;
614 if (xd->
pmd == VNET_DPDK_PMD_AF_PACKET)
618 rnd = (
u32) (now * 1e6);
625 rte_eth_macaddr_get (i, (
struct ether_addr *) addr);
638 if (devconf->workers)
644 int cpu = dm->input_cpu_first_index + i;
645 unsigned lcore = vlib_worker_threads[cpu].lcore_id;
646 vec_validate(xd->cpu_socket_id_by_queue, q);
647 xd->cpu_socket_id_by_queue[q] = rte_lcore_to_socket_id(lcore);
648 vec_add2(dm->devices_by_cpu[cpu], dq, 1);
649 dq->device = xd->device_index;
680 if (devconf->hqos_enabled)
684 if (devconf->hqos.hqos_thread_valid)
710 devconf->hqos.hqos_thread_valid = 1;
711 devconf->hqos.hqos_thread = cpu;
741 if (devconf->hqos_enabled)
767 if (xd->
pmd == VNET_DPDK_PMD_ENIC)
784 vlan_off = rte_eth_dev_get_vlan_offload (xd->
device_index);
785 vlan_off |= ETH_VLAN_STRIP_OFFLOAD;
786 xd->
port_conf.rxmode.hw_vlan_strip = vlan_off;
787 if (rte_eth_dev_set_vlan_offload (xd->
device_index, vlan_off) == 0)
790 clib_warning (
"VLAN strip cannot be supported by interface\n");
800 clib_warning (
"%d mbufs allocated but total rx/tx ring size is %d\n",
817 dpdk_device_config_t * devconf = 0;
818 vec_reset_length (pci_addr);
819 pci_addr = format (pci_addr,
"%U%c", format_vlib_pci_addr, &d->bus_address, 0);
821 if (d->device_class != PCI_CLASS_NETWORK_ETHERNET)
826 uword * p = hash_get (conf->device_config_index_by_pci_addr, d->bus_address.as_u32);
831 devconf = pool_elt_at_index (conf->dev_confs, p[0]);
851 clib_warning (
"Unsupported Ethernet PCI device 0x%04x:0x%04x found " 852 "at PCI address %s\n", (u16) d->vendor_id, (u16) d->device_id,
868 devconf->is_blacklisted = 1;
901 "duplicate configuration for PCI address %U",
905 devconf->
pci_addr.as_u32 = pci_addr.as_u32;
915 if (
unformat (input,
"num-rx-queues %u", &devconf->num_rx_queues))
917 else if (
unformat (input,
"num-tx-queues %u", &devconf->num_tx_queues))
919 else if (
unformat (input,
"num-rx-desc %u", &devconf->num_rx_desc))
921 else if (
unformat (input,
"num-tx-desc %u", &devconf->num_tx_desc))
934 else if (
unformat (input,
"vlan-strip-offload off"))
936 else if (
unformat (input,
"vlan-strip-offload on"))
962 if (devconf->
workers && devconf->num_rx_queues == 0)
966 devconf->num_rx_queues)
969 "%U: number of worker threadds must be " 984 vlib_pci_addr_t pci_addr;
987 u8 *rte_cmd = 0, *ethname = 0;
990 int num_whitelisted = 0;
1002 if (
unformat (input,
"no-hugetlb"))
1008 else if (
unformat (input,
"enable-tcp-udp-checksum"))
1011 else if (
unformat (input,
"decimal-interface-names"))
1014 else if (
unformat (input,
"no-multi-seg"))
1054 else if (
unformat (input,
"socket-mem %s", &socket_mem))
1056 else if (
unformat (input,
"no-pci"))
1059 tmp =
format (0,
"--no-pci%c", 0);
1066 else if (unformat(input, #a)) \ 1068 tmp = format (0, "--%s%c", #a, 0); \ 1069 vec_add1 (conf->eal_init_args, tmp); \ 1074 else if (unformat(input, #a " %s", &s)) \ 1076 if (!strncmp(#a, "huge-dir", 8)) \ 1078 else if (!strncmp(#a, "file-prefix", 11)) \ 1080 tmp = format (0, "--%s%c", #a, 0); \ 1081 vec_add1 (conf->eal_init_args, tmp); \ 1083 vec_add1 (conf->eal_init_args, s); \ 1088 else if (unformat(input, #a " %s", &s)) \ 1090 tmp = format (0, "-%s%c", #b, 0); \ 1091 vec_add1 (conf->eal_init_args, tmp); \ 1093 vec_add1 (conf->eal_init_args, s); \ 1098 else if (unformat(input, #a " %s", &s)) \ 1100 tmp = format (0, "-%s%c", #b, 0); \ 1101 vec_add1 (conf->eal_init_args, tmp); \ 1103 vec_add1 (conf->eal_init_args, s); \ 1104 conf->a##_set_manually = 1; \ 1108 else if (
unformat (input,
"default"))
1127 if (!no_huge && !huge_dir)
1129 u32 x, *mem_by_socket = 0;
1133 u8 less_than_1g = 1;
1168 vec_validate(mem_by_socket, c);
1169 mem_by_socket[c] = 256;
1179 int pages_avail, page_size, mem;
1181 vec_validate(mem_by_socket, c);
1182 mem = mem_by_socket[c];
1185 pages_avail = vlib_sysfs_get_free_hugepages(c, page_size * 1024);
1187 if (pages_avail < 0 || page_size * pages_avail < mem)
1191 pages_avail = vlib_sysfs_get_free_hugepages(c, page_size * 1024);
1193 if (pages_avail < 0 || page_size * pages_avail < mem)
1198 if (mem_by_socket == 0)
1203 _vec_len (mem_by_socket) = c + 1;
1207 socket_mem =
format (socket_mem,
"%s%u",
1208 socket_mem ?
"," :
"", mem_by_socket[x]);
1209 socket_mem =
format (socket_mem,
"%c", 0);
1214 if (rv && errno != EEXIST)
1222 if (rv && errno != EEXIST)
1229 if (use_1g && !(less_than_1g && use_2m))
1249 tmp =
format (0,
"--huge-dir%c", 0);
1255 tmp =
format (0,
"--file-prefix%c", 0);
1257 tmp =
format (0,
"vpp%c", 0);
1272 uword *coremask = 0;
1299 if (no_pci == 0 && geteuid () == 0)
1303 if (devconf->x == 0 && conf->default_devconf.x > 0) \ 1304 devconf->x = conf->default_devconf.x ; 1310 foreach_dpdk_device_config_item
1313 if (num_whitelisted > 0 && devconf->is_blacklisted == 0)
1315 tmp = format (0,
"-w%c", 0);
1316 vec_add1 (conf->eal_init_args, tmp);
1317 tmp = format (0,
"%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
1318 vec_add1 (conf->eal_init_args, tmp);
1322 tmp = format (0,
"-b%c", 0);
1323 vec_add1 (conf->eal_init_args, tmp);
1324 tmp = format (0,
"%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
1325 vec_add1 (conf->eal_init_args, tmp);
1333 tmp =
format (0,
"--master-lcore%c", 0);
1334 vec_add1 (conf->eal_init_args, tmp);
1335 tmp =
format (0,
"%u%c", tm->main_lcore, 0);
1336 vec_add1 (conf->eal_init_args, tmp);
1339 tmp =
format (0,
"--socket-mem%c", 0);
1340 vec_add1 (conf->eal_init_args, tmp);
1341 tmp =
format (0,
"%s%c", socket_mem, 0);
1342 vec_add1 (conf->eal_init_args, tmp);
1346 _vec_len (conf->eal_init_args) -= 1;
1350 log_level = (CLIB_DEBUG > 0) ? RTE_LOG_DEBUG : RTE_LOG_NOTICE;
1352 rte_set_log_level (log_level);
1357 for (
i = 1;
i <
vec_len (conf->eal_init_args);
i++)
1358 conf->eal_init_args_str =
format (conf->eal_init_args_str,
"%s ",
1359 conf->eal_init_args[
i]);
1362 rte_eal_init (
vec_len (conf->eal_init_args),
1363 (
char **) conf->eal_init_args);
1372 fprintf (stdout,
"DPDK physical memory layout:\n");
1373 rte_dump_physmem_layout (stdout);
1380 for (
i = 0;
i < RTE_MAX_LCORE;
i++)
1383 rte_lcore_to_socket_id (
i));
1398 struct rte_eth_link prev_link = xd->
link;
1400 u8 hw_flags_chg = 0;
1407 memset (&xd->
link, 0, sizeof (xd->
link));
1416 "update-link-state: sw_if_index %d, admin_up %d," 1417 "old link_state %d new link_state %d",.format_args =
"i4i1i1i1",};
1429 ed->old_link_state = (
u8)
1431 ed->new_link_state = (
u8) xd->
link.link_status;
1435 ((xd->
link.link_status != 0) ^
1442 if (hw_flags_chg || (xd->
link.link_duplex != prev_link.link_duplex))
1445 switch (xd->
link.link_duplex)
1447 case ETH_LINK_HALF_DUPLEX:
1450 case ETH_LINK_FULL_DUPLEX:
1457 if (hw_flags_chg || (xd->
link.link_speed != prev_link.link_speed))
1460 switch (xd->
link.link_speed)
1462 case ETH_SPEED_NUM_10M:
1465 case ETH_SPEED_NUM_100M:
1468 case ETH_SPEED_NUM_1G:
1471 case ETH_SPEED_NUM_10G:
1474 case ETH_SPEED_NUM_40G:
1493 "update-link-state: sw_if_index %d, new flags %d",.format_args
1503 ed->flags = hw_flags;
1531 VLIB_NODE_STATE_POLLING);
1536 VLIB_NODE_STATE_POLLING);
1557 int nports = rte_eth_dev_count ();
1560 for (i = 0; i < nports; i++)
1562 struct rte_eth_dev_info dev_info;
1563 rte_eth_dev_info_get (i, &dev_info);
1564 if (!dev_info.driver_name)
1565 #if RTE_VERSION < RTE_VERSION_NUM(16, 11, 0, 0) 1566 dev_info.driver_name = dev_info.pci_dev->driver->name;
1568 dev_info.driver_name = dev_info.pci_dev->driver->driver.name;
1570 ASSERT (dev_info.driver_name);
1571 if (strncmp (dev_info.driver_name,
"rte_bond_pmd", 12) == 0)
1575 int nlink = rte_eth_bond_slaves_get (i, slink, 16);
1583 rte_eth_macaddr_get (slink[0],
1584 (
struct ether_addr *) addr);
1587 rte_eth_bond_mac_address_set (i,
1588 (
struct ether_addr *)
1608 int slave = slink[--nlink];
1614 rte_eth_dev_mac_addr_add (slave,
1615 (
struct ether_addr *)
1678 .name =
"dpdk-process",
1679 .process_log2_n_stack_bytes = 17,
1687 return (VNET_API_ERROR_INVALID_VALUE);
1698 return (VNET_API_ERROR_INVALID_VALUE);
1715 "Cache line marker must be 1st element in dpdk_device_t");
1718 "Data in cache line 0 is bigger than cache line size");
1720 "Cache line marker must be 1st element in dpdk_worker_t");
1722 "Cache line marker must be 1st element in frame_queue_trace_t");
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define DPDK_DEVICE_FLAG_PROMISC
#define DPDK_NB_TX_DESC_10GE
f64 time_last_link_update
static u8 * format_bitmap_hex(u8 *s, va_list *args)
Format a bitmap as a string of hex bytes.
format_function_t format_vlib_pci_addr
#define vec_foreach_index(var, v)
Iterate over vector indices.
#define hash_set(h, key, value)
sll srl srl sll sra u16x4 i
u32 vlib_buffer_get_or_create_free_list(vlib_main_t *vm, u32 n_data_bytes, char *fmt,...)
#define VNET_HW_INTERFACE_FLAG_SPEED_1G
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
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...
u8 interface_name_format_decimal
static vlib_main_t * vlib_get_main(void)
static clib_error_t * dpdk_lib_init(dpdk_main_t *dm)
vnet_device_class_t dpdk_device_class
static u32 dpdk_flag_change(vnet_main_t *vnm, vnet_hw_interface_t *hi, u32 flags)
#define DPDK_DEVICE_VLAN_STRIP_OFF
#define I40E_DEV_ID_QSFP_B
clib_error_t * vlib_pci_bind_to_uio(vlib_pci_device_t *d, char *uio_driver_name)
static f64 vlib_time_now(vlib_main_t *vm)
#define vec_add2_aligned(V, P, N, A)
Add N elements to end of vector V, return pointer to new elements in P.
static uword * clib_bitmap_or(uword *ai, uword *bi)
Logical operator across two bitmaps.
uword unformat_vlib_cli_sub_input(unformat_input_t *i, va_list *args)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
dpdk_device_and_queue_t ** devices_by_hqos_cpu
#define DPDK_NB_RX_DESC_VIRTIO
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define DPDK_DEVICE_FLAG_HQOS
vlib_buffer_main_t * buffer_main
u32 per_interface_next_index
u8 enable_tcp_udp_checksum
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. ...
#define DPDK_DEVICE_VLAN_STRIP_ON
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * dpdk_config(vlib_main_t *vm, unformat_input_t *input)
#define DPDK_NB_TX_DESC_DEFAULT
#define clib_error_report(e)
#define foreach_eal_double_hyphen_predicate_arg
unformat_function_t unformat_vlib_pci_addr
#define VNET_HW_INTERFACE_FLAG_LINK_UP
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
dpdk_device_config_hqos_t hqos
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
vlib_pci_addr_t bus_address
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define DPDK_DEVICE_FLAG_PMD
clib_error_t * vlib_buffer_pool_create(vlib_main_t *vm, unsigned num_mbufs, unsigned socket_id)
#define I40E_DEV_ID_QSFP_A
static vnet_sw_interface_t * vnet_get_hw_sw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_main_t * vnet_get_main(void)
#define I40E_DEV_ID_SFP_XL710
struct rte_mbuf *** tx_vectors
foreach_dpdk_device_config_item clib_bitmap_t * workers
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
dpdk_config_main_t dpdk_config_main
#define I40E_DEV_ID_QSFP_C
vlib_node_registration_t dpdk_input_node
(constructor) VLIB_REGISTER_NODE (dpdk_input_node)
dpdk_device_config_t default_devconf
#define IP_BUFFER_L4_CHECKSUM_CORRECT
int input_cpu_first_index
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define clib_warning(format, args...)
#define DPDK_DEVICE_FLAG_MAYBE_MULTISEG
#define vlib_call_init_function(vm, x)
clib_error_t * unformat_rss_fn(unformat_input_t *input, uword *rss_fn)
#define DPDK_NB_TX_DESC_VIRTIO
struct rte_eth_conf port_conf
#define DPDK_NB_TX_DESC_40GE
#define I40E_DEV_ID_10G_BASE_T
f64 time_last_stats_update
ethernet_main_t ethernet_main
dpdk_hqos_thread_t * hqos_threads
static struct rte_eth_conf port_conf_template
clib_error_t * dpdk_init(vlib_main_t *vm)
struct rte_eth_txconf tx_conf
vlib_worker_thread_t * vlib_worker_threads
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define vec_insert(V, N, M)
Insert N vector elements starting at element M, initialize new elements to zero (no header...
#define foreach_eal_double_hyphen_arg
#define VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES
dpdk_device_and_queue_t ** devices_by_cpu
#define ETHERNET_INTERFACE_FLAG_CONFIG_MTU(flags)
#define VNET_HW_INTERFACE_FLAG_SPEED_10M
#define VNET_SW_INTERFACE_FLAG_BOND_SLAVE
#define foreach_eal_single_hyphen_mandatory_arg
vlib_pci_device_t * pci_devs
int dpdk_set_link_state_poll_interval(f64 interval)
#define VNET_HW_INTERFACE_FLAG_HALF_DUPLEX
uword os_get_cpu_number(void)
static vlib_node_registration_t dpdk_process_node
(constructor) VLIB_REGISTER_NODE (dpdk_process_node)
dpdk_port_type_t port_type
static uword dpdk_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
#define VLIB_CONFIG_FUNCTION(x, n,...)
#define DPDK_MIN_STATS_POLL_INTERVAL
void * vlib_weakly_linked_functions[]
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static clib_error_t * dpdk_device_config(dpdk_config_main_t *conf, vlib_pci_addr_t pci_addr, unformat_input_t *input, u8 is_default)
#define DPDK_DEVICE_FLAG_ADMIN_UP
#define VNET_HW_INTERFACE_BOND_INFO_SLAVE
#define foreach_eal_single_hyphen_arg
int dpdk_set_stat_poll_interval(f64 interval)
#define DPDK_NB_RX_DESC_DEFAULT
static void dpdk_update_counters(dpdk_device_t *xd, f64 now)
u8 nchannels_set_manually
u16 * cpu_socket_id_by_queue
#define vec_free(V)
Free vector's memory (no header).
dpdk_device_config_t * dev_confs
static vlib_thread_main_t * vlib_get_thread_main()
struct rte_mbuf *** rx_vectors
void dpdk_device_lock_free(dpdk_device_t *xd)
#define clib_memcpy(a, b, c)
#define DPDK_NB_RX_DESC_ENIC
#define VLIB_BUFFER_TOTAL_LENGTH_VALID
static void dpdk_bind_devices_to_uio(dpdk_config_main_t *conf)
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
#define ELOG_TYPE_DECLARE(f)
clib_error_t * dpdk_port_setup(dpdk_main_t *dm, dpdk_device_t *xd)
#define VNET_HW_INTERFACE_FLAG_SPEED_10G
#define vec_validate_ha(V, I, H, A)
Make sure vector is long enough for given index (general version).
u8 * interface_name_suffix
void dpdk_update_link_state(dpdk_device_t *xd, f64 now)
#define hash_create(elts, value_bytes)
#define VNET_HW_INTERFACE_FLAG_FULL_DUPLEX
u32 max_l3_packet_bytes[VLIB_N_RX_TX]
void dpdk_device_config_hqos_default(dpdk_device_config_hqos_t *hqos)
#define DPDK_DEVICE_FLAG_PMD_SUPPORTS_PTYPE
static void clib_mem_free(void *p)
Bitmaps built as vectors of machine words.
clib_error_t * ethernet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u8 *address, u32 *hw_if_index_return, ethernet_flag_change_function_t flag_change)
#define clib_bitmap_free(v)
Free a bitmap.
static void vlib_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
Set node dispatch state.
#define DPDK_LINK_POLL_INTERVAL
uword * thread_registrations_by_name
#define DPDK_NB_RX_DESC_10GE
clib_error_t * dpdk_port_setup_hqos(dpdk_device_t *xd, dpdk_device_config_hqos_t *hqos)
static uword clib_bitmap_count_set_bits(uword *ai)
Return the number of set bits in a bitmap.
#define IP_BUFFER_L4_CHECKSUM_COMPUTED
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
#define DPDK_STATS_POLL_INTERVAL
#define VNET_HW_INTERFACE_FLAG_SPEED_100M
u32 ethernet_input_node_index
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u8 admin_up_down_in_progress
#define STATIC_ASSERT(truth,...)
static uword unformat_bitmap_list(unformat_input_t *input, va_list *va)
unformat a list of bit ranges into a bitmap (eg "0-3,5-7,11" )
vlib_main_t ** vlib_mains
void dpdk_device_lock_init(dpdk_device_t *xd)
#define DPDK_MIN_LINK_POLL_INTERVAL
#define hash_get_mem(h, key)
u32 buffer_flags_template
static void * clib_mem_alloc_aligned(uword size, uword align)
static u32 random_u32(u32 *seed)
32-bit random number generator
#define VNET_HW_INTERFACE_FLAG_SPEED_40G
u32 vlib_buffer_free_list_index
#define VLIB_REGISTER_NODE(x,...)
#define VNET_BUFFER_RTE_MBUF_VALID
#define ETHERNET_MAX_PACKET_BYTES
#define vec_foreach(var, vec)
Vector iterator.
#define ETHERNET_INTERFACE_FLAG_CONFIG_PROMISC(flags)
uword * cpu_socket_bitmap
#define clib_error_return(e, args...)
vlib_thread_registration_t ** registrations
#define CLIB_CACHE_LINE_BYTES
ethernet_interface_t * interfaces
clib_error_t * unformat_hqos(unformat_input_t *input, dpdk_device_config_hqos_t *hqos)
uword * device_config_index_by_pci_addr
static uword vnet_hw_interface_is_link_up(vnet_main_t *vnm, u32 hw_if_index)
volatile u32 worker_thread_release
#define DPDK_NB_RX_DESC_40GE
uword * dpdk_device_by_kni_port_id
uword * vu_sw_if_index_by_listener_fd
f64 link_state_poll_interval
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
clib_error_t * dpdk_cli_init(vlib_main_t *vm)
dpdk_config_main_t * conf
uword * vu_sw_if_index_by_sock_fd