Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3036590rwd; Wed, 14 Jun 2023 10:18:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wvnT7FXW/YVu6Tji49xRuG8lrXWegNIiKxiLRdGhe8NWfCR0oK6Jid0V4epmYDvfrNhjN X-Received: by 2002:a05:6808:18a1:b0:39c:475e:d78a with SMTP id bi33-20020a05680818a100b0039c475ed78amr12860506oib.17.1686763090713; Wed, 14 Jun 2023 10:18:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686763090; cv=none; d=google.com; s=arc-20160816; b=u0LgsQxssLiklg4XPPcQaqMqhLRhhUVhk06E2puwvjuHAYOoMRUW7bmTvX8Aykjdw4 1w73oICmqYQO14iO1bMyB4fvM1YYOthGjEbfiM4qY8jS022W010o7gZwulp3r7cJJlIl nKOh88tx+xNjepetpNC7yovXhqkOYscmqPMjegoJaCPLcDWrMUZvoEvV6hxyf90R9g4D TK+e96cEeWNsfCsogBIDH3ym+OFycJXgRiN5Z6bWzZZy0mDQ0eVGdCgItHl61VnrMt/v L2S0/5Yi2F7f4+sXEE/TbeCeZARDwoBYV7elHDyyum6xF2+STumJeswSXDgaV0z80NC3 nYEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zoOW0ZiNmDtu4Zp3WTG84bXR18T6RnQ3c3NcObSn0t8=; b=HpMOf4Za1EixI2MFt45b7N2G7FOW6sdbFQErqx8asbrIdop+aIQObeM5Ktz3mVqZAp 3Hyv0WCGypfboY+I4aKmaJ7AV6u+BWxMZh7K7W4ibValudFamGB19jPDm7jhEGXrYbTa wMMd4OhOa2Pic8FsqXs1P1WuuJuV98qXbTBWX7NXGD+wNIwqCc6bwa+7RMiqNzLoTT0E uAaztTRoouKuWQBrhw1DMGXDfvGyK7d5IAtDBAlMy7MSmnrRBMg8cCK2XFVAmqPwAkS8 sWu6NutoZoB1HoRwWVgO91ZKvs+vrZhCnIs5aYtGrKY79hhELYngxm1wzrylasOolYC/ u4Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Bb3i7EXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8-20020a17090a4ec800b002528157a968si7008558pjl.2.2023.06.14.10.17.58; Wed, 14 Jun 2023 10:18:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Bb3i7EXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232203AbjFNQgH (ORCPT + 99 others); Wed, 14 Jun 2023 12:36:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234804AbjFNQf6 (ORCPT ); Wed, 14 Jun 2023 12:35:58 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BB20212D; Wed, 14 Jun 2023 09:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zoOW0ZiNmDtu4Zp3WTG84bXR18T6RnQ3c3NcObSn0t8=; b=Bb3i7EXg2Y5DTbLx+ObL7QLd/D jgRwevR8K93fkQzVkpKNWJeuU1DV0SQJyrjUzV0paDYYP4O+no2MUy7XO/bN5wCyeIphi3BxRh+6S up0KL9lrh/D405RcUMuTNH6yuU6BLYwY7GbK4L+40EMEikPibJFTVYwnSRuwQFxqMRl1ZoAx9Q+Sg W+O9ol0pR8b93ga77s72wLAwkOGU8vdaaLco2KWyGet7IGTIPzFwGJD4/IHT26B4nKvDtAHffUkOM jr2D8zvvqd/5T2YRLQKutIEak/K5remDMD3C7Zh2g2mcWUGi/rYxD/T8RCW8Jm1Ghilc093L3aBWy 48uP04Hg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:41334) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q9TT7-0001za-L5; Wed, 14 Jun 2023 17:35:37 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1q9TT0-0000ZE-28; Wed, 14 Jun 2023 17:35:30 +0100 Date: Wed, 14 Jun 2023 17:35:30 +0100 From: "Russell King (Oracle)" To: arinc9.unal@gmail.com Cc: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Frank Wunderlich , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH net v4 5/7] net: dsa: mt7530: fix handling of LLDP frames Message-ID: References: <20230612075945.16330-1-arinc.unal@arinc9.com> <20230612075945.16330-6-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230612075945.16330-6-arinc.unal@arinc9.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 12, 2023 at 10:59:43AM +0300, arinc9.unal@gmail.com wrote: > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c > index e4c169843f2e..8388b058fbe4 100644 > --- a/drivers/net/dsa/mt7530.c > +++ b/drivers/net/dsa/mt7530.c > @@ -2261,7 +2261,11 @@ mt7530_setup(struct dsa_switch *ds) > > /* Trap BPDUs to the CPU port */ > mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK, > - MT753X_BPDU_CPU_ONLY); > + MT753X_PORT_FW_CPU_ONLY); > + > + /* Trap LLDP frames with :0E MAC DA to the CPU port */ > + mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_PORT_FW_MASK, > + MT753X_R0E_PORT_FW(MT753X_PORT_FW_CPU_ONLY)); > > /* Enable and reset MIB counters */ > mt7530_mib_reset(ds); > @@ -2364,7 +2368,11 @@ mt7531_setup_common(struct dsa_switch *ds) > > /* Trap BPDUs to the CPU port(s) */ > mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK, > - MT753X_BPDU_CPU_ONLY); > + MT753X_PORT_FW_CPU_ONLY); > + > + /* Trap LLDP frames with :0E MAC DA to the CPU port(s) */ > + mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_PORT_FW_MASK, > + MT753X_R0E_PORT_FW(MT753X_PORT_FW_CPU_ONLY)); Looking at the above two hunks, they look 100% identical. Given that they are both setting up trapping to the CPU port, maybe they should be moved into their own common function called from both setup() functions? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!