From patchwork Tue Oct 19 18:26:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12570917 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 369D1C433EF for ; Tue, 19 Oct 2021 18:26:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BF716139D for ; Tue, 19 Oct 2021 18:26:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234483AbhJSS2s (ORCPT ); Tue, 19 Oct 2021 14:28:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:47040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233816AbhJSS2o (ORCPT ); Tue, 19 Oct 2021 14:28:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 90FC9613A4; Tue, 19 Oct 2021 18:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634667991; bh=kezj01FP78O6jTIr8auqDeAgej/KAvIDztgVq52Zu0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NbcNsNq3S9yjHXIOQIyYVZagY+lSsmL9wM6XG1oHk9u7onATM9BdYyGcLkQ7ZJ5Yi MyLZCjgZazfmk0AKL2BxurM/du6EYqyozHoTNO/HGnFPGjCuo/aGrquLaTndLttJ+H YcCQ1rA3GdwYWj4UNuLSkcjgiQHET+/FE//lEp7uw2TLvyBDnNwv2o7fsldWcvKBT3 tJhNAsH/T0emyFzgt9xZ8uC03wyFlV1siGkIa0swLMrhW5YzTMh3VuctaqilOufS9A EEPnFh/f/8R84VrP7hNTn0FqtAciNfdRx1DjcgXcWoCPQg3aAaKcr1bRWvEHOxlyQj BnUCRSS28n5Ow== From: Jakub Kicinski To: dledford@redhat.com, jgg@nvidia.com Cc: linux-rdma@vger.kernel.org, Jakub Kicinski , saeedm@nvidia.com, leon@kernel.org Subject: [PATCH rdma-next 2/3] mlx5: use dev_addr_mod() Date: Tue, 19 Oct 2021 11:26:03 -0700 Message-Id: <20211019182604.1441387-3-kuba@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211019182604.1441387-1-kuba@kernel.org> References: <20211019182604.1441387-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 Reviewed-by: Leon Romanovsky --- 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)); /* Add QPN to net-device mapping to HT */ mlx5i_pkey_add_qpn(dev, ipriv->qpn);