X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fdpdk%2Fdevice%2Fdevice.c;h=c355edf6a4b788e183f9a74b54171f6076ed5a42;hb=548d70de68a4156d5bd4148e50a81555a0ef169f;hp=e9c1a557a75e6478d0b7dcdb0624fb854f3fab5e;hpb=fe2523d1a42c66ee3ddd594fad1cf5ac91c66c54;p=vpp.git diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c index e9c1a557a75..c355edf6a4b 100644 --- a/src/plugins/dpdk/device/device.c +++ b/src/plugins/dpdk/device/device.c @@ -42,6 +42,29 @@ static char *dpdk_tx_func_error_strings[] = { #undef _ }; +static clib_error_t * +dpdk_add_del_mac_address (vnet_hw_interface_t * hi, + const u8 * address, u8 is_add) +{ + int error; + dpdk_main_t *dm = &dpdk_main; + dpdk_device_t *xd = vec_elt_at_index (dm->devices, hi->dev_instance); + + if (is_add) + error = rte_eth_dev_mac_addr_add (xd->port_id, + (struct rte_ether_addr *) address, 0); + else + error = rte_eth_dev_mac_addr_remove (xd->port_id, + (struct rte_ether_addr *) address); + + if (error) + { + return clib_error_return (0, "mac address add/del failed: %d", error); + } + + return NULL; +} + static clib_error_t * dpdk_set_mac_address (vnet_hw_interface_t * hi, const u8 * old_address, const u8 * address) @@ -157,25 +180,11 @@ static_always_inline queue_id = (queue_id + 1) % xd->tx_q_used; } -#if 0 - if (PREDICT_FALSE (xd->flags & DPDK_DEVICE_FLAG_HQOS)) /* HQoS ON */ - { - /* no wrap, transmit in one burst */ - dpdk_device_hqos_per_worker_thread_t *hqos = - &xd->hqos_wt[vm->thread_index]; - - ASSERT (hqos->swq != NULL); - - dpdk_hqos_metadata_set (hqos, mb, n_left); - n_sent = rte_ring_sp_enqueue_burst (hqos->swq, (void **) mb, - n_left, 0); - } - else -#endif if (PREDICT_TRUE (xd->flags & DPDK_DEVICE_FLAG_PMD)) { /* no wrap, transmit in one burst */ n_sent = rte_eth_tx_burst (xd->port_id, queue_id, mb, n_left); + n_retry--; } else { @@ -600,6 +609,7 @@ VNET_DEVICE_CLASS (dpdk_device_class) = { .subif_add_del_function = dpdk_subif_add_del_function, .rx_redirect_to_node = dpdk_set_interface_next_node, .mac_addr_change_function = dpdk_set_mac_address, + .mac_addr_add_del_function = dpdk_add_del_mac_address, .format_flow = format_dpdk_flow, .flow_ops_function = dpdk_flow_ops_fn, };