31 #include <sys/mount.h> 39 #define LINK_STATE_ELOGS 0 52 .mq_mode = ETH_MQ_TX_NONE,
60 if (dev_info->speed_capa & ETH_LINK_SPEED_100G)
62 else if (dev_info->speed_capa & ETH_LINK_SPEED_50G)
64 else if (dev_info->speed_capa & ETH_LINK_SPEED_40G)
66 else if (dev_info->speed_capa & ETH_LINK_SPEED_25G)
68 else if (dev_info->speed_capa & ETH_LINK_SPEED_10G)
70 else if (dev_info->speed_capa & ETH_LINK_SPEED_1G)
110 rv = rte_eth_dev_configure
115 "rte_eth_dev_configure[%d]: err %d",
153 vlib_pci_addr_t last_pci_addr;
154 u32 last_pci_addr_port = 0;
158 u32 next_hqos_cpu = 0;
159 u8 af_packet_port_id = 0;
160 u8 bond_ether_port_id = 0;
161 last_pci_addr.as_u32 = ~0;
170 if (tr_hqos && tr_hqos->
count > 0)
179 nports = rte_eth_dev_count ();
186 clib_warning (
"DPDK drivers found %d ports...", nports);
199 | VNET_BUFFER_F_L4_CHECKSUM_COMPUTED);
216 for (i = 0; i < nports; i++)
221 struct rte_eth_dev_info dev_info;
222 struct rte_eth_link l;
224 vlib_pci_addr_t pci_addr;
227 rte_eth_dev_info_get (i, &dev_info);
228 if (dev_info.pci_dev)
230 pci_addr.domain = dev_info.pci_dev->addr.domain;
231 pci_addr.bus = dev_info.pci_dev->addr.bus;
232 pci_addr.slot = dev_info.pci_dev->addr.devid;
233 pci_addr.function = dev_info.pci_dev->addr.function;
251 if (dev_info.pci_dev)
253 struct rte_eth_dev_info di = { 0 };
254 rte_eth_dev_info_get (i + 1, &di);
255 if (di.pci_dev && pci_addr.as_u32 != last_pci_addr.as_u32 &&
256 memcmp (&dev_info.pci_dev->addr, &di.pci_dev->addr,
257 sizeof (
struct rte_pci_addr)) == 0)
260 last_pci_addr.as_u32 = pci_addr.as_u32;
261 last_pci_addr_port =
i;
263 else if (pci_addr.as_u32 == last_pci_addr.as_u32)
266 format (0,
"%u", i - last_pci_addr_port);
270 last_pci_addr.as_u32 = ~0;
274 last_pci_addr.as_u32 = ~0;
277 sizeof (
struct rte_eth_txconf));
280 xd->
tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
286 xd->
tx_conf.txq_flags &= ~ETH_TXQ_FLAGS_NOMULTSEGS;
293 sizeof (
struct rte_eth_conf));
297 if (devconf->num_tx_queues > 0
298 && devconf->num_tx_queues < xd->
tx_q_used)
301 if (devconf->num_rx_queues > 1 && dm->
use_rss == 0)
306 if (devconf->num_rx_queues > 1
307 && dev_info.max_rx_queues >= devconf->num_rx_queues)
310 xd->
port_conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
311 if (devconf->rss_fn == 0)
312 xd->
port_conf.rx_adv_conf.rss_conf.rss_hf =
313 ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP;
315 xd->
port_conf.rx_adv_conf.rss_conf.rss_hf = devconf->rss_fn;
323 if ((!dev_info.driver_name) && (dev_info.pci_dev))
324 dev_info.driver_name = dev_info.pci_dev->driver->driver.name;
326 ASSERT (dev_info.driver_name);
332 #define _(s,f) else if (dev_info.driver_name && \ 333 !strcmp(dev_info.driver_name, s)) \ 334 xd->pmd = VNET_DPDK_PMD_##f; 349 case VNET_DPDK_PMD_E1000EM:
350 case VNET_DPDK_PMD_IGB:
351 case VNET_DPDK_PMD_IXGBE:
352 case VNET_DPDK_PMD_I40E:
358 case VNET_DPDK_PMD_CXGBE:
359 case VNET_DPDK_PMD_MLX4:
360 case VNET_DPDK_PMD_MLX5:
365 case VNET_DPDK_PMD_IGBVF:
366 case VNET_DPDK_PMD_IXGBEVF:
367 case VNET_DPDK_PMD_I40EVF:
372 case VNET_DPDK_PMD_THUNDERX:
377 case VNET_DPDK_PMD_DPAA2:
382 case VNET_DPDK_PMD_ENIC:
383 rte_eth_link_get_nowait (i, &l);
384 if (l.link_speed == 40000)
391 case VNET_DPDK_PMD_FM10K:
397 case VNET_DPDK_PMD_VIRTIO:
404 case VNET_DPDK_PMD_VMXNET3:
406 xd->
tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
409 case VNET_DPDK_PMD_AF_PACKET:
411 xd->
port_id = af_packet_port_id++;
414 case VNET_DPDK_PMD_BOND:
416 xd->
port_id = bond_ether_port_id++;
419 case VNET_DPDK_PMD_VIRTIO_USER:
423 case VNET_DPDK_PMD_VHOST_ETHER:
431 if (devconf->num_rx_desc)
434 if (devconf->num_tx_desc)
449 xd->
port_conf.rxmode.max_rx_pkt_len = dev_info.max_rx_pktlen;
467 xd->
port_conf.rxmode.max_rx_pkt_len += 4;
471 if (xd->
pmd == VNET_DPDK_PMD_AF_PACKET)
475 rnd = (
u32) (now * 1e6);
482 rte_eth_macaddr_get (i, (
struct ether_addr *) addr);
495 if (devconf->hqos_enabled)
499 if (devconf->hqos.hqos_thread_valid)
525 devconf->hqos.hqos_thread_valid = 1;
526 devconf->hqos.hqos_thread = cpu;
567 if (devconf->workers)
573 vnet_hw_interface_assign_rx_thread (dm->vnet_main, xd->hw_if_index, q++,
574 vdm->first_worker_thread_index + i);
593 clib_warning (
"setup failed for device %U. Errors:\n %U",
597 if (devconf->hqos_enabled)
611 if (xd->
pmd == VNET_DPDK_PMD_ENIC)
624 vlan_off = rte_eth_dev_get_vlan_offload (xd->
device_index);
625 vlan_off |= ETH_VLAN_STRIP_OFFLOAD;
626 xd->
port_conf.rxmode.hw_vlan_strip = vlan_off;
627 if (rte_eth_dev_set_vlan_offload (xd->
device_index, vlan_off) == 0)
630 clib_warning (
"VLAN strip cannot be supported by interface\n");
640 clib_warning (
"%d mbufs allocated but total rx/tx ring size is %d\n",
657 dpdk_device_config_t * devconf = 0;
658 vec_reset_length (pci_addr);
659 pci_addr = format (pci_addr,
"%U%c", format_vlib_pci_addr, &d->bus_address, 0);
661 if (d->device_class != PCI_CLASS_NETWORK_ETHERNET && d->device_class != PCI_CLASS_PROCESSOR_CO)
666 uword * p = hash_get (conf->device_config_index_by_pci_addr, d->bus_address.as_u32);
671 devconf = pool_elt_at_index (conf->dev_confs, p[0]);
700 clib_warning (
"Unsupported PCI device 0x%04x:0x%04x found " 701 "at PCI address %s\n", (u16) d->vendor_id, (u16) d->device_id,
717 devconf->is_blacklisted = 1;
750 "duplicate configuration for PCI address %U",
754 devconf->
pci_addr.as_u32 = pci_addr.as_u32;
764 if (
unformat (input,
"num-rx-queues %u", &devconf->num_rx_queues))
766 else if (
unformat (input,
"num-tx-queues %u", &devconf->num_tx_queues))
768 else if (
unformat (input,
"num-rx-desc %u", &devconf->num_rx_desc))
770 else if (
unformat (input,
"num-tx-desc %u", &devconf->num_tx_desc))
783 else if (
unformat (input,
"vlan-strip-offload off"))
785 else if (
unformat (input,
"vlan-strip-offload on"))
811 if (devconf->
workers && devconf->num_rx_queues == 0)
815 devconf->num_rx_queues)
818 "%U: number of worker threadds must be " 833 vlib_pci_addr_t pci_addr;
837 u8 *rte_cmd = 0, *ethname = 0;
840 int num_whitelisted = 0;
846 u8 *huge_dir_path = 0;
852 log_level = RTE_LOG_NOTICE;
863 else if (
unformat (input,
"enable-tcp-udp-checksum"))
866 else if (
unformat (input,
"decimal-interface-names"))
872 else if (
unformat (input,
"no-multi-seg"))
910 else if (
unformat (input,
"socket-mem %s", &socket_mem))
912 else if (
unformat (input,
"no-pci"))
915 tmp =
format (0,
"--no-pci%c", 0);
922 else if (unformat(input, #a)) \ 924 tmp = format (0, "--%s%c", #a, 0); \ 925 vec_add1 (conf->eal_init_args, tmp); \ 930 else if (unformat(input, #a " %s", &s)) \ 932 if (!strncmp(#a, "huge-dir", 8)) \ 934 else if (!strncmp(#a, "file-prefix", 11)) \ 936 tmp = format (0, "--%s%c", #a, 0); \ 937 vec_add1 (conf->eal_init_args, tmp); \ 939 if (!strncmp(#a, "vdev", 4)) \ 940 if (strstr((char*)s, "af_packet")) \ 941 clib_warning ("af_packet obsoleted. Use CLI 'create host-interface'."); \ 942 vec_add1 (conf->eal_init_args, s); \ 947 else if (unformat(input, #a " %s", &s)) \ 949 tmp = format (0, "-%s%c", #b, 0); \ 950 vec_add1 (conf->eal_init_args, tmp); \ 952 vec_add1 (conf->eal_init_args, s); \ 957 else if (unformat(input, #a " %s", &s)) \ 959 tmp = format (0, "-%s%c", #b, 0); \ 960 vec_add1 (conf->eal_init_args, tmp); \ 962 vec_add1 (conf->eal_init_args, s); \ 963 conf->a##_set_manually = 1; \ 967 else if (
unformat (input,
"default"))
986 if (!no_huge && !huge_dir)
988 u32 x, *mem_by_socket = 0;
995 umount ((
char *) huge_dir_path);
1027 vec_validate(mem_by_socket, c);
1028 mem_by_socket[c] = 256;
1038 int pages_avail, page_size, mem;
1039 clib_error_t *e = 0;
1041 vec_validate(mem_by_socket, c);
1042 mem = mem_by_socket[c];
1045 e = clib_sysfs_get_free_hugepages(c, page_size * 1024, &pages_avail);
1047 if (e != 0 || pages_avail < 0 || page_size * pages_avail < mem)
1051 clib_error_free (e);
1054 e = clib_sysfs_get_free_hugepages(c, page_size * 1024, &pages_avail);
1056 if (e != 0 || pages_avail < 0 || page_size * pages_avail < mem)
1060 clib_error_free (e);
1064 if (mem_by_socket == 0)
1069 _vec_len (mem_by_socket) = c + 1;
1073 socket_mem =
format (socket_mem,
"%s%u",
1074 socket_mem ?
"," :
"", mem_by_socket[x]);
1075 socket_mem =
format (socket_mem,
"%c", 0);
1085 if (use_1g && !(less_than_1g && use_2m))
1087 rv = mount (
"none", (
char *) huge_dir_path,
"hugetlbfs", 0,
1092 rv = mount (
"none", (
char *) huge_dir_path,
"hugetlbfs", 0,
NULL);
1105 tmp =
format (0,
"--huge-dir%c", 0);
1107 tmp =
format (0,
"%s%c", huge_dir_path, 0);
1111 tmp =
format (0,
"--file-prefix%c", 0);
1113 tmp =
format (0,
"vpp%c", 0);
1128 uword *coremask = 0;
1155 if (no_pci == 0 && geteuid () == 0)
1159 if (devconf->x == 0 && conf->default_devconf.x > 0) \ 1160 devconf->x = conf->default_devconf.x ; 1166 foreach_dpdk_device_config_item
1169 if (num_whitelisted > 0 && devconf->is_blacklisted == 0)
1171 tmp = format (0,
"-w%c", 0);
1172 vec_add1 (conf->eal_init_args, tmp);
1173 tmp = format (0,
"%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
1174 vec_add1 (conf->eal_init_args, tmp);
1178 tmp = format (0,
"-b%c", 0);
1179 vec_add1 (conf->eal_init_args, tmp);
1180 tmp = format (0,
"%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
1181 vec_add1 (conf->eal_init_args, tmp);
1189 tmp =
format (0,
"--master-lcore%c", 0);
1190 vec_add1 (conf->eal_init_args, tmp);
1191 tmp =
format (0,
"%u%c", tm->main_lcore, 0);
1192 vec_add1 (conf->eal_init_args, tmp);
1195 tmp =
format (0,
"--socket-mem%c", 0);
1196 vec_add1 (conf->eal_init_args, tmp);
1197 tmp =
format (0,
"%s%c", socket_mem, 0);
1198 vec_add1 (conf->eal_init_args, tmp);
1202 _vec_len (conf->eal_init_args) -= 1;
1206 rte_log_set_global_level (log_level);
1211 for (
i = 1;
i <
vec_len (conf->eal_init_args);
i++)
1212 conf->eal_init_args_str =
format (conf->eal_init_args_str,
"%s ",
1213 conf->eal_init_args[
i]);
1215 clib_warning (
"EAL init args: %s", conf->eal_init_args_str);
1217 rte_eal_init (
vec_len (conf->eal_init_args),
1218 (
char **) conf->eal_init_args);
1221 umount2 ((
char *) huge_dir_path, MNT_DETACH);
1222 rmdir ((
char *) huge_dir_path);
1229 fprintf (stdout,
"DPDK physical memory layout:\n");
1230 rte_dump_physmem_layout (stdout);
1237 for (
i = 0;
i < RTE_MAX_LCORE;
i++)
1240 rte_lcore_to_socket_id (
i));
1255 struct rte_eth_link prev_link = xd->
link;
1257 u8 hw_flags_chg = 0;
1264 memset (&xd->
link, 0, sizeof (xd->
link));
1273 "update-link-state: sw_if_index %d, admin_up %d," 1274 "old link_state %d new link_state %d",.format_args =
"i4i1i1i1",};
1286 ed->old_link_state = (
u8)
1288 ed->new_link_state = (
u8) xd->
link.link_status;
1292 && ((xd->
link.link_status != 0) ^
1299 if (hw_flags_chg || (xd->
link.link_duplex != prev_link.link_duplex))
1302 switch (xd->
link.link_duplex)
1304 case ETH_LINK_HALF_DUPLEX:
1307 case ETH_LINK_FULL_DUPLEX:
1314 if (hw_flags_chg || (xd->
link.link_speed != prev_link.link_speed))
1317 switch (xd->
link.link_speed)
1319 case ETH_SPEED_NUM_10M:
1322 case ETH_SPEED_NUM_100M:
1325 case ETH_SPEED_NUM_1G:
1328 case ETH_SPEED_NUM_10G:
1331 case ETH_SPEED_NUM_40G:
1350 "update-link-state: sw_if_index %d, new flags %d",.format_args
1360 ed->flags = hw_flags;
1399 int nports = rte_eth_dev_count ();
1402 for (i = 0; i < nports; i++)
1406 if (xd->
pmd == VNET_DPDK_PMD_BOND)
1410 int nlink = rte_eth_bond_slaves_get (i, slink, 16);
1419 (slink[0], (
struct ether_addr *) addr);
1422 clib_warning (
"Set MAC for bond port %d BondEthernet%d",
1424 rv = rte_eth_bond_mac_address_set
1425 (i, (
struct ether_addr *) addr);
1444 int slave = slink[--nlink];
1453 rv = rte_eth_dev_mac_addr_add
1454 (slave, (
struct ether_addr *) addr, 0);
1459 rte_eth_dev_callback_register
1460 (slave, RTE_ETH_EVENT_INTR_LSC,
1526 .name =
"dpdk-process",
1527 .process_log2_n_stack_bytes = 17,
1541 "Cache line marker must be 1st element in dpdk_device_t");
1544 "Data in cache line 0 is bigger than cache line size");
1546 "Cache line marker must be 1st element in frame_queue_trace_t");
1567 | VNET_BUFFER_F_L4_CHECKSUM_COMPUTED |
1568 VNET_BUFFER_F_L4_CHECKSUM_CORRECT);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define DPDK_DEVICE_FLAG_PROMISC
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)
vnet_device_class_t dpdk_device_class
#define DPDK_DEVICE_VLAN_STRIP_OFF
#define DPDK_DEVICE_FLAG_TX_OFFLOAD
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)
void dpdk_update_link_state(dpdk_device_t *xd, f64 now)
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
#define DPDK_NB_TX_DESC_DEFAULT
#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
static vnet_sw_interface_t * vnet_get_hw_sw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define DPDK_DEVICE_FLAG_INTEL_PHDR_CKSUM
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
vlib_node_registration_t dpdk_input_node
(constructor) VLIB_REGISTER_NODE (dpdk_input_node)
dpdk_device_config_t default_devconf
static char * vlib_unix_get_runtime_dir(void)
static dpdk_port_type_t port_type_from_speed_capa(struct rte_eth_dev_info *dev_info)
#define VLIB_BUFFER_TOTAL_LENGTH_VALID
#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
#define DPDK_DEVICE_FLAG_MAYBE_MULTISEG
void dpdk_device_setup(dpdk_device_t *xd)
#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
static clib_error_t * dpdk_init(vlib_main_t *vm)
f64 time_last_stats_update
int dpdk_port_state_callback(uint8_t port_id, enum rte_eth_event_type type, void *param, void *ret_param)
struct rte_eth_txconf tx_conf
void dpdk_device_start(dpdk_device_t *xd)
#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...
clib_error_t * dpdk_buffer_pool_create(vlib_main_t *vm, unsigned num_mbufs, unsigned socket_id)
static clib_error_t * dpdk_config(vlib_main_t *vm, unformat_input_t *input)
#define foreach_eal_double_hyphen_arg
#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
#define VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX
dpdk_port_type_t port_type
#define VLIB_CONFIG_FUNCTION(x, n,...)
#define DPDK_DEVICE_FLAG_ADMIN_UP
#define VNET_HW_INTERFACE_BOND_INFO_SLAVE
#define foreach_eal_single_hyphen_arg
#define DPDK_NB_RX_DESC_DEFAULT
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
#define vec_free(V)
Free vector's memory (no header).
dpdk_device_config_t * dev_confs
struct rte_mbuf *** rx_vectors
#define clib_warning(format, args...)
#define clib_memcpy(a, b, c)
format_function_t format_dpdk_device_errors
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
#define VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD
#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).
static void dpdk_device_lock_init(dpdk_device_t *xd)
void dpdk_device_stop(dpdk_device_t *xd)
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)
format_function_t format_dpdk_device_name
void vnet_hw_interface_assign_rx_thread(vnet_main_t *vnm, u32 hw_if_index, u16 queue_id, uword thread_index)
static uword dpdk_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
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_error_report(e)
#define clib_bitmap_free(v)
Free a bitmap.
#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.
clib_error_t * vlib_unix_recursive_mkdir(char *path)
#define DPDK_STATS_POLL_INTERVAL
#define VNET_HW_INTERFACE_FLAG_SPEED_100M
clib_error_t * vlib_pci_bind_to_uio(vlib_pci_device_t *d, char *uio_driver_name)
static vlib_node_registration_t dpdk_process_node
(constructor) VLIB_REGISTER_NODE (dpdk_process_node)
u32 ethernet_input_node_index
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
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" )
#define DPDK_DEVICE_FLAG_BOND_SLAVE
static clib_error_t * dpdk_lib_init(dpdk_main_t *dm)
#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()
#define ETHERNET_MAX_PACKET_BYTES
#define vec_foreach(var, vec)
Vector iterator.
#define ETHERNET_INTERFACE_FLAG_CONFIG_PROMISC(flags)
uword * cpu_socket_bitmap
static vlib_buffer_free_list_t * vlib_buffer_get_free_list(vlib_main_t *vm, u32 free_list_index)
vlib_thread_registration_t ** registrations
#define CLIB_CACHE_LINE_BYTES
unformat_function_t unformat_dpdk_log_level
ethernet_interface_t * interfaces
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, 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
static void vnet_hw_interface_set_input_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
vnet_device_main_t vnet_device_main
f64 link_state_poll_interval
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
dpdk_config_main_t * conf