mlx5: don't write directly to netdev->dev_addr
Jakub Kicinski
maintainerPATCH 1/1 mlx5: don't write directly to netdev->dev_addr
Use a local buffer and eth_hw_addr_set().
---
This takes care of Ethernet, mlx5/core/ipoib/ipoib.c will be changed as part of all the IB conversions.
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +5 -2
@@ -4385,12 +4385,15 @@ void mlx5e_build_nic_params(struct mlx5e_priv *priv, struct mlx5e_xsk *xsk, u16static void mlx5e_set_netdev_dev_addr (struct net_device *netdev) {struct mlx5e_priv *priv =netdev_priv (netdev); +u8 addr[ETH_ALEN ]; -mlx5_query_mac_address (priv->mdev, netdev->dev_addr); -if (is_zero_ether_addr (netdev->dev_addr) && +mlx5_query_mac_address (priv->mdev, addr); +if (is_zero_ether_addr (addr) && !MLX5_CAP_GEN (priv->mdev, vport_group_manager)) {eth_hw_addr_random (netdev);mlx5_core_info (priv->mdev,"Assigned random MAC address %pM\n" , netdev->dev_addr); + }else { +eth_hw_addr_set (netdev, addr); } }
Signature · 1 line
2.31.1
Saeed Mahameed
maintainerQuoted 7 lines · Jakub Kicinski
Use a local buffer and
eth_hw_addr_set().Signed-off-by Jakub Kicinski <[email protected]>---
This takes care of Ethernet,mlx5/core/ipoib/ipoib.cwill be changed as part of all the IB conversions.
Hi Jakub,
the patch looks fine, i will take it directly to net-next-mlx5,
I didn't get the part about IB conversions, where can i find that ?
Jakub Kicinski
maintainerQuoted 9 lines · On Wed, 20 Oct 2021 17:54:56 +0000 Saeed Mahameed wrote:
Quoted 6 lines · Jakub Kicinski
Use a local buffer and
eth_hw_addr_set().Signed-off-by Jakub Kicinski <[email protected]>---
This takes care of Ethernet,mlx5/core/ipoib/ipoib.cwill be changed as part of all the IB conversions.the patch looks fine, i will take it directly to net-next-mlx5,
Thanks!
Quoted 1 line
I didn't get the part about IB conversions, where can i find that ?
Here:
Saeed Mahameed
maintainerQuoted 11 lines · Jakub Kicinski
Quoted 9 lines · On Wed, 20 Oct 2021 17:54:56 +0000 Saeed Mahameed wrote:
Quoted 6 lines · Jakub Kicinski
Use a local buffer and
eth_hw_addr_set().Signed-off-by Jakub Kicinski <[email protected]>---
This takes care of Ethernet,mlx5/core/ipoib/ipoib.cwill be changed as part of all the IB conversions.the patch looks fine, i will take it directly to net-next-mlx5,
Quoted 7 lines
Thanks!
Quoted 1 line
I didn't get the part about IB conversions, where can i find that ?
Here:
Thanks,
Had a stupid outlook filter that hides rdma-stuff in some old directory..