* [PATCH] mlx5: don't write directly to netdev->dev_addr
@ 2021-10-13 20:20 Jakub Kicinski
2021-10-20 17:54 ` Saeed Mahameed
0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2021-10-13 20:20 UTC (permalink / raw)
To: saeedm; +Cc: netdev, Jakub Kicinski
Use a local buffer and eth_hw_addr_set().
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
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(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index e81e5505207c..430c9e967f5d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -4385,12 +4385,15 @@ void mlx5e_build_nic_params(struct mlx5e_priv *priv, struct mlx5e_xsk *xsk, u16
static 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);
}
}
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mlx5: don't write directly to netdev->dev_addr
2021-10-13 20:20 [PATCH] mlx5: don't write directly to netdev->dev_addr Jakub Kicinski
@ 2021-10-20 17:54 ` Saeed Mahameed
2021-10-20 18:15 ` Jakub Kicinski
0 siblings, 1 reply; 4+ messages in thread
From: Saeed Mahameed @ 2021-10-20 17:54 UTC (permalink / raw)
To: kuba@kernel.org; +Cc: netdev@vger.kernel.org
On Wed, 2021-10-13 at 13:20 -0700, Jakub Kicinski wrote:
> Use a local buffer and eth_hw_addr_set().
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> This takes care of Ethernet, mlx5/core/ipoib/ipoib.c
> will 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 ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mlx5: don't write directly to netdev->dev_addr
2021-10-20 17:54 ` Saeed Mahameed
@ 2021-10-20 18:15 ` Jakub Kicinski
2021-10-20 23:41 ` Saeed Mahameed
0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2021-10-20 18:15 UTC (permalink / raw)
To: Saeed Mahameed; +Cc: netdev@vger.kernel.org
On Wed, 20 Oct 2021 17:54:56 +0000 Saeed Mahameed wrote:
> On Wed, 2021-10-13 at 13:20 -0700, Jakub Kicinski wrote:
> > Use a local buffer and eth_hw_addr_set().
> >
> > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> > ---
> > This takes care of Ethernet, mlx5/core/ipoib/ipoib.c
> > will be changed as part of all the IB conversions.
>
> the patch looks fine, i will take it directly to net-next-mlx5,
Thanks!
> I didn't get the part about IB conversions, where can i find that ?
Here:
https://lore.kernel.org/all/20211019182604.1441387-3-kuba@kernel.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mlx5: don't write directly to netdev->dev_addr
2021-10-20 18:15 ` Jakub Kicinski
@ 2021-10-20 23:41 ` Saeed Mahameed
0 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2021-10-20 23:41 UTC (permalink / raw)
To: kuba@kernel.org; +Cc: netdev@vger.kernel.org
On Wed, 2021-10-20 at 11:15 -0700, Jakub Kicinski wrote:
> On Wed, 20 Oct 2021 17:54:56 +0000 Saeed Mahameed wrote:
> > On Wed, 2021-10-13 at 13:20 -0700, Jakub Kicinski wrote:
> > > Use a local buffer and eth_hw_addr_set().
> > >
> > > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> > > ---
> > > This takes care of Ethernet, mlx5/core/ipoib/ipoib.c
> > > will be changed as part of all the IB conversions.
> >
> > the patch looks fine, i will take it directly to net-next-mlx5,
>
> Thanks!
>
> > I didn't get the part about IB conversions, where can i find that ?
>
> Here:
>
> https://lore.kernel.org/all/20211019182604.1441387-3-kuba@kernel.org/
Thanks,
Had a stupid outlook filter that hides rdma-stuff in some old
directory..
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-10-20 23:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-13 20:20 [PATCH] mlx5: don't write directly to netdev->dev_addr Jakub Kicinski
2021-10-20 17:54 ` Saeed Mahameed
2021-10-20 18:15 ` Jakub Kicinski
2021-10-20 23:41 ` Saeed Mahameed
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).