From patchwork Tue May 8 16:12:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10386457 X-Patchwork-Delegate: idosch@idosch.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B2A926037F for ; Tue, 8 May 2018 16:12:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A130528FED for ; Tue, 8 May 2018 16:12:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95E4828FF4; Tue, 8 May 2018 16:12:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DB5BC28FED for ; Tue, 8 May 2018 16:12:29 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40gPdm2FLjzF1my for ; Wed, 9 May 2018 02:12:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="YGcRsUk7"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=104.47.2.67; helo=eur01-db5-obe.outbound.protection.outlook.com; envelope-from=petrm@mellanox.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="YGcRsUk7"; dkim-atps=neutral Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0067.outbound.protection.outlook.com [104.47.2.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40gPdf41VmzF1fk for ; Wed, 9 May 2018 02:12:21 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gY4HOHuIWq07C6aFdTj/OJIXCiziIB2PF9kPIW94S3s=; b=YGcRsUk7Zht/GwYe58lzh3w2SPWxYKZL52dc99aeQnze3G7Q/Ly/aL7H3oHZmlM/LbVbFefEh6wOHY2uh1yXIW2lyMID0vW7wE6eHnWq1p6cePgfInLBSiH/B+JceKuxJF702UscyfwzcCBLLYOeN2+47ivcismL3st/xZXaJk0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by VI1PR05MB4190.eurprd05.prod.outlook.com (2603:10a6:803:4e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.17; Tue, 8 May 2018 16:12:14 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw 1/2] mlxsw: spectrum_span: Rename misnamed variable l3edev In-Reply-To: References: Message-Id: <3de35c5fe71c1fbff619feee056821e9cf34604e.1525795691.git.petrm@mellanox.com> Date: Tue, 08 May 2018 18:12:09 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [78.45.160.211] X-ClientProxiedBy: HE1PR05CA0380.eurprd05.prod.outlook.com (2603:10a6:7:94::39) To VI1PR05MB4190.eurprd05.prod.outlook.com (2603:10a6:803:4e::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4190; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4190; 3:1nKonBrSXFXrqT9NnFKUM4eQ5mem8lpk991x2iHXoV/IfrxZ5v3r/AtA4DgY+1Gc6ZtWWBmCVMD4iPePYuZJLq6MCcukTMoZUrhbqZROlCR4JVIhSxQgSFPL2EV8443vW6hmBkYEpb/0j22fV5o/eg4Q6TWvHvIWl8K+mJXt5Uvidkalu2VY/34wTKChAGmWXYX0yX8nnL3vu0IDQAp6bk4NUm9NGnNd/qmPddo/LbHPOvkwhh6PBlMUMrUX3que; 25:QqthfLEz4+0ejXnher99NCZSBquE/KftXqlX7U1YxHe3baHQ8IKlvj0jpYe2up1ur//uzwuRnSrsL1FyWfu7wR2ItaGERzBtavW0eicB8Q4EHMApo2FU4Lf1QXE8dBffpQmKXJ52AYggYQwwAMD/aBzV8lr+EEoKPmxBIdEiYlCV026dqZm2ODdZH5rM8YdxCUQWaa3lOUlT968+BWj52iqRFukrKeRKdbDNDgfKKS34ugLusbbT9H6pPgNNwpEDOUnHrCEAC4hY2YfPahwd5uAZaYHtMOMB7Pq7jtPggUva+vZ6o1WSBPkG24zVd4IYSiHl8tr9fUnN6f1sAmp22A==; 31:GsIcnMXiLu/L34N7VfrciF2BxIrmgRBp+8zPT86e/cs/FZw8DWLGkkRp2lWK/isTiAVAqa/KwjvAiCYh+snqJFTMYYbFHlUDNN3sRQo/0SK4s7Rdh6pJvdHIaTN7BZViDOYaEmrKSxSEXeDdgCWEOBaByy1DX8rzGDP4kUwk29fb4ajiM1PbvnVrrG9tspKJNjawlIcTNEhH7hLF1jWkuisrJXm5Jf/IXCkc3ZPuew8= X-MS-TrafficTypeDiagnostic: VI1PR05MB4190: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4190; 20:WQkcsLVQn3LH0fWqWOcD4g5ZZgoD0Q45Lt4uqkuToG4Dnkqg/Sv1qX8yC+DvEF67Y+r/SPncntdQjGx+c+bPPOyoBT7wKt96FLLyAtkuVvXnuZa+PL+Au5+LlqWioLF5N75A4l2Mur1Ocr8eQyh2Pir3j32GmdDvlGQ79b4r6lAjUWAbb8Bgs5kHGo/ilhN3TR84o0i2KrH4NauYd90chpPhP62310WHOCGrfspwDB6pGbYEHkFxLFTQsRhZCw5vMDOYW97defi/bFqV+PjeFA3ta4ZhIRh9Rd46bWHrK2ijVgvRBFs2DSji627AeE2mWcHHNh386nsVOoNq3y+x7bc7OEAYAD+CQFNhhUENR/5IFoV9iw4G/bw3ct43PziYuFty/wxO+xjjueBMKL29diLSfG4TJO0IqKIqMld45QEjvqchIsFo++m9GrTfxMHYpcaT3qk+E7RZV2znbKY5nxYAvoN7g0spJ+LF8rWoYuBV6OoVj8nGHtRD+r7K5Sdg; 4:TwD0Ol/fkP5b1M2crKfliYSHbXw1Quph5vXTaj1iuDfzs/hpkQC6fkLtoISHQmQ1ytWBWssBDykROEiBrTXGhDPJAN9MkdFSsqUk8wQQ5ey4T1pKvTsJ8Xt3/mCbtB6KoNRH7MWFmwekwePPuAnq85v6NF1JPIC/YERgyUrhpDC3CcFK2zvbELsNW8FmRXWkWCPAB5kmuyBHpdVnb5NXaKrmaX4BJgmuWYRroyMFKFRj5X04Pn8f74wFD43RAZsDn+28ACnT0fhFyEMRDaDisQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:VI1PR05MB4190; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4190; X-Forefront-PRVS: 0666E15D35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(376002)(346002)(396003)(366004)(189003)(199004)(66066001)(76176011)(478600001)(68736007)(6486002)(52116002)(446003)(6496006)(2616005)(51416003)(486006)(11346002)(476003)(956004)(25786009)(4326008)(47776003)(36756003)(118296001)(50466002)(48376002)(6116002)(97736004)(105586002)(5660300001)(81156014)(107886003)(7736002)(3846002)(2906002)(53936002)(106356001)(86362001)(16586007)(316002)(6666003)(26005)(6916009)(386003)(81166006)(58126008)(8676002)(305945005)(16526019)(8936002)(2351001)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4190; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB4190; 23:0fBcv4XdE+478pb2vfwumcgIEPM8kQ/DPmpxNMets?= =?us-ascii?Q?/PIl+YdUcFLeI/p3FP+3Oev4pnGi9+O6iq+62AXCUyYJBHe+2hvFmRjo2ovf?= =?us-ascii?Q?q3pa1bZ0lFsgkPxF2agBKYgr37vA5uJp5XWWCRNWC34v1xMKubDqOURbcnZN?= =?us-ascii?Q?CFYkDze47qgRycb1FbFrE450H4nn7ozYWzdAs6jvTgNufzd002Uk5xdxr4Ov?= =?us-ascii?Q?utPEuJGtBBVY+hukt74DahVhabDicDNFGC+++0CPlO9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rkgIZdKoZcM+fv5SITL3CrKu4VbY4hc85iTNlNsLiUTDKfuWeFpDghKEe10tq78= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4190; 7:RKcRkclJCcsovV0+ofO8hNcgkGmG7p6pk0nxy2g7a09GM7yc/3fqfWLIih/76gqmFtKkmAa2iz5Bukc1a3aTXm2Q+ebpHJG8U2sx2mUCZk3glqrcgziepKTtdPCabvG1J8OO9TD60sCWpvebetYOeYmNiXmLawTand0J4CJo+CodwtNWUcwmbH81Zh7qw1gqfK3dcQ+aStX9xDuAJX4yBwlZzfRlWaLpQ7zBGpENDS2RJKngDCoi355STcx0/KrV X-MS-Office365-Filtering-Correlation-Id: 108a5fa1-4a09-4f5e-40cf-08d5b4fe76da X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 16:12:14.6032 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 108a5fa1-4a09-4f5e-40cf-08d5b4fe76da X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4190 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-internal@mellanox.com Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org X-Virus-Scanned: ClamAV using ClamSMTP Calling the variable l3edev was relevant when neighbor lookup was the last stage in the simulated pipeline. Now that mlxsw handles bridges and vlan devices as well, calling it "L3" is a misnomer. Thus in mlxsw_sp_span_dmac(), rename to "dev", because that function is just a service routine where the distinction between tunnel and egress device isn't necessary. In mlxsw_sp_span_entry_tunnel_parms_common(), rename to "edev" to emphasize that the routine traces packet egress. Signed-off-by: Petr Machata --- .../net/ethernet/mellanox/mlxsw/spectrum_span.c | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c index 3b77990..adf1f78 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c @@ -137,14 +137,14 @@ struct mlxsw_sp_span_entry_ops mlxsw_sp_span_entry_ops_phys = { static int mlxsw_sp_span_dmac(struct neigh_table *tbl, const void *pkey, - struct net_device *l3edev, + struct net_device *dev, unsigned char dmac[ETH_ALEN]) { - struct neighbour *neigh = neigh_lookup(tbl, pkey, l3edev); + struct neighbour *neigh = neigh_lookup(tbl, pkey, dev); int err = 0; if (!neigh) { - neigh = neigh_create(tbl, pkey, l3edev); + neigh = neigh_create(tbl, pkey, dev); if (IS_ERR(neigh)) return PTR_ERR(neigh); } @@ -246,7 +246,7 @@ mlxsw_sp_span_entry_vlan(const struct net_device *vlan_dev, } static __maybe_unused int -mlxsw_sp_span_entry_tunnel_parms_common(struct net_device *l3edev, +mlxsw_sp_span_entry_tunnel_parms_common(struct net_device *edev, union mlxsw_sp_l3addr saddr, union mlxsw_sp_l3addr daddr, union mlxsw_sp_l3addr gw, @@ -260,31 +260,31 @@ mlxsw_sp_span_entry_tunnel_parms_common(struct net_device *l3edev, if (mlxsw_sp_l3addr_is_zero(gw)) gw = daddr; - if (!l3edev || mlxsw_sp_span_dmac(tbl, &gw, l3edev, dmac)) + if (!edev || mlxsw_sp_span_dmac(tbl, &gw, edev, dmac)) goto unoffloadable; - if (is_vlan_dev(l3edev)) - l3edev = mlxsw_sp_span_entry_vlan(l3edev, &vid); + if (is_vlan_dev(edev)) + edev = mlxsw_sp_span_entry_vlan(edev, &vid); - if (netif_is_bridge_master(l3edev)) { - l3edev = mlxsw_sp_span_entry_bridge(l3edev, dmac, &vid); - if (!l3edev) + if (netif_is_bridge_master(edev)) { + edev = mlxsw_sp_span_entry_bridge(edev, dmac, &vid); + if (!edev) goto unoffloadable; } - if (is_vlan_dev(l3edev)) { - if (vid || !(l3edev->flags & IFF_UP)) + if (is_vlan_dev(edev)) { + if (vid || !(edev->flags & IFF_UP)) goto unoffloadable; - l3edev = mlxsw_sp_span_entry_vlan(l3edev, &vid); + edev = mlxsw_sp_span_entry_vlan(edev, &vid); } - if (!mlxsw_sp_port_dev_check(l3edev)) + if (!mlxsw_sp_port_dev_check(edev)) goto unoffloadable; - sparmsp->dest_port = netdev_priv(l3edev); + sparmsp->dest_port = netdev_priv(edev); sparmsp->ttl = ttl; memcpy(sparmsp->dmac, dmac, ETH_ALEN); - memcpy(sparmsp->smac, l3edev->dev_addr, ETH_ALEN); + memcpy(sparmsp->smac, edev->dev_addr, ETH_ALEN); sparmsp->saddr = saddr; sparmsp->daddr = daddr; sparmsp->vid = vid;