Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4307912rwd; Sun, 4 Jun 2023 02:21:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ46p4MXzW+cGNI6N7L8LiAm6bKF51LZq99W06qn7zyo1ly6uoaJrD+XDqRc76squoglItb5 X-Received: by 2002:a17:903:41c7:b0:1ae:10a5:8349 with SMTP id u7-20020a17090341c700b001ae10a58349mr5211411ple.23.1685870485129; Sun, 04 Jun 2023 02:21:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685870485; cv=pass; d=google.com; s=arc-20160816; b=scvCz/Bu2qQ11sPV3b2jKSmxwuV4AKPk6IuN9enkGFD5FtfedMF48TyiPxAlaAA8ju /xOm1aYhNrj+mUjwtYB1RtYZXtVFmemVpQxZrp4d5j70rw0vT6BN8b2t3mmI4gMkwERB jF/FmtllL6X62PxdBCFOo3TkSP6r41RWYg+V+/XPvOAyio2YVxyqKnatDhdCrcpVaJdq WJVUG3lgshC3Qgre+dpfbcoFnEwfb+Im3w8FEhqKqSukf6IUAtOuPyLF90V5oZ7P7CiL cTsNTneVvzLsYUvCOyE5jDpRAavJoy8Qc0h2mzg++G1Nklre3lJhidw6KqatXLH2XGnb 6k9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JDuiXLCGzzO/Sa1SkbOMDLd2Wht81ovWaQRXAtnD/UY=; b=pNu5Hz3Bk9/9yZgXMmB7fZNgnXiaKK9U4dueUw/95+wkOWL7ZiKaUHUTQHe8IlGPgj ybva0Ot3SmVJkr5pQi2DCkSMoFWVulgG+RkdEoWL+gAEqf9j3aYo99vMUJ0iu3USudzs ZIaiqZq7i0Al6Z9HPAqWfG2In5z4fhr+Fj5VzE9isencwBU8Ql21A8lg0qyqfV2yTyv4 MoOEKBe0xzD4AWbtD317Kfqaf9HEQWSZc8GFRTqIowRvXUJzLMfUi6EhN5voJfydBABj cUCgdxG1cV8ZKkvhR8Z4kZ+QbqNCIbOZjkoUTEtAd4CCUEIJf6FHeZiMWwg3+XaAeE8E M5tw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arinc9.com header.s=zmail header.b=LqF5sL3T; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com>); 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p4-20020a170902e74400b0019e9c8e51f4si3818472plf.165.2023.06.04.02.21.11; Sun, 04 Jun 2023 02:21:25 -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=pass header.i=@arinc9.com header.s=zmail header.b=LqF5sL3T; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com>); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbjFDIw2 (ORCPT + 99 others); Sun, 4 Jun 2023 04:52:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbjFDIw1 (ORCPT ); Sun, 4 Jun 2023 04:52:27 -0400 Received: from sender4-op-o10.zoho.com (sender4-op-o10.zoho.com [136.143.188.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60EECDE; Sun, 4 Jun 2023 01:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685868704; cv=none; d=zohomail.com; s=zohoarc; b=FJsGTPaNwwLnQwoJVsvCPFellmYOjV14iN908lyrurZRKgxf5YHa0VuJG3E4gogNkzVAGqgPHZdYMcULSg2rDWi2FaNwh5nT6Cd/hENl1sSLjPk1qCMxPQUFJY33L42+JHbJ8i+CGRfZg2SO/pT1lqr7Lpzr1s/gOKXCjPC4W14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685868704; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=JDuiXLCGzzO/Sa1SkbOMDLd2Wht81ovWaQRXAtnD/UY=; b=BVIEPJjLJEfUGbTGUhG+66kDFe3C3gg3pvbdGd6NDrCWAkh7/s+TRKcoVVI9OL4oRU6Mhk1IDSGBrloGG7W/ZHNdhE//urc8faVS90EmrtE/9ma918V7HDN5710SshgP4iwuqwhG5E2wbwH73Upk/LuXrTSyxuPIRoPsNuRLQQI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=arinc9.com; spf=pass smtp.mailfrom=arinc.unal@arinc9.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1685868704; s=zmail; d=arinc9.com; i=arinc.unal@arinc9.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=JDuiXLCGzzO/Sa1SkbOMDLd2Wht81ovWaQRXAtnD/UY=; b=LqF5sL3TmyHAitUrJneiLnfE4Lvk/E8L8XFUtOYTTAB0VhJrNSo2vx60b9z9fhlr bko64Va5Z+U4CFn2PXRp4eVTS9qHUlOTzTtncl4wSOk+Kg2bVrhC0mhBBtjk9Ke6RlN TgbRAoCTyZjj5MKPfxtZgIQ5oeUkzh0I0UF0FxFw= Received: from [192.168.66.198] (178-147-169-233.haap.dm.cosmote.net [178.147.169.233]) by mx.zohomail.com with SMTPS id 1685868703012472.04727499914725; Sun, 4 Jun 2023 01:51:43 -0700 (PDT) Message-ID: Date: Sun, 4 Jun 2023 11:51:33 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH net-next 27/30] net: dsa: mt7530: introduce BPDU trapping for MT7530 switch Content-Language: en-US To: Vladimir Oltean Cc: Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , Richard van Schagen , Richard van Schagen , Frank Wunderlich , Bartel Eerdekens , erkin.bozoglu@xeront.com, mithat.guner@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20230522121532.86610-1-arinc.unal@arinc9.com> <20230522121532.86610-28-arinc.unal@arinc9.com> <20230526170223.gjdek6ob2w2kibzr@skbuf> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: <20230526170223.gjdek6ob2w2kibzr@skbuf> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 26.05.2023 20:02, Vladimir Oltean wrote: > On Mon, May 22, 2023 at 03:15:29PM +0300, arinc9.unal@gmail.com wrote: >> From: Arınç ÜNAL >> >> The MT753X switches are capable of trapping certain frames. Introduce >> trapping BPDUs to the CPU port for the MT7530 switch. >> >> BPDUs will be trapped to the numerically smallest CPU port which is affine >> to the DSA conduit interface that is set up. The BPDUs won't necessarily be >> trapped to the CPU port the user port, which these BPDUs are received from, >> is affine to. >> >> Tested-by: Arınç ÜNAL >> Signed-off-by: Arınç ÜNAL >> --- >> drivers/net/dsa/mt7530.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c >> index cd16911fcb01..2fb4b0bc6335 100644 >> --- a/drivers/net/dsa/mt7530.c >> +++ b/drivers/net/dsa/mt7530.c >> @@ -2223,6 +2223,10 @@ mt7530_setup(struct dsa_switch *ds) >> val |= MHWTRAP_MANUAL; >> mt7530_write(priv, MT7530_MHWTRAP, val); >> >> + /* Trap BPDUs to the CPU port */ >> + mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK, >> + MT753X_BPDU_CPU_ONLY); >> + > > If the switch doesn't currently trap BPDUs, isn't STP broken? No, the BPDU_PORT_FW bits are 0 after reset. The MT7620 programming guide states that frames with 01:80:C2:00:00:00 MAC DA (which is how the BPDU distinction is being made) will follow the system default which means the BPDUs will be treated as normal multicast frames. Only if all 3 bits are set will the BPDUs be dropped. > > ip link add br0 type bridge stp_state 1 > (with or without a userspace helper installed at /sbin/bridge-stp > for more modern protocols than the original 802.1D STP) For reference, the mstpd package on Buildroot includes this. Arınç