* 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. */
| 120 | * 0 on success, a negative errno value otherwise and rte_errno is set. |
| 121 | */ |
| 122 | int |
| 123 | mlx5_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. |
no test coverage detected