All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: dledford@redhat.com, jgg@nvidia.com, linux-rdma@vger.kernel.org,
	saeedm@nvidia.com
Subject: Re: [PATCH rdma-next 2/3] mlx5: use dev_addr_mod()
Date: Thu, 21 Oct 2021 12:49:53 +0300	[thread overview]
Message-ID: <YXE3wblxcVY/1siJ@unreal> (raw)
In-Reply-To: <20211019182604.1441387-3-kuba@kernel.org>

On Tue, Oct 19, 2021 at 11:26:03AM -0700, Jakub Kicinski wrote:
> Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
> of VLANs...") introduced a rbtree for faster Ethernet address look
> up. To maintain netdev->dev_addr in this tree we need to make all
> the writes to it got through appropriate helpers.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: saeedm@nvidia.com
> CC: leon@kernel.org
> CC: linux-rdma@vger.kernel.org
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
> index 67571e5040d6..fe76c27835ae 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
> @@ -472,11 +472,13 @@ int mlx5i_dev_init(struct net_device *dev)
>  {
>  	struct mlx5e_priv    *priv   = mlx5i_epriv(dev);
>  	struct mlx5i_priv    *ipriv  = priv->ppriv;
> +	u8 addr_mod[3];
>  
>  	/* Set dev address using underlay QP */
> -	dev->dev_addr[1] = (ipriv->qpn >> 16) & 0xff;
> -	dev->dev_addr[2] = (ipriv->qpn >>  8) & 0xff;
> -	dev->dev_addr[3] = (ipriv->qpn) & 0xff;
> +	addr_mod[0] = (ipriv->qpn >> 16) & 0xff;
> +	addr_mod[1] = (ipriv->qpn >>  8) & 0xff;
> +	addr_mod[2] = (ipriv->qpn) & 0xff;
> +	dev_addr_mod(dev, 1, addr_mod, sizeof(addr_mod));
                         ^^^ It should be 0, no?

>  
>  	/* Add QPN to net-device mapping to HT */
>  	mlx5i_pkey_add_qpn(dev, ipriv->qpn);
> -- 
> 2.31.1
> 

  reply	other threads:[~2021-10-21  9:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 18:26 [PATCH rdma-next 0/3] rdma: prepare for const netdev->dev_addr Jakub Kicinski
2021-10-19 18:26 ` [PATCH rdma-next 1/3] ipoib: use dev_addr_mod() Jakub Kicinski
2021-10-21  9:51   ` Leon Romanovsky
2021-10-19 18:26 ` [PATCH rdma-next 2/3] mlx5: " Jakub Kicinski
2021-10-21  9:49   ` Leon Romanovsky [this message]
2021-10-21 12:58     ` Jakub Kicinski
2021-10-21 13:40       ` Leon Romanovsky
2021-10-21 13:40   ` Leon Romanovsky
2021-10-19 18:26 ` [PATCH rdma-next 3/3] RDMA: constify netdev->dev_addr accesses Jakub Kicinski
2021-10-21  9:51   ` Leon Romanovsky
2021-10-21 11:48   ` Dennis Dalessandro
2021-10-25 17:36 ` [PATCH rdma-next 0/3] rdma: prepare for const netdev->dev_addr Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YXE3wblxcVY/1siJ@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.