From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C5A33EB64D8 for ; Wed, 14 Jun 2023 16:36:20 +0000 (UTC) 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=p4DAS/La4x9pGW0bNaH2aGVPC63H5PUqlLl35YMu0sQ=; b=a/DgMnwZCXZxN/ swdlmpqhLYidftkyCg9pI7jd8SYLTnF5cKPCc0UrU1XFM8eRs+O7oh1ZlOiSF89Ar10L8Se6QP3Ck vlRypyD9FBKkTyxxfqvlmznn36LlnG/UaVTnp0CJOra0Sedi5V5WahdB5IJaVqf7C4uX4u6HiEVgY Wge0vT7CNyd/U1/v0UNUSq2uRbrCs9VeIQloy208xh49751zjRUVkfeiFN+LX9J6PGNLHwxkoPoGb ZkuKH/wzct6n6rJyBMGASS+1JEBtWOLbtvXUuM8yf6i1HHIlCWEbx1RIszIwFKugE+0+t+ob75xpk DqBSDxky1Mz6ypyyhJxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q9TTU-00CDuH-1t; Wed, 14 Jun 2023 16:36:00 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q9TTR-00CDtc-36; Wed, 14 Jun 2023 16:35:59 +0000 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-Disposition: inline In-Reply-To: <20230612075945.16330-6-arinc.unal@arinc9.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230614_093558_022244_130516F8 X-CRM114-Status: GOOD ( 12.32 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel