30 #include <sys/mount.h> 52 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 55 #define vl_api_version(n,v) static u32 api_version=(v); 62 vl_print (handle, (char *)s); \ 91 rv = rte_sched_pipe_config (xd->
hqos_ht->
hqos, subport, pipe, profile);
95 REPLY_MACRO (VL_API_SW_INTERFACE_SET_DPDK_HQOS_PIPE_REPLY);
103 s =
format (0,
"SCRIPT: sw_interface_set_dpdk_hqos_pipe ");
107 s =
format (s,
"subport %u pipe %u profile %u ",
122 struct rte_sched_subport_params p;
126 p.tb_rate = ntohl (mp->
tb_rate);
127 p.tb_size = ntohl (mp->
tb_size);
128 p.tc_rate[0] = ntohl (mp->
tc_rate[0]);
129 p.tc_rate[1] = ntohl (mp->
tc_rate[1]);
130 p.tc_rate[2] = ntohl (mp->
tc_rate[2]);
131 p.tc_rate[3] = ntohl (mp->
tc_rate[3]);
143 rv = rte_sched_subport_config (xd->
hqos_ht->
hqos, subport, &p);
147 REPLY_MACRO (VL_API_SW_INTERFACE_SET_DPDK_HQOS_SUBPORT_REPLY);
155 s =
format (0,
"SCRIPT: sw_interface_set_dpdk_hqos_subport ");
161 "subport %u rate %u bkt_size %u tc0 %u tc1 %u tc2 %u tc3 %u period %u",
183 u32 tc = ntohl (mp->
tc);
196 if (tc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE)
199 rv = VNET_API_ERROR_INVALID_VALUE;
202 if (queue >= RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS)
205 rv = VNET_API_ERROR_INVALID_VALUE;
215 rv = VNET_API_ERROR_INVALID_VALUE_2;
221 int worker_thread_count = tr->
count;
223 val = tc * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + queue;
224 for (i = 0; i < worker_thread_count; i++)
230 REPLY_MACRO (VL_API_SW_INTERFACE_SET_DPDK_HQOS_TCTBL_REPLY);
238 s =
format (0,
"SCRIPT: sw_interface_set_dpdk_hqos_tctbl ");
242 s =
format (s,
"entry %u tc %u queue %u",
248 #define foreach_dpdk_plugin_api_msg \ 249 _(SW_INTERFACE_SET_DPDK_HQOS_PIPE, sw_interface_set_dpdk_hqos_pipe) \ 250 _(SW_INTERFACE_SET_DPDK_HQOS_SUBPORT, sw_interface_set_dpdk_hqos_subport) \ 251 _(SW_INTERFACE_SET_DPDK_HQOS_TCTBL, sw_interface_set_dpdk_hqos_tctbl) 259 vl_msg_api_set_handlers((VL_API_##N + dm->msg_id_base), \ 261 vl_api_##n##_t_handler, \ 263 vl_api_##n##_t_endian, \ 264 vl_api_##n##_t_print, \ 265 sizeof(vl_api_##n##_t), 1); 271 #define vl_msg_name_crc_list 273 #undef vl_msg_name_crc_list 278 #define _(id,n,crc) \ 279 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + dm->msg_id_base); 280 foreach_vl_msg_name_crc_dpdk;
298 &rte_pktmbuf_pool_init,
301 #define LINK_STATE_ELOGS 0 303 #define DEFAULT_HUGE_DIR "/run/vpp/hugepages" 304 #define VPP_RUN_DIR "/run/vpp" 317 .mq_mode = ETH_MQ_TX_NONE,
386 rv = rte_eth_dev_default_mac_addr_set (xd->
device_index,
387 (
struct ether_addr *)
429 rv = rte_eth_dev_configure
434 "rte_eth_dev_configure[%d]: err %d",
443 rv = rte_eth_dev_default_mac_addr_set (xd->
device_index,
444 (
struct ether_addr *)
491 vlib_pci_addr_t last_pci_addr;
492 u32 last_pci_addr_port = 0;
496 u32 next_cpu = 0, next_hqos_cpu = 0;
497 u8 af_packet_port_id = 0;
498 u8 bond_ether_port_id = 0;
499 last_pci_addr.as_u32 = ~0;
508 if (tr && tr->
count > 0)
524 if (tr_hqos && tr_hqos->
count > 0)
533 nports = rte_eth_dev_count ();
540 clib_warning (
"DPDK drivers found %d ports...", nports);
570 for (i = 0; i < nports; i++)
575 struct rte_eth_dev_info dev_info;
577 struct rte_eth_link l;
579 vlib_pci_addr_t pci_addr;
582 rte_eth_dev_info_get (i, &dev_info);
583 if (dev_info.pci_dev)
585 pci_addr.domain = dev_info.pci_dev->addr.domain;
586 pci_addr.bus = dev_info.pci_dev->addr.bus;
587 pci_addr.slot = dev_info.pci_dev->addr.devid;
588 pci_addr.function = dev_info.pci_dev->addr.function;
606 if (dev_info.pci_dev)
608 struct rte_eth_dev_info di = { 0 };
609 rte_eth_dev_info_get (i + 1, &di);
610 if (di.pci_dev && pci_addr.as_u32 != last_pci_addr.as_u32 &&
611 memcmp (&dev_info.pci_dev->addr, &di.pci_dev->addr,
612 sizeof (
struct rte_pci_addr)) == 0)
615 last_pci_addr.as_u32 = pci_addr.as_u32;
616 last_pci_addr_port =
i;
618 else if (pci_addr.as_u32 == last_pci_addr.as_u32)
621 format (0,
"%u", i - last_pci_addr_port);
625 last_pci_addr.as_u32 = ~0;
629 last_pci_addr.as_u32 = ~0;
632 sizeof (
struct rte_eth_txconf));
635 xd->
tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
636 port_conf_template.rxmode.jumbo_frame = 0;
637 port_conf_template.rxmode.enable_scatter = 0;
641 xd->
tx_conf.txq_flags &= ~ETH_TXQ_FLAGS_NOMULTSEGS;
642 port_conf_template.rxmode.jumbo_frame = 1;
643 port_conf_template.rxmode.enable_scatter = 1;
648 sizeof (
struct rte_eth_conf));
652 if (devconf->num_tx_queues > 0
653 && devconf->num_tx_queues < xd->
tx_q_used)
656 if (devconf->num_rx_queues > 1 && dm->
use_rss == 0)
661 if (devconf->num_rx_queues > 1
662 && dev_info.max_rx_queues >= devconf->num_rx_queues)
665 xd->
port_conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
666 if (devconf->rss_fn == 0)
667 xd->
port_conf.rx_adv_conf.rss_conf.rss_hf =
668 ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP;
670 xd->
port_conf.rx_adv_conf.rss_conf.rss_hf = devconf->rss_fn;
678 if ((!dev_info.driver_name) && (dev_info.pci_dev))
679 dev_info.driver_name = dev_info.pci_dev->driver->driver.name;
681 ASSERT (dev_info.driver_name);
687 #define _(s,f) else if (dev_info.driver_name && \ 688 !strcmp(dev_info.driver_name, s)) \ 689 xd->pmd = VNET_DPDK_PMD_##f; 704 case VNET_DPDK_PMD_E1000EM:
705 case VNET_DPDK_PMD_IGB:
706 case VNET_DPDK_PMD_IGBVF:
711 case VNET_DPDK_PMD_IXGBE:
712 case VNET_DPDK_PMD_IXGBEVF:
713 case VNET_DPDK_PMD_THUNDERX:
716 case VNET_DPDK_PMD_DPAA2:
721 case VNET_DPDK_PMD_ENIC:
722 rte_eth_link_get_nowait (i, &l);
724 if (l.link_speed == 40000)
731 case VNET_DPDK_PMD_I40E:
732 case VNET_DPDK_PMD_I40EVF:
736 switch (dev_info.pci_dev->id.device_id)
748 rte_eth_link_get_nowait (i, &l);
757 case VNET_DPDK_PMD_CXGBE:
758 switch (dev_info.pci_dev->id.device_id)
772 case VNET_DPDK_PMD_MLX5:
774 char *pn_100g[] = {
"MCX415A-CCAT",
"MCX416A-CCAT", 0 };
775 char *pn_40g[] = {
"MCX413A-BCAT",
"MCX414A-BCAT",
776 "MCX415A-BCAT",
"MCX416A-BCAT",
"MCX4131A-BCAT", 0
778 char *pn_10g[] = {
"MCX4111A-XCAT",
"MCX4121A-XCAT", 0 };
791 while (!found && c[0])
793 if (strncmp ((
char *) pn, c[0], strlen (c[0])) == 0)
802 while (!found && c[0])
804 if (strncmp ((
char *) pn, c[0], strlen (c[0])) == 0)
813 while (!found && c[0])
815 if (strncmp ((
char *) pn, c[0], strlen (c[0])) == 0)
828 case VNET_DPDK_PMD_FM10K:
833 case VNET_DPDK_PMD_VIRTIO:
840 case VNET_DPDK_PMD_VMXNET3:
842 xd->
tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
845 case VNET_DPDK_PMD_AF_PACKET:
847 xd->
port_id = af_packet_port_id++;
850 case VNET_DPDK_PMD_BOND:
853 xd->
port_id = bond_ether_port_id++;
860 if (devconf->num_rx_desc)
863 if (devconf->num_tx_desc)
878 xd->
port_conf.rxmode.max_rx_pkt_len = dev_info.max_rx_pktlen;
896 xd->
port_conf.rxmode.max_rx_pkt_len += 4;
900 if (xd->
pmd == VNET_DPDK_PMD_AF_PACKET)
904 rnd = (
u32) (now * 1e6);
911 rte_eth_macaddr_get (i, (
struct ether_addr *) addr);
924 if (devconf->workers)
930 int cpu = dm->input_cpu_first_index + i;
931 unsigned lcore = vlib_worker_threads[cpu].lcore_id;
932 vec_validate(xd->cpu_socket_id_by_queue, q);
933 xd->cpu_socket_id_by_queue[q] = rte_lcore_to_socket_id(lcore);
934 vec_add2(dm->devices_by_cpu[cpu], dq, 1);
935 dq->device = xd->device_index;
966 if (devconf->hqos_enabled)
970 if (devconf->hqos.hqos_thread_valid)
996 devconf->hqos.hqos_thread_valid = 1;
997 devconf->hqos.hqos_thread = cpu;
1027 if (devconf->hqos_enabled)
1054 if (xd->
pmd == VNET_DPDK_PMD_ENIC)
1067 vlan_off = rte_eth_dev_get_vlan_offload (xd->
device_index);
1068 vlan_off |= ETH_VLAN_STRIP_OFFLOAD;
1069 xd->
port_conf.rxmode.hw_vlan_strip = vlan_off;
1070 if (rte_eth_dev_set_vlan_offload (xd->
device_index, vlan_off) == 0)
1073 clib_warning (
"VLAN strip cannot be supported by interface\n");
1083 clib_warning (
"%d mbufs allocated but total rx/tx ring size is %d\n",
1100 dpdk_device_config_t * devconf = 0;
1101 vec_reset_length (pci_addr);
1102 pci_addr = format (pci_addr,
"%U%c", format_vlib_pci_addr, &d->bus_address, 0);
1104 if (d->device_class != PCI_CLASS_NETWORK_ETHERNET && d->device_class != PCI_CLASS_PROCESSOR_CO)
1107 if (num_whitelisted)
1109 uword * p = hash_get (conf->device_config_index_by_pci_addr, d->bus_address.as_u32);
1114 devconf = pool_elt_at_index (conf->dev_confs, p[0]);
1138 clib_warning (
"Unsupported PCI device 0x%04x:0x%04x found " 1139 "at PCI address %s\n", (u16) d->vendor_id, (u16) d->device_id,
1155 devconf->is_blacklisted = 1;
1188 "duplicate configuration for PCI address %U",
1192 devconf->
pci_addr.as_u32 = pci_addr.as_u32;
1202 if (
unformat (input,
"num-rx-queues %u", &devconf->num_rx_queues))
1204 else if (
unformat (input,
"num-tx-queues %u", &devconf->num_tx_queues))
1206 else if (
unformat (input,
"num-rx-desc %u", &devconf->num_rx_desc))
1208 else if (
unformat (input,
"num-tx-desc %u", &devconf->num_tx_desc))
1221 else if (
unformat (input,
"vlan-strip-offload off"))
1223 else if (
unformat (input,
"vlan-strip-offload on"))
1249 if (devconf->
workers && devconf->num_rx_queues == 0)
1253 devconf->num_rx_queues)
1256 "%U: number of worker threadds must be " 1271 vlib_pci_addr_t pci_addr;
1274 u8 *rte_cmd = 0, *ethname = 0;
1277 int num_whitelisted = 0;
1289 if (
unformat (input,
"no-hugetlb"))
1295 else if (
unformat (input,
"enable-tcp-udp-checksum"))
1298 else if (
unformat (input,
"decimal-interface-names"))
1301 else if (
unformat (input,
"no-multi-seg"))
1304 else if (
unformat (input,
"enable-cryptodev"))
1344 else if (
unformat (input,
"socket-mem %s", &socket_mem))
1346 else if (
unformat (input,
"no-pci"))
1349 tmp =
format (0,
"--no-pci%c", 0);
1356 else if (unformat(input, #a)) \ 1358 tmp = format (0, "--%s%c", #a, 0); \ 1359 vec_add1 (conf->eal_init_args, tmp); \ 1364 else if (unformat(input, #a " %s", &s)) \ 1366 if (!strncmp(#a, "huge-dir", 8)) \ 1368 else if (!strncmp(#a, "file-prefix", 11)) \ 1370 tmp = format (0, "--%s%c", #a, 0); \ 1371 vec_add1 (conf->eal_init_args, tmp); \ 1373 if (!strncmp(#a, "vdev", 4)) \ 1374 if (strstr((char*)s, "af_packet")) \ 1375 clib_warning ("af_packet obsoleted. Use CLI 'create host-interface'."); \ 1376 vec_add1 (conf->eal_init_args, s); \ 1381 else if (unformat(input, #a " %s", &s)) \ 1383 tmp = format (0, "-%s%c", #b, 0); \ 1384 vec_add1 (conf->eal_init_args, tmp); \ 1386 vec_add1 (conf->eal_init_args, s); \ 1391 else if (unformat(input, #a " %s", &s)) \ 1393 tmp = format (0, "-%s%c", #b, 0); \ 1394 vec_add1 (conf->eal_init_args, tmp); \ 1396 vec_add1 (conf->eal_init_args, s); \ 1397 conf->a##_set_manually = 1; \ 1401 else if (
unformat (input,
"default"))
1420 if (!no_huge && !huge_dir)
1422 u32 x, *mem_by_socket = 0;
1426 u8 less_than_1g = 1;
1461 vec_validate(mem_by_socket, c);
1462 mem_by_socket[c] = 256;
1472 int pages_avail, page_size, mem;
1474 vec_validate(mem_by_socket, c);
1475 mem = mem_by_socket[c];
1478 pages_avail = vlib_sysfs_get_free_hugepages(c, page_size * 1024);
1480 if (pages_avail < 0 || page_size * pages_avail < mem)
1484 pages_avail = vlib_sysfs_get_free_hugepages(c, page_size * 1024);
1486 if (pages_avail < 0 || page_size * pages_avail < mem)
1491 if (mem_by_socket == 0)
1496 _vec_len (mem_by_socket) = c + 1;
1500 socket_mem =
format (socket_mem,
"%s%u",
1501 socket_mem ?
"," :
"", mem_by_socket[x]);
1502 socket_mem =
format (socket_mem,
"%c", 0);
1507 if (rv && errno != EEXIST)
1515 if (rv && errno != EEXIST)
1522 if (use_1g && !(less_than_1g && use_2m))
1542 tmp =
format (0,
"--huge-dir%c", 0);
1548 tmp =
format (0,
"--file-prefix%c", 0);
1550 tmp =
format (0,
"vpp%c", 0);
1565 uword *coremask = 0;
1592 if (no_pci == 0 && geteuid () == 0)
1596 if (devconf->x == 0 && conf->default_devconf.x > 0) \ 1597 devconf->x = conf->default_devconf.x ; 1603 foreach_dpdk_device_config_item
1606 if (num_whitelisted > 0 && devconf->is_blacklisted == 0)
1608 tmp = format (0,
"-w%c", 0);
1609 vec_add1 (conf->eal_init_args, tmp);
1610 tmp = format (0,
"%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
1611 vec_add1 (conf->eal_init_args, tmp);
1615 tmp = format (0,
"-b%c", 0);
1616 vec_add1 (conf->eal_init_args, tmp);
1617 tmp = format (0,
"%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
1618 vec_add1 (conf->eal_init_args, tmp);
1626 tmp =
format (0,
"--master-lcore%c", 0);
1627 vec_add1 (conf->eal_init_args, tmp);
1628 tmp =
format (0,
"%u%c", tm->main_lcore, 0);
1629 vec_add1 (conf->eal_init_args, tmp);
1632 tmp =
format (0,
"--socket-mem%c", 0);
1633 vec_add1 (conf->eal_init_args, tmp);
1634 tmp =
format (0,
"%s%c", socket_mem, 0);
1635 vec_add1 (conf->eal_init_args, tmp);
1639 _vec_len (conf->eal_init_args) -= 1;
1643 log_level = (CLIB_DEBUG > 0) ? RTE_LOG_DEBUG : RTE_LOG_NOTICE;
1645 rte_set_log_level (log_level);
1650 for (
i = 1;
i <
vec_len (conf->eal_init_args);
i++)
1651 conf->eal_init_args_str =
format (conf->eal_init_args_str,
"%s ",
1652 conf->eal_init_args[
i]);
1655 rte_eal_init (vec_len (conf->eal_init_args),
1656 (
char **) conf->eal_init_args);
1665 fprintf (stdout,
"DPDK physical memory layout:\n");
1666 rte_dump_physmem_layout (stdout);
1673 for (
i = 0;
i < RTE_MAX_LCORE;
i++)
1676 rte_lcore_to_socket_id (
i));
1691 struct rte_eth_link prev_link = xd->
link;
1693 u8 hw_flags_chg = 0;
1700 memset (&xd->
link, 0, sizeof (xd->
link));
1709 "update-link-state: sw_if_index %d, admin_up %d," 1710 "old link_state %d new link_state %d",.format_args =
"i4i1i1i1",};
1722 ed->old_link_state = (
u8)
1724 ed->new_link_state = (
u8) xd->
link.link_status;
1728 ((xd->
link.link_status != 0) ^
1735 if (hw_flags_chg || (xd->
link.link_duplex != prev_link.link_duplex))
1738 switch (xd->
link.link_duplex)
1740 case ETH_LINK_HALF_DUPLEX:
1743 case ETH_LINK_FULL_DUPLEX:
1750 if (hw_flags_chg || (xd->
link.link_speed != prev_link.link_speed))
1753 switch (xd->
link.link_speed)
1755 case ETH_SPEED_NUM_10M:
1758 case ETH_SPEED_NUM_100M:
1761 case ETH_SPEED_NUM_1G:
1764 case ETH_SPEED_NUM_10G:
1767 case ETH_SPEED_NUM_40G:
1786 "update-link-state: sw_if_index %d, new flags %d",.format_args
1796 ed->flags = hw_flags;
1824 VLIB_NODE_STATE_POLLING);
1829 VLIB_NODE_STATE_POLLING);
1850 int nports = rte_eth_dev_count ();
1853 for (i = 0; i < nports; i++)
1857 if (xd->
pmd == VNET_DPDK_PMD_BOND)
1861 int nlink = rte_eth_bond_slaves_get (i, slink, 16);
1870 (slink[0], (
struct ether_addr *) addr);
1874 rv = rte_eth_bond_mac_address_set
1875 (i, (
struct ether_addr *) addr);
1894 int slave = slink[--nlink];
1903 rv = rte_eth_dev_mac_addr_add
1904 (slave, (
struct ether_addr *) addr, 0);
1973 .name =
"dpdk-process",
1974 .process_log2_n_stack_bytes = 17,
1982 return (VNET_API_ERROR_INVALID_VALUE);
1993 return (VNET_API_ERROR_INVALID_VALUE);
2010 "Cache line marker must be 1st element in dpdk_device_t");
2013 "Data in cache line 0 is bigger than cache line size");
2015 "Cache line marker must be 1st element in frame_queue_trace_t");
2018 name =
format (0,
"dpdk_%08x%c", api_version, 0);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define DPDK_DEVICE_FLAG_PROMISC
DPDK interface HQoS subport parameters set request.
static void dpdk_bind_devices_to_uio(dpdk_config_main_t *conf)
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
#define VNET_HW_INTERFACE_FLAG_SPEED_1G
ethernet_main_t ethernet_main
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
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
vnet_device_class_t dpdk_device_class
#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.
static u32 dpdk_flag_change(vnet_main_t *vnm, vnet_hw_interface_t *hi, u32 flags)
static void * vl_api_sw_interface_set_dpdk_hqos_tctbl_t_print(vl_api_sw_interface_set_dpdk_hqos_tctbl_t *mp, void *handle)
void dpdk_update_link_state(dpdk_device_t *xd, f64 now)
static void vl_api_sw_interface_set_dpdk_hqos_subport_t_handler(vl_api_sw_interface_set_dpdk_hqos_subport_t *mp)
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
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)
vlib_buffer_t * buffer_templates
struct rte_sched_port * hqos
#define DPDK_NB_TX_DESC_DEFAULT
#define foreach_eal_double_hyphen_predicate_arg
unformat_function_t unformat_vlib_pci_addr
int dpdk_set_stat_poll_interval(f64 interval)
#define VNET_HW_INTERFACE_FLAG_LINK_UP
void * vlib_weakly_linked_functions[]
#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
vlib_main_t ** vlib_mains
#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)
#define I40E_DEV_ID_SFP_XL710
struct rte_mbuf *** tx_vectors
foreach_dpdk_device_config_item clib_bitmap_t * workers
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#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)
#define IP_BUFFER_L4_CHECKSUM_CORRECT
dpdk_device_config_t default_devconf
clib_error_t * dpdk_port_setup(dpdk_main_t *dm, dpdk_device_t *xd)
#define VLIB_BUFFER_TOTAL_LENGTH_VALID
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_error_return(e, args...)
#define VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES
DPDK interface HQoS subport parameters set reply.
DPDK interface HQoS pipe profile set reply.
#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
DPDK interface HQoS tctbl entry set reply.
dpdk_device_hqos_per_worker_thread_t * hqos_wt
#define I40E_DEV_ID_10G_BASE_T
f64 time_last_stats_update
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...
static clib_error_t * dpdk_config(vlib_main_t *vm, unformat_input_t *input)
#define foreach_eal_double_hyphen_arg
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
#define VNET_HW_INTERFACE_FLAG_HALF_DUPLEX
uword os_get_cpu_number(void)
#define VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX
dpdk_port_type_t port_type
#define VLIB_CONFIG_FUNCTION(x, n,...)
static void vl_api_sw_interface_set_dpdk_hqos_pipe_t_handler(vl_api_sw_interface_set_dpdk_hqos_pipe_t *mp)
#define DPDK_MIN_STATS_POLL_INTERVAL
clib_error_t * dpdk_init(vlib_main_t *vm)
#define DPDK_DEVICE_FLAG_ADMIN_UP
static void * vl_api_sw_interface_set_dpdk_hqos_subport_t_print(vl_api_sw_interface_set_dpdk_hqos_subport_t *mp, void *handle)
#define VNET_HW_INTERFACE_BOND_INFO_SLAVE
#define BAD_SW_IF_INDEX_LABEL
#define foreach_eal_single_hyphen_arg
#define DPDK_NB_RX_DESC_DEFAULT
void dpdk_device_lock_free(dpdk_device_t *xd)
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)
u32 vlib_buffer_get_or_create_free_list(vlib_main_t *vm, u32 n_data_bytes, char *fmt,...)
static void dpdk_update_counters(dpdk_device_t *xd, f64 now)
u8 nchannels_set_manually
u16 * cpu_socket_id_by_queue
static void setup_message_id_table(dpdk_main_t *dm, api_main_t *am)
#define vec_free(V)
Free vector's memory (no header).
dpdk_device_config_t * dev_confs
struct rte_mbuf *** rx_vectors
DPDK interface HQoS tctbl entry set request.
#define clib_warning(format, args...)
#define clib_memcpy(a, b, c)
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
#define ELOG_TYPE_DECLARE(f)
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
#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
#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
#define IP_BUFFER_L4_CHECKSUM_COMPUTED
static uword dpdk_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
static void clib_mem_free(void *p)
void dpdk_device_lock_init(dpdk_device_t *xd)
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)
dpdk_device_hqos_per_hqos_thread_t * hqos_ht
#define clib_error_report(e)
#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
clib_error_t * dpdk_cli_init(vlib_main_t *vm)
static vlib_main_t * vlib_get_main(void)
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 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)
#define foreach_dpdk_plugin_api_msg
uword unformat_vlib_cli_sub_input(unformat_input_t *i, va_list *args)
u8 admin_up_down_in_progress
#define STATIC_ASSERT(truth,...)
static struct rte_eth_conf port_conf_template
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" )
static clib_error_t * dpdk_lib_init(dpdk_main_t *dm)
static void vl_api_sw_interface_set_dpdk_hqos_tctbl_t_handler(vl_api_sw_interface_set_dpdk_hqos_tctbl_t *mp)
int dpdk_set_link_state_poll_interval(f64 interval)
#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)
#define VLIB_BUFFER_EXT_HDR_VALID
static void vlib_buffer_init_for_free_list(vlib_buffer_t *dst, vlib_buffer_free_list_t *fl)
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,...)
static vlib_thread_main_t * vlib_get_thread_main()
DPDK interface HQoS pipe profile set request.
#define ETHERNET_MAX_PACKET_BYTES
#define vec_foreach(var, vec)
Vector iterator.
#define ETHERNET_INTERFACE_FLAG_CONFIG_PROMISC(flags)
uword * cpu_socket_bitmap
u16 vl_msg_api_get_msg_ids(char *name, int n)
format_function_t format_vlib_pci_vpd
static vlib_buffer_free_list_t * vlib_buffer_get_free_list(vlib_main_t *vm, u32 free_list_index)
static void * vl_api_sw_interface_set_dpdk_hqos_pipe_t_print(vl_api_sw_interface_set_dpdk_hqos_pipe_t *mp, void *handle)
vlib_thread_registration_t ** registrations
static clib_error_t * dpdk_plugin_api_hookup(vlib_main_t *vm)
#define CLIB_CACHE_LINE_BYTES
ethernet_interface_t * interfaces
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
clib_error_t * unformat_hqos(unformat_input_t *input, dpdk_device_config_hqos_t *hqos)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
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
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".
#define VALIDATE_SW_IF_INDEX(mp)
dpdk_config_main_t * conf
vlib_pci_device_t * vlib_get_pci_device(vlib_pci_addr_t *addr)
uword * vu_sw_if_index_by_sock_fd