const int vf = priv->config.vf;
int ret;
- assert(index < MLX5_MAX_MAC_ADDRESSES);
+ if (index >= MLX5_MAX_MAC_ADDRESSES)
+ return;
+ if (is_zero_ether_addr(&dev->data->mac_addrs[index]))
+ return;
if (vf)
mlx5_nl_mac_addr_remove(dev, &dev->data->mac_addrs[index],
index);
const int vf = priv->config.vf;
unsigned int i;
- assert(index < MLX5_MAX_MAC_ADDRESSES);
+ if (index >= MLX5_MAX_MAC_ADDRESSES) {
+ rte_errno = EINVAL;
+ return -rte_errno;
+ }
+ if (is_zero_ether_addr(mac)) {
+ rte_errno = EINVAL;
+ return -rte_errno;
+ }
/* First, make sure this address isn't already configured. */
for (i = 0; (i != MLX5_MAX_MAC_ADDRESSES); ++i) {
/* Skip this index, it's going to be reconfigured. */