From patchwork Fri Oct 15 19:38:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12562715 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 6664EC433FE for ; Fri, 15 Oct 2021 19:40:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 32F3460FE3 for ; Fri, 15 Oct 2021 19:40:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 32F3460FE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FNJxOvqus2gon3gNTOvY8NP85sclclStR2+5/ZaQVc4=; b=qbqEqsDe5KepC1 hQBaA55LIH3m05U/aBoRF7FFSMxS4Npzb8LYsc6zFoNOKmUQ1rRQaZFtNom+LlRhMRhunAe4pM8N/ ud4vMXsVUvL7g2/ylOmcK+C7rdnuyW6g9oSC4KPSK7W9E9gsJ/MZRZN+cMPoS2WZk8nW6Yte0P9sC tcDge9WMPwchSSu9UkaarDDrMI6AX7hD7ueDeN7BLR7qH6FhH3xaxemOWmfNOrBFEpX6RJtxhnS1h lIGino0iuMmGwJ3ex86XHxLl4jpKIkUDfXFyWb3rYvAk1VNZ+BdA1IE6aYwiPhKrLqBmynP1t2bdX AZ0Z7qZp0u8MQcNUjoXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbT2t-008cbI-EI; Fri, 15 Oct 2021 19:39:11 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbT2h-008cZC-2N for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 19:39:00 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 61E23611CE; Fri, 15 Oct 2021 19:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634326738; bh=6uFO95BN/xrQKbOn4Vvtf8HObXa+wJ7r9KR4eAFX2r4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UlOcikDPQK5qOHLPoXnMhure6248BRumpYf0PLp8bMfsoEhY6E2rsJIkXpsSXGk3l qFs04zTRQL9CD8PFmz2jewJDVxZNEsZ4nB2xt7eI6a3CgXSo0F88TWaFg+xfKp3V+f rIzf1SwoFL7OZEI5qGmnK+W//KUejsRpk4D3cRwyQaMwjRaGNHA+3QJ/EUGtrmsIHz /4SfCDfx4v5LUn5HceJ/18KZtujDEYkeasSAJSlSPjEIblcZECRLgIIgeKGR8iJKED NHWMlYtLjb4sWetcRfwuNv5lIZxa6XwCKI/YCPFf9Rwn3qIYpw9iRLhsA5Z2Hqq9ay wFgssf2X8Z7Tg== From: Jakub Kicinski To: netdev@vger.kernel.org Cc: olteanv@gmail.com, andrew@lunn.ch, idosch@idosch.org, f.fainelli@gmail.com, Jakub Kicinski , lars.povlsen@microchip.com, Steen.Hegelund@microchip.com, UNGLinuxDriver@microchip.com, bjarni.jonasson@microchip.com, linux-arm-kernel@lists.infradead.org Subject: [RFC net-next 6/6] ethernet: sparx5: use eth_hw_addr_set_port() Date: Fri, 15 Oct 2021 12:38:48 -0700 Message-Id: <20211015193848.779420-7-kuba@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211015193848.779420-1-kuba@kernel.org> References: <20211015193848.779420-1-kuba@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_123859_159628_BD38E26A X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- CC: lars.povlsen@microchip.com CC: Steen.Hegelund@microchip.com CC: UNGLinuxDriver@microchip.com CC: bjarni.jonasson@microchip.com CC: linux-arm-kernel@lists.infradead.org --- drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c index b21ebaa32d7e..d56822f6d09e 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c @@ -200,7 +200,6 @@ struct net_device *sparx5_create_netdev(struct sparx5 *sparx5, u32 portno) { struct sparx5_port *spx5_port; struct net_device *ndev; - u64 val; ndev = devm_alloc_etherdev(sparx5->dev, sizeof(struct sparx5_port)); if (!ndev) @@ -216,8 +215,7 @@ struct net_device *sparx5_create_netdev(struct sparx5 *sparx5, u32 portno) ndev->netdev_ops = &sparx5_port_netdev_ops; ndev->ethtool_ops = &sparx5_ethtool_ops; - val = ether_addr_to_u64(sparx5->base_mac) + portno + 1; - u64_to_ether_addr(val, ndev->dev_addr); + eth_hw_addr_set_port(ndev, sparx5->base_mac, portno + 1); return ndev; }