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,
164 if (xd->
pmd == VNET_DPDK_PMD_ENIC)
166 struct rte_eth_dev_info dev_info;
175 "Cisco VIC mtu can only be changed " 176 "using CIMC then rebooting the server!");
187 rv = rte_eth_dev_configure
192 "rte_eth_dev_configure[%d]: err %d",
248 vlib_pci_addr_t last_pci_addr;
249 u32 last_pci_addr_port = 0;
254 u8 af_packet_port_id = 0;
255 last_pci_addr.as_u32 = ~0;
267 if (tr && tr->
count > 0)
279 nports = rte_eth_dev_count ();
286 clib_warning (
"DPDK drivers found %d ports...", nports);
301 for (i = 0; i < nports; i++)
306 struct rte_eth_dev_info dev_info;
308 struct rte_eth_link l;
310 vlib_pci_addr_t pci_addr;
313 rte_eth_dev_info_get (i, &dev_info);
314 if (dev_info.pci_dev)
316 pci_addr.domain = dev_info.pci_dev->addr.domain;
317 pci_addr.bus = dev_info.pci_dev->addr.bus;
318 pci_addr.slot = dev_info.pci_dev->addr.devid;
319 pci_addr.function = dev_info.pci_dev->addr.function;
337 if (dev_info.pci_dev)
339 struct rte_eth_dev_info di = { 0 };
340 rte_eth_dev_info_get (i + 1, &di);
341 if (di.pci_dev && pci_addr.as_u32 != last_pci_addr.as_u32 &&
342 memcmp (&dev_info.pci_dev->addr, &di.pci_dev->addr,
343 sizeof (
struct rte_pci_addr)) == 0)
346 last_pci_addr.as_u32 = pci_addr.as_u32;
347 last_pci_addr_port =
i;
349 else if (pci_addr.as_u32 == last_pci_addr.as_u32)
352 format (0,
"%u", i - last_pci_addr_port);
356 last_pci_addr.as_u32 = ~0;
360 last_pci_addr.as_u32 = ~0;
363 sizeof (
struct rte_eth_txconf));
366 xd->
tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
371 xd->
tx_conf.txq_flags &= ~ETH_TXQ_FLAGS_NOMULTSEGS;
376 sizeof (
struct rte_eth_conf));
380 if (devconf->num_tx_queues > 0
381 && devconf->num_tx_queues < xd->
tx_q_used)
384 if (devconf->num_rx_queues > 1 && dm->
use_rss == 0)
390 if (devconf->num_rx_queues > 1
391 && dev_info.max_rx_queues >= devconf->num_rx_queues)
394 xd->
port_conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
395 if (devconf->rss_fn == 0)
396 xd->
port_conf.rx_adv_conf.rss_conf.rss_hf =
397 ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP;
399 xd->
port_conf.rx_adv_conf.rss_conf.rss_hf = devconf->rss_fn;
407 if ((!dev_info.driver_name) && (dev_info.pci_dev))
408 dev_info.driver_name = dev_info.pci_dev->driver->name;
409 ASSERT (dev_info.driver_name);
415 #define _(s,f) else if (dev_info.driver_name && \ 416 !strcmp(dev_info.driver_name, s)) \ 417 xd->pmd = VNET_DPDK_PMD_##f; 429 case VNET_DPDK_PMD_E1000EM:
430 case VNET_DPDK_PMD_IGB:
431 case VNET_DPDK_PMD_IGBVF:
436 case VNET_DPDK_PMD_IXGBE:
437 case VNET_DPDK_PMD_IXGBEVF:
438 case VNET_DPDK_PMD_THUNDERX:
443 case VNET_DPDK_PMD_DPAA2:
448 case VNET_DPDK_PMD_ENIC:
449 rte_eth_link_get_nowait (i, &l);
451 if (l.link_speed == 40000)
464 case VNET_DPDK_PMD_I40E:
465 case VNET_DPDK_PMD_I40EVF:
470 switch (dev_info.pci_dev->id.device_id)
482 rte_eth_link_get_nowait (i, &l);
491 case VNET_DPDK_PMD_CXGBE:
492 switch (dev_info.pci_dev->id.device_id)
513 case VNET_DPDK_PMD_FM10K:
520 case VNET_DPDK_PMD_VIRTIO:
527 case VNET_DPDK_PMD_VMXNET3:
529 xd->
tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
532 case VNET_DPDK_PMD_AF_PACKET:
537 case VNET_DPDK_PMD_BOND:
545 if (devconf->num_rx_desc)
548 if (devconf->num_tx_desc)
563 xd->
port_conf.rxmode.max_rx_pkt_len = dev_info.max_rx_pktlen;
581 xd->
port_conf.rxmode.max_rx_pkt_len += 4;
585 #if RTE_VERSION < RTE_VERSION_NUM(16, 4, 0, 0) 589 if (xd->
pmd == VNET_DPDK_PMD_VMXNET3)
591 xd->
port_conf.rxmode.max_rx_pkt_len = 1518;
596 if (xd->
pmd == VNET_DPDK_PMD_AF_PACKET)
600 rnd = (
u32) (now * 1e6);
607 rte_eth_macaddr_get (i, (
struct ether_addr *) addr);
620 if (devconf->workers)
626 int cpu = dm->input_cpu_first_index + i;
627 unsigned lcore = vlib_worker_threads[cpu].dpdk_lcore_id;
628 vec_validate(xd->cpu_socket_id_by_queue, q);
629 xd->cpu_socket_id_by_queue[q] = rte_lcore_to_socket_id(lcore);
630 vec_add2(dm->devices_by_cpu[cpu], dq, 1);
631 dq->device = xd->device_index;
703 if (xd->
pmd == VNET_DPDK_PMD_ENIC)
720 vlan_off = rte_eth_dev_get_vlan_offload (xd->
device_index);
721 vlan_off |= ETH_VLAN_STRIP_OFFLOAD;
722 if (rte_eth_dev_set_vlan_offload (xd->
device_index, vlan_off) == 0)
725 clib_warning (
"VLAN strip cannot be supported by interface\n");
728 #if RTE_VERSION < RTE_VERSION_NUM(16, 4, 0, 0) 732 else if (xd->
pmd == VNET_DPDK_PMD_VMXNET3)
742 #ifdef RTE_LIBRTE_KNI 793 rnd = (
u32) (now * 1e6);
817 clib_warning (
"%d mbufs allocated but total rx/tx ring size is %d\n",
838 dpdk_device_config_t * devconf = 0;
839 c = &d->config0.header;
840 vec_reset_length (pci_addr);
841 pci_addr = format (pci_addr,
"%U%c", format_vlib_pci_addr, &d->bus_address, 0);
843 if (c->device_class != PCI_CLASS_NETWORK_ETHERNET)
848 uword * p = hash_get (conf->device_config_index_by_pci_addr, d->bus_address.as_u32);
853 devconf = pool_elt_at_index (conf->dev_confs, p[0]);
873 clib_warning (
"Unsupported Ethernet PCI device 0x%04x:0x%04x found " 874 "at PCI address %s\n", (u16) c->vendor_id, (u16) c->device_id,
890 devconf->is_blacklisted = 1;
923 "duplicate configuration for PCI address %U",
927 devconf->
pci_addr.as_u32 = pci_addr.as_u32;
934 if (
unformat (input,
"num-rx-queues %u", &devconf->num_rx_queues))
936 else if (
unformat (input,
"num-tx-queues %u", &devconf->num_tx_queues))
938 else if (
unformat (input,
"num-rx-desc %u", &devconf->num_rx_desc))
940 else if (
unformat (input,
"num-tx-desc %u", &devconf->num_tx_desc))
953 else if (
unformat (input,
"vlan-strip-offload off"))
955 else if (
unformat (input,
"vlan-strip-offload on"))
968 if (devconf->
workers && devconf->num_rx_queues == 0)
972 devconf->num_rx_queues)
975 "%U: number of worker threadds must be " 990 vlib_pci_addr_t pci_addr;
993 u8 *rte_cmd = 0, *ethname = 0;
996 int num_whitelisted = 0;
1011 if (
unformat (input,
"no-hugetlb"))
1017 else if (
unformat (input,
"enable-tcp-udp-checksum"))
1020 else if (
unformat (input,
"decimal-interface-names"))
1023 else if (
unformat (input,
"no-multi-seg"))
1063 else if (
unformat (input,
"socket-mem %s", &socket_mem))
1067 (input,
"vhost-user-coalesce-frames %d",
1072 (input,
"vhost-user-coalesce-time %f",
1075 else if (
unformat (input,
"enable-vhost-user"))
1077 else if (
unformat (input,
"no-pci"))
1080 tmp =
format (0,
"--no-pci%c", 0);
1087 else if (unformat(input, #a)) \ 1089 tmp = format (0, "--%s%c", #a, 0); \ 1090 vec_add1 (conf->eal_init_args, tmp); \ 1095 else if (unformat(input, #a " %s", &s)) \ 1097 if (!strncmp(#a, "huge-dir", 8)) \ 1099 else if (!strncmp(#a, "file-prefix", 11)) \ 1101 tmp = format (0, "--%s%c", #a, 0); \ 1102 vec_add1 (conf->eal_init_args, tmp); \ 1104 vec_add1 (conf->eal_init_args, s); \ 1109 else if (unformat(input, #a " %s", &s)) \ 1111 tmp = format (0, "-%s%c", #b, 0); \ 1112 vec_add1 (conf->eal_init_args, tmp); \ 1114 vec_add1 (conf->eal_init_args, s); \ 1119 else if (unformat(input, #a " %s", &s)) \ 1121 tmp = format (0, "-%s%c", #b, 0); \ 1122 vec_add1 (conf->eal_init_args, tmp); \ 1124 vec_add1 (conf->eal_init_args, s); \ 1125 conf->a##_set_manually = 1; \ 1129 else if (
unformat (input,
"default"))
1146 if (!no_huge && !huge_dir)
1148 u32 x, *mem_by_socket = 0;
1152 u8 less_than_1g = 1;
1187 vec_validate(mem_by_socket, c);
1188 mem_by_socket[c] = 256;
1198 u32 pages_avail, page_size, mem;
1201 char * numa_path =
"/sys/devices/system/node/node%u/";
1202 char * nonnuma_path =
"/sys/kernel/mm/";
1203 char * suffix =
"hugepages/hugepages-%ukB/free_hugepages%c";
1205 struct stat sb_numa, sb_nonnuma;
1207 p = format(p, numa_path, c);
1208 if (stat(numa_path, &sb_numa) < 0)
1209 sb_numa.st_mode = 0;
1211 if (stat(nonnuma_path, &sb_nonnuma) < 0)
1212 sb_nonnuma.st_mode = 0;
1214 if (S_ISDIR(sb_numa.st_mode)) {
1215 path = (char*)format((u8*)path,
"%s%s", p, suffix);
1216 }
else if (S_ISDIR(sb_nonnuma.st_mode)) {
1217 path = (char*)format((u8*)path,
"%s%s", nonnuma_path, suffix);
1226 mem = mem_by_socket[
c];
1230 s =
format (s, path, page_size * 1024, 0);
1234 if (page_size * pages_avail < mem)
1239 s =
format (s, path, page_size * 1024, 0);
1243 if (page_size * pages_avail < mem)
1252 if (mem_by_socket == 0)
1257 _vec_len (mem_by_socket) =
c + 1;
1261 socket_mem =
format (socket_mem,
"%s%u",
1262 socket_mem ?
"," :
"", mem_by_socket[x]);
1263 socket_mem =
format (socket_mem,
"%c", 0);
1268 if (rv && errno != EEXIST)
1276 if (rv && errno != EEXIST)
1283 if (use_1g && !(less_than_1g && use_2m))
1303 tmp =
format (0,
"--huge-dir%c", 0);
1309 tmp =
format (0,
"--file-prefix%c", 0);
1311 tmp =
format (0,
"vpp%c", 0);
1323 if (!conf->coremask_set_manually)
1326 uword *coremask = 0;
1332 for (i = 0; i <
vec_len (tm->registrations); i++)
1334 tr = tm->registrations[
i];
1339 conf->eal_init_args[1] = (
u8 *)
"-c";
1341 conf->eal_init_args[2] = tmp;
1345 if (!conf->nchannels_set_manually)
1348 conf->eal_init_args[3] = (
u8 *)
"-n";
1349 tmp =
format (0,
"%d", conf->nchannels);
1350 conf->eal_init_args[4] = tmp;
1353 if (no_pci == 0 && geteuid () == 0)
1357 if (devconf->x == 0 && conf->default_devconf.x > 0) \ 1358 devconf->x = conf->default_devconf.x ; 1364 foreach_dpdk_device_config_item
1367 if (num_whitelisted > 0 && devconf->is_blacklisted == 0)
1369 tmp = format (0,
"-w%c", 0);
1370 vec_add1 (conf->eal_init_args, tmp);
1371 tmp = format (0,
"%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
1372 vec_add1 (conf->eal_init_args, tmp);
1374 else if (num_whitelisted == 0 && devconf->is_blacklisted != 0)
1376 tmp = format (0,
"-b%c", 0);
1377 vec_add1 (conf->eal_init_args, tmp);
1378 tmp = format (0,
"%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
1379 vec_add1 (conf->eal_init_args, tmp);
1387 tmp =
format (0,
"--master-lcore%c", 0);
1388 vec_add1 (conf->eal_init_args, tmp);
1389 tmp =
format (0,
"%u%c", tm->main_lcore, 0);
1390 vec_add1 (conf->eal_init_args, tmp);
1393 tmp =
format (0,
"--socket-mem%c", 0);
1394 vec_add1 (conf->eal_init_args, tmp);
1395 tmp =
format (0,
"%s%c", socket_mem, 0);
1396 vec_add1 (conf->eal_init_args, tmp);
1400 _vec_len (conf->eal_init_args) -= 1;
1404 log_level = (CLIB_DEBUG > 0) ? RTE_LOG_DEBUG : RTE_LOG_NOTICE;
1406 rte_set_log_level (log_level);
1411 for (
i = 1;
i <
vec_len (conf->eal_init_args);
i++)
1412 conf->eal_init_args_str =
format (conf->eal_init_args_str,
"%s ",
1413 conf->eal_init_args[
i]);
1416 rte_eal_init (
vec_len (conf->eal_init_args),
1417 (
char **) conf->eal_init_args);
1426 fprintf (stdout,
"DPDK physical memory layout:\n");
1427 rte_dump_physmem_layout (stdout);
1434 for (
i = 0;
i < RTE_MAX_LCORE;
i++)
1437 rte_lcore_to_socket_id (
i));
1452 struct rte_eth_link prev_link = xd->
link;
1454 u8 hw_flags_chg = 0;
1461 memset (&xd->
link, 0, sizeof (xd->
link));
1470 "update-link-state: sw_if_index %d, admin_up %d," 1471 "old link_state %d new link_state %d",.format_args =
"i4i1i1i1",};
1483 ed->old_link_state = (
u8)
1485 ed->new_link_state = (
u8) xd->
link.link_status;
1489 ((xd->
link.link_status != 0) ^
1496 if (hw_flags_chg || (xd->
link.link_duplex != prev_link.link_duplex))
1499 switch (xd->
link.link_duplex)
1501 case ETH_LINK_HALF_DUPLEX:
1504 case ETH_LINK_FULL_DUPLEX:
1511 #if RTE_VERSION >= RTE_VERSION_NUM(16, 4, 0, 0) 1512 if (hw_flags_chg || (xd->
link.link_speed != prev_link.link_speed))
1515 switch (xd->
link.link_speed)
1517 case ETH_SPEED_NUM_10M:
1520 case ETH_SPEED_NUM_100M:
1523 case ETH_SPEED_NUM_1G:
1526 case ETH_SPEED_NUM_10G:
1529 case ETH_SPEED_NUM_40G:
1540 if (hw_flags_chg || (xd->
link.link_speed != prev_link.link_speed))
1543 switch (xd->
link.link_speed)
1545 case ETH_LINK_SPEED_10:
1548 case ETH_LINK_SPEED_100:
1551 case ETH_LINK_SPEED_1000:
1554 case ETH_LINK_SPEED_10000:
1557 case ETH_LINK_SPEED_40G:
1577 "update-link-state: sw_if_index %d, new flags %d",.format_args
1587 ed->flags = hw_flags;
1618 VLIB_NODE_STATE_POLLING);
1623 VLIB_NODE_STATE_POLLING);
1630 dpdk_vhost_user_process_init (&vu_state);
1648 int nports = rte_eth_dev_count ();
1651 for (i = 0; i < nports; i++)
1653 struct rte_eth_dev_info dev_info;
1654 rte_eth_dev_info_get (i, &dev_info);
1655 if (!dev_info.driver_name)
1656 dev_info.driver_name = dev_info.pci_dev->driver->name;
1657 ASSERT (dev_info.driver_name);
1658 if (strncmp (dev_info.driver_name,
"rte_bond_pmd", 12) == 0)
1662 int nlink = rte_eth_bond_slaves_get (i, slink, 16);
1670 rte_eth_macaddr_get (slink[0],
1671 (
struct ether_addr *) addr);
1674 rte_eth_bond_mac_address_set (i,
1675 (
struct ether_addr *)
1694 int slave = slink[--nlink];
1700 rte_eth_dev_mac_addr_add (slave,
1701 (
struct ether_addr *)
1745 if (dpdk_vhost_user_process_if (vm, xd, vu_state) != 0)
1752 dpdk_vhost_user_process_cleanup (vu_state);
1762 .name =
"dpdk-process",
1763 .process_log2_n_stack_bytes = 17,
1771 return (VNET_API_ERROR_INVALID_VALUE);
1782 return (VNET_API_ERROR_INVALID_VALUE);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#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)
u32 vhost_coalesce_frames
#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).
#define DPDK_EFD_DISABLED
#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.
vlib_buffer_main_t * buffer_main
u32 per_interface_next_index
u8 enable_tcp_udp_checksum
vlib_worker_thread_t * vlib_worker_threads
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)
#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.
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.
vlib_node_function_t * function
#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 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
void * dpdk_input_multiarch_select()
#define DPDK_NB_TX_DESC_40GE
#define I40E_DEV_ID_10G_BASE_T
f64 time_last_stats_update
u16 consec_full_frames_hi_thresh
vlib_main_t ** vlib_mains
ethernet_main_t ethernet_main
static struct rte_eth_conf port_conf_template
clib_error_t * dpdk_init(vlib_main_t *vm)
struct rte_eth_txconf tx_conf
#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 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)
u16 * cpu_socket_id_by_queue
#define DPDK_EFD_DEFAULT_DEVICE_QUEUE_HI_THRESH_PCT
#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)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
#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]
#define DPDK_TX_RING_SIZE
clib_error_t * vlib_sysfs_read(char *file_name, char *fmt,...)
void * dpdk_input_rss_multiarch_select()
#define DPDK_EFD_DEFAULT_CONSEC_FULL_FRAMES_HI_THRESH
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
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)
dpdk_device_type_t dev_type
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" )
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,...)
u32 dpdk_get_admin_up_down_in_progress(void)
#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...)
#define CLIB_CACHE_LINE_BYTES
ethernet_interface_t * interfaces
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