mlx5: 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:09 +01:00 committed by Thomas Monjalon
parent b84355e232
commit 86977fccb9
3 changed files with 18 additions and 0 deletions

View File

@ -162,6 +162,7 @@ static const struct eth_dev_ops mlx5_dev_ops = {
.flow_ctrl_set = mlx5_dev_set_flow_ctrl,
.mac_addr_remove = mlx5_mac_addr_remove,
.mac_addr_add = mlx5_mac_addr_add,
.mac_addr_set = mlx5_mac_addr_set,
.mtu_set = mlx5_dev_set_mtu,
.reta_update = mlx5_dev_rss_reta_update,
.reta_query = mlx5_dev_rss_reta_query,

View File

@ -179,6 +179,7 @@ int priv_mac_addr_add(struct priv *, unsigned int,
int priv_mac_addrs_enable(struct priv *);
void mlx5_mac_addr_add(struct rte_eth_dev *, struct ether_addr *, uint32_t,
uint32_t);
void mlx5_mac_addr_set(struct rte_eth_dev *, struct ether_addr *);
/* mlx5_rss.c */

View File

@ -488,3 +488,19 @@ mlx5_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
end:
priv_unlock(priv);
}
/**
* DPDK callback to set primary MAC address.
*
* @param dev
* Pointer to Ethernet device structure.
* @param mac_addr
* MAC address to register.
*/
void
mlx5_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
{
DEBUG("%p: setting primary MAC address", (void *)dev);
mlx5_mac_addr_remove(dev, 0);
mlx5_mac_addr_add(dev, mac_addr, 0, 0);
}