DPDK_TX_FUNC_N_ERROR,
} dpdk_tx_func_error_t;
-#ifndef CLIB_MULTIARCH_VARIANT
static char *dpdk_tx_func_error_strings[] = {
#define _(n,s) s,
foreach_dpdk_tx_func_error
dpdk_main_t *dm = &dpdk_main;
dpdk_device_t *xd = vec_elt_at_index (dm->devices, hi->dev_instance);
- error = rte_eth_dev_default_mac_addr_set (xd->device_index,
+ error = rte_eth_dev_default_mac_addr_set (xd->port_id,
(struct ether_addr *) address);
if (error)
return NULL;
}
}
-#endif
static struct rte_mbuf *
dpdk_replicate_packet_mb (vlib_buffer_t * b)
else if (PREDICT_TRUE (xd->flags & DPDK_DEVICE_FLAG_PMD))
{
/* no wrap, transmit in one burst */
- n_sent = rte_eth_tx_burst (xd->device_index, queue_id, mb, n_left);
+ n_sent = rte_eth_tx_burst (xd->port_id, queue_id, mb, n_left);
}
else
{
xd->hw_if_index)->tx_node_index;
vlib_error_count (vm, node_index, DPDK_TX_FUNC_ERROR_BAD_RETVAL, 1);
- clib_warning ("rte_eth_tx_burst[%d]: error %d", xd->device_index,
- n_sent);
+ clib_warning ("rte_eth_tx_burst[%d]: error %d",
+ xd->port_id, n_sent);
return n_left; // untransmitted packets
}
n_left -= n_sent;
* node. It first copies packets on the frame to a per-thread arrays
* containing the rte_mbuf pointers.
*/
-uword
-CLIB_MULTIARCH_FN (dpdk_interface_tx) (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_frame_t * f)
+VNET_DEVICE_CLASS_TX_FN (dpdk_device_class) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * f)
{
dpdk_main_t *dm = &dpdk_main;
vnet_interface_output_runtime_t *rd = (void *) node->runtime_data;
return tx_pkts;
}
-#ifndef CLIB_MULTIARCH_VARIANT
static void
dpdk_clear_hw_interface_counters (u32 instance)
{
goto done;
}
- vlan_offload = rte_eth_dev_get_vlan_offload (xd->device_index);
+ vlan_offload = rte_eth_dev_get_vlan_offload (xd->port_id);
vlan_offload |= ETH_VLAN_FILTER_OFFLOAD;
- if ((r = rte_eth_dev_set_vlan_offload (xd->device_index, vlan_offload)))
+ if ((r = rte_eth_dev_set_vlan_offload (xd->port_id, vlan_offload)))
{
xd->num_subifs = prev_subifs;
err = clib_error_return (0, "rte_eth_dev_set_vlan_offload[%d]: err %d",
- xd->device_index, r);
+ xd->port_id, r);
goto done;
}
if ((r =
- rte_eth_dev_vlan_filter (xd->device_index, t->sub.eth.outer_vlan_id,
- is_add)))
+ rte_eth_dev_vlan_filter (xd->port_id,
+ t->sub.eth.outer_vlan_id, is_add)))
{
xd->num_subifs = prev_subifs;
err = clib_error_return (0, "rte_eth_dev_vlan_filter[%d]: err %d",
- xd->device_index, r);
+ xd->port_id, r);
goto done;
}
/* *INDENT-OFF* */
VNET_DEVICE_CLASS (dpdk_device_class) = {
.name = "dpdk",
- .tx_function = dpdk_interface_tx,
.tx_function_n_errors = DPDK_TX_FUNC_N_ERROR,
.tx_function_error_strings = dpdk_tx_func_error_strings,
.format_device_name = format_dpdk_device_name,
};
/* *INDENT-ON* */
-#if __x86_64__
-vlib_node_function_t __clib_weak dpdk_interface_tx_avx512;
-vlib_node_function_t __clib_weak dpdk_interface_tx_avx2;
-static void __clib_constructor
-dpdk_interface_tx_multiarch_select (void)
-{
- if (dpdk_interface_tx_avx512 && clib_cpu_supports_avx512f ())
- dpdk_device_class.tx_function = dpdk_interface_tx_avx512;
- else if (dpdk_interface_tx_avx2 && clib_cpu_supports_avx2 ())
- dpdk_device_class.tx_function = dpdk_interface_tx_avx2;
-}
-#endif
-#endif
-
#define UP_DOWN_FLAG_EVENT 1
-#ifndef CLIB_MULTIARCH_VARIANT
-uword
+static uword
admin_up_down_process (vlib_main_t * vm,
vlib_node_runtime_t * rt, vlib_frame_t * f)
{
}
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (admin_up_down_process_node,static) = {
+VLIB_REGISTER_NODE (admin_up_down_process_node) = {
.function = admin_up_down_process,
.type = VLIB_NODE_TYPE_PROCESS,
.name = "admin-up-down-process",
.process_log2_n_stack_bytes = 17, // 256KB
};
/* *INDENT-ON* */
-#endif
/*
* fd.io coding-style-patch-verification: ON