Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4161093rwd; Sun, 11 Jun 2023 01:40:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6f5j0PMBFqpawm2UZWVPp7VEXJHJbVyJWEtLQ0LpHqGKJnOs/un7IMxc9yUXmO4xAel1h7 X-Received: by 2002:a05:6a20:e686:b0:106:25b3:2f92 with SMTP id mz6-20020a056a20e68600b0010625b32f92mr5683109pzb.52.1686472802477; Sun, 11 Jun 2023 01:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686472802; cv=none; d=google.com; s=arc-20160816; b=hDdbZVqfyy9+hViTmXWofvp9fX7xU1URNV1+dP7YUUfpNgxOUIs0u0h/cI8Un/PT6F jlRRRJdpWYFXS5jHfPltPETODmckvMsFCFHhbnKgAK9Cqi+b8HvyGFIpUhNw7HL/Z7S+ RCNBJovtqpi0+rrey5EdKBaOI2kgxBCJ1lGi7gqXmHnks1CKJ2H4DqpbuEqt5fcfkyhy qeV4MCr4QggXslngnCzPsi2OdAgDNd7OTbu9+kFKWz9ylT08bJAcZO91cPiqn/bUasBr Wnwcwno9Lj/2+AmVb9CSlg3KoaL8vwRyHbhB57nsEu2Z1sxJIR5Q17T+K8VnPSGu99J1 NQyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xBp71EpjbBFFfBTbE6StpwPfHx+ioBBfY02xa9s3Mk8=; b=si3en01R8udBxEA3Vow7H05n0SX88rr9G2EenBtqX/oG6iDUi3iFvRPQe815iSwuQi ZVji1DfBm2DucyP3CKjmpKHyC66Woo6fgrQ+R64vIDrNCDrIIzZMeutZMfvInZUB/ic1 fm0Bc6Z+jLhKe5XPghmNSyWcCzjaphMUJDh6arLM1nHKzLaM0IFlAQBhXK5+lHCJMhOC szt//e0s5gxv1wr+aLQsvoH+jydaHDfJDFslkUyrWCwU5A3s62+3QEVP1rUTKsSfthxR X+HgPekxDnhXv631FtHS18vOuQq8/TStC3HhZwSfM054H20lDmGvqbtJveZKuRfu+0F5 8Ftw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=HTAA5G6Z; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv67-20020a632e46000000b00534882d5325si5524672pgb.96.2023.06.11.01.39.50; Sun, 11 Jun 2023 01:40:02 -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=@gmail.com header.s=20221208 header.b=HTAA5G6Z; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231912AbjFKIQ2 (ORCPT + 99 others); Sun, 11 Jun 2023 04:16:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231248AbjFKIQS (ORCPT ); Sun, 11 Jun 2023 04:16:18 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C053B30CB; Sun, 11 Jun 2023 01:16:16 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f7f4819256so23887925e9.1; Sun, 11 Jun 2023 01:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686471375; x=1689063375; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xBp71EpjbBFFfBTbE6StpwPfHx+ioBBfY02xa9s3Mk8=; b=HTAA5G6Z9E/VB73DHO4rxeAG1KAOC1C45MY5RXkHifPQt7FGNuWFvjdVs5m0bne+lk 3BCWrTHY9yy7USuha4gY3tEjvNAnim+d6kKHvOL/XIQpv0IXDMzLEFfWlijpbswHPAsh RKEa/QF5dlzFQlsF/ZLH1lwPA6F5gewpZaHvRgEMub4iw5/sfjsKUFCF+3aXnNK4NEG7 xsvAmXF+jCmnUFzYBs9oz6fvy948T7na2FEi7zlczXwFmdlhieRn+rt1Bg6EUYapMHVc Pg5UTkssCyteoY05EJWkD440ZcdgzpzhWb3Zno14TGc45jVJj1zIi1cn55gkXBWuEU3j z2lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686471375; x=1689063375; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xBp71EpjbBFFfBTbE6StpwPfHx+ioBBfY02xa9s3Mk8=; b=U4G8vM7ookhuFT0LpPvbbFLc4xJvSfuCjp+mtQXtMlO0YIfOy+xzVNn8fn9XfDDZXc J2jqDp/+ewavrDjDhvbRuLSr9uMZi/ZYrw7lRO9t9d6BuSBu70vZtvbv+jWqmjNYiQDl dk/KOXdneYzePFNJwH7vCG8VhI/5ikiwJv5uo4fNEiSAmfx7fkzARPDKXCLpKIQlP406 sKcqYDK/AmTDOyYsjCfbwjbyvX1lQaQTrYd9vvMl2MjfVYLF81b6iae1mVMewT+uq8cP NPk9hLaFDVd+6V7zcd6jPWPF+cym1RzWRnCM3m+y5MKqRGEmSnFFfvqAeVer6u/tqxCu A90w== X-Gm-Message-State: AC+VfDyDgnjztRfS+gKqA6AeDcPsf7vqcrMa3UdtaMu79XOyzgezR0aR 645pej0InEN4ui5iPRk7MWQ= X-Received: by 2002:a7b:cb90:0:b0:3f5:878:c0c2 with SMTP id m16-20020a7bcb90000000b003f50878c0c2mr4382412wmi.3.1686471374902; Sun, 11 Jun 2023 01:16:14 -0700 (PDT) Received: from arinc9-Xeront.lan (178-147-169-233.haap.dm.cosmote.net. [178.147.169.233]) by smtp.gmail.com with ESMTPSA id s5-20020a7bc385000000b003f6132f95e6sm7748979wmj.35.2023.06.11.01.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Jun 2023 01:16:14 -0700 (PDT) From: "=?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?=" X-Google-Original-From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= To: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , 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 , Russell King Cc: Landen Chao , 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: [PATCH net v2 4/7] net: dsa: mt7530: fix handling of BPDUs on MT7530 switch Date: Sun, 11 Jun 2023 11:15:44 +0300 Message-Id: <20230611081547.26747-4-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230611081547.26747-1-arinc.unal@arinc9.com> References: <20230611081547.26747-1-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 BPDUs are link-local frames, therefore they must be trapped to the CPU port. Currently, the MT7530 switch treats BPDUs as regular multicast frames, therefore flooding them to user ports. To fix this, set BPDUs to be trapped to the CPU port. BPDUs received from a user port will be trapped to the numerically smallest CPU port which is affine to the DSA conduit interface that is up. Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch") Signed-off-by: Arınç ÜNAL --- v2: Add this patch. --- 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 df2626f72367..c2af23f2bc5d 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2259,6 +2259,10 @@ mt7530_setup(struct dsa_switch *ds) priv->p6_interface = PHY_INTERFACE_MODE_NA; + /* Trap BPDUs to the CPU port */ + mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK, + MT753X_BPDU_CPU_ONLY); + /* Enable and reset MIB counters */ mt7530_mib_reset(ds); -- 2.39.2