]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5: E-Switch, Initialize MAC Address for Default GID
authorMaor Gottlieb <maorg@nvidia.com>
Wed, 23 Apr 2025 08:36:08 +0000 (11:36 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Apr 2025 01:19:56 +0000 (18:19 -0700)
Initialize the source MAC address when creating the default GID entry.
Since this entry is used only for loopback traffic, it only needs to
be a unicast address. A zeroed-out MAC address is sufficient for this
purpose.
Without this fix, random bits would be assigned as the source address.
If these bits formed a multicast address, the firmware would return an
error, preventing the user from switching to switchdev mode:

Error: mlx5_core: Failed setting eswitch to offloads.
kernel answers: Invalid argument

Fixes: 80f09dfc237f ("net/mlx5: Eswitch, enable RoCE loopback traffic")
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://patch.msgid.link/20250423083611.324567-3-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/rdma.c

index a42f6cd99b74482d2ff642795563a18b32e7de33..f585ef5a3424396ae9ce1cda1ed22497783d5cb8 100644 (file)
@@ -118,8 +118,8 @@ static void mlx5_rdma_make_default_gid(struct mlx5_core_dev *dev, union ib_gid *
 
 static int mlx5_rdma_add_roce_addr(struct mlx5_core_dev *dev)
 {
+       u8 mac[ETH_ALEN] = {};
        union ib_gid gid;
-       u8 mac[ETH_ALEN];
 
        mlx5_rdma_make_default_gid(dev, &gid);
        return mlx5_core_roce_gid_set(dev, 0,