mlx4: support setting primary MAC address

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
This commit is contained in:
David Marchand 2016-01-05 19:00:08 +01:00 committed by Thomas Monjalon
parent bda501616c
commit b84355e232

View File

@ -4427,6 +4427,22 @@ mlx4_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
priv_unlock(priv);
}
/**
* DPDK callback to set the primary MAC address.
*
* @param dev
* Pointer to Ethernet device structure.
* @param mac_addr
* MAC address to register.
*/
static void
mlx4_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
{
DEBUG("%p: setting primary MAC address", (void *)dev);
mlx4_mac_addr_remove(dev, 0);
mlx4_mac_addr_add(dev, mac_addr, 0, 0);
}
/**
* DPDK callback to enable promiscuous mode.
*
@ -5000,6 +5016,7 @@ static const struct eth_dev_ops mlx4_dev_ops = {
.priority_flow_ctrl_set = NULL,
.mac_addr_remove = mlx4_mac_addr_remove,
.mac_addr_add = mlx4_mac_addr_add,
.mac_addr_set = mlx4_mac_addr_set,
.mtu_set = mlx4_dev_set_mtu,
};