Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2006791rwd; Thu, 15 Jun 2023 20:10:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4mShqqhLZdFpiI30aOlU+cFl/0V9Mh/C++zIx0bxCqDgRcoVcrA92uvhPNRWtYH/uiqmAB X-Received: by 2002:a05:6a21:9984:b0:11e:e940:441d with SMTP id ve4-20020a056a21998400b0011ee940441dmr824405pzb.22.1686885058393; Thu, 15 Jun 2023 20:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686885058; cv=none; d=google.com; s=arc-20160816; b=OmrxSdnAIIQmk4nBFFNVljNhHuMoc2lwb6C8el8gWD7CE/WScgT0cEt7AIvS3eCgSv 4ryiBUIHl6qokUeep+nhImsi7RibNH15ktqe08fW63HpBUzRzWL5HKrjld+VnDkQEcIp lKY3PNS22OUj76IT7kKM1gmzTQIV+SAfNjWQFuLCaUG228M4MY+x/DjX61b78E14OaNW Sl9N6DXBCoqaK815S4+cmu9+cRnZRZT9OKvNv2xT9yggps+T82lCsk6zkuLMbfgYjw4z SfR8gcVRAxGdyxp19j5qu02LIAD8FZ2bGslUXfgqKMUc/5hASy5hfdiXhpi2Shle2lOO FtVA== 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=PeQcyVvQd35gvg0Q5bl83ripKoD4zdxyC5dpHXUCgQ8=; b=UpMRMw6IGk0cHILsOp7CcdyPnP8rnLwRTQ//krCPAC2RZ33a1Azy9M+mt20TSr3zoq 9S6nJt1v7PlnAgHQ9pIJ79QFyEYgWARGAI/pmBGI/JeJwdrbl5BUfXsUgd3LH0BQvLE+ Wqc6fMxyfCvqcAfPGO0t01Pj6qs0uSFaAct+zbgqYXA0S1M+8puIU2+/i7zvQAQLblaM 6O4GaVwtx9EDXD3im88s9mE2zOPgUYXJaZVH9Ub+MLnplpIogSL1WjZaMaKl+vMN3zjB wsx0Kk+o3J8VunLpHKtCCjLzHVOmpYIl54J4eOSG5qQ+Jky1qN3jtAvleIfB6STGVs5c rF2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=edhIdPAt; 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 b20-20020aa79514000000b0066675b3f21esi3891048pfp.36.2023.06.15.20.10.46; Thu, 15 Jun 2023 20:10:58 -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=edhIdPAt; 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 S241221AbjFPCxr (ORCPT + 99 others); Thu, 15 Jun 2023 22:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240318AbjFPCxk (ORCPT ); Thu, 15 Jun 2023 22:53:40 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71366297C; Thu, 15 Jun 2023 19:53:39 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f7677a94d1so175893e87.0; Thu, 15 Jun 2023 19:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686884018; x=1689476018; 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=PeQcyVvQd35gvg0Q5bl83ripKoD4zdxyC5dpHXUCgQ8=; b=edhIdPAtNhERnXnhjZiBeAyokijKoqw5wFSRniTKNbImMzwboh6sAlKJtp6krKiLqD +Zq56xq+MUxNSCKY9olSWo4ITNXyaglKL5uAE/1orLonCMJ/RFboUZu9Lk/EwUUTQ45y sfsPSu5hkUn/7/EEXol48gnALTuRaxRIwq74vfvwQfDOLf4Trrmds4WjqmGXXgPJ/Jry 2gCoV1U3y7o/7wRwOvapFJVwFuZs9DrYoPfQPrQhRumjEpaR7fqvnWm8R5Xh+oxQleJt NXc6aLT10cyMrgG2G9AyOCxLqfQvxWWWrHOmTh5+EFbSxTTMJHhMS859SJRZWVRePNA8 OyFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686884018; x=1689476018; 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=PeQcyVvQd35gvg0Q5bl83ripKoD4zdxyC5dpHXUCgQ8=; b=gCVqeYlJ5sjXApucCCAH/CVYMRv/ZK7eqUwjHyWI1KhAXtIT+m7+vv/lg24mPbgtuo zOE4r+cqnguxwfs2OLbAYNtcaNy1GGLzQUviOkyXd+rlArlz1LtEvzVps00p1Z1IFJtl JbexuhTRQ139seUl3IBzK1ZDRR1MnRwt3uvM4V2OxRVzDYULZYid78Gr1VrVWE6fL1SD Jn/LcykWwnbOEA9iFEqrjfnfLfeW6/SNUqszujRqxe1KRUaAHh01cu9ZfEBBGBlnq18/ KXC7e2FurjDlDVNjVIjBAFTo/0eG8EnGdnBZor8becfWYgtWd8NjI/RoveQeIYB5Laa3 1frA== X-Gm-Message-State: AC+VfDyOCFsvP8bg5rfQg+3waPpSaaLra7+aBYqePYm/n98fq9UmZV10 zWjWSeQ2u/ARjzqfQP57Rn0= X-Received: by 2002:a05:6512:3288:b0:4f0:1e7d:f897 with SMTP id p8-20020a056512328800b004f01e7df897mr347357lfe.17.1686884017644; Thu, 15 Jun 2023 19:53:37 -0700 (PDT) Received: from arinc9-Xeront.. (athedsl-404045.home.otenet.gr. [79.131.130.75]) by smtp.gmail.com with ESMTPSA id v15-20020a1cf70f000000b003f8d770e935sm890328wmh.0.2023.06.15.19.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 19:53:37 -0700 (PDT) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com 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 v5 3/6] net: dsa: mt7530: fix handling of BPDUs on MT7530 switch Date: Fri, 16 Jun 2023 05:53:24 +0300 Message-Id: <20230616025327.12652-4-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230616025327.12652-1-arinc.unal@arinc9.com> References: <20230616025327.12652-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 From: Arınç ÜNAL 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. Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch") 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 e9fbe7ae6c2c..7b72cf3a0e30 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2262,6 +2262,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