Skip to content

Commit 5d1a04f

Browse files
maorgottliebkuba-moo
authored andcommitted
net/mlx5: E-Switch, Initialize MAC Address for Default GID
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: 80f09df ("net/mlx5: Eswitch, enable RoCE loopback traffic") Signed-off-by: Maor Gottlieb <[email protected]> Signed-off-by: Mark Bloch <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent eacc77a commit 5d1a04f

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/rdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ static void mlx5_rdma_make_default_gid(struct mlx5_core_dev *dev, union ib_gid *
118118

119119
static int mlx5_rdma_add_roce_addr(struct mlx5_core_dev *dev)
120120
{
121+
u8 mac[ETH_ALEN] = {};
121122
union ib_gid gid;
122-
u8 mac[ETH_ALEN];
123123

124124
mlx5_rdma_make_default_gid(dev, &gid);
125125
return mlx5_core_roce_gid_set(dev, 0,

0 commit comments

Comments
 (0)