MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_mac_addr_add

Function mlx5_mac_addr_add

dpdk/drivers/net/mlx5/mlx5_mac.c:122–138  ·  view source on GitHub ↗

* DPDK callback to add a MAC address. * * @param dev * Pointer to Ethernet device structure. * @param mac_addr * MAC address to register. * @param index * MAC address index. * @param vmdq * VMDq pool index to associate address with (ignored). * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

120 * 0 on success, a negative errno value otherwise and rte_errno is set.
121 */
122int
123mlx5_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac,
124 uint32_t index, uint32_t vmdq __rte_unused)
125{
126 int ret;
127
128 if (index >= MLX5_MAX_UC_MAC_ADDRESSES) {
129 rte_errno = EINVAL;
130 return -rte_errno;
131 }
132 ret = mlx5_internal_mac_addr_add(dev, mac, index);
133 if (ret < 0)
134 return ret;
135 if (!dev->data->promiscuous)
136 return mlx5_traffic_restart(dev);
137 return 0;
138}
139
140/**
141 * DPDK callback to set primary MAC address.

Callers 3

mlx5_mac_addr_setFunction · 0.85
mlx5_dev_spawnFunction · 0.85
mlx5_dev_spawnFunction · 0.85

Calls 2

mlx5_traffic_restartFunction · 0.85

Tested by

no test coverage detected