]> git.droids-corp.org - dpdk.git/blobdiff - drivers/common/mlx5/linux/mlx5_nl.c
common/mlx5: fix storing synced MAC to internal table
[dpdk.git] / drivers / common / mlx5 / linux / mlx5_nl.c
index 40d86203002783d340fa691fefe5dffbfb642c79..ef7a52137986f1c6dfaed5f357128b0e755cde5e 100644 (file)
@@ -758,11 +758,21 @@ mlx5_nl_mac_addr_sync(int nlsk_fd, unsigned int iface_idx,
                                break;
                if (j != n)
                        continue;
-               /* Find the first entry available. */
-               for (j = 0; j != n; ++j) {
-                       if (rte_is_zero_ether_addr(&mac_addrs[j])) {
-                               mac_addrs[j] = macs[i];
-                               break;
+               if (rte_is_multicast_ether_addr(&macs[i])) {
+                       /* Find the first entry available. */
+                       for (j = MLX5_MAX_UC_MAC_ADDRESSES; j != n; ++j) {
+                               if (rte_is_zero_ether_addr(&mac_addrs[j])) {
+                                       mac_addrs[j] = macs[i];
+                                       break;
+                               }
+                       }
+               } else {
+                       /* Find the first entry available. */
+                       for (j = 0; j != MLX5_MAX_UC_MAC_ADDRESSES; ++j) {
+                               if (rte_is_zero_ether_addr(&mac_addrs[j])) {
+                                       mac_addrs[j] = macs[i];
+                                       break;
+                               }
                        }
                }
        }