Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5212060rwd; Mon, 12 Jun 2023 01:27:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ78evriind/oehuXgpdwGsagz8Yd4M8H/7krItlca9DI5fZ1qSB1H0cFzRqdX5KmPtWRM42 X-Received: by 2002:a54:4090:0:b0:398:4913:6a2b with SMTP id i16-20020a544090000000b0039849136a2bmr3445377oii.54.1686558441915; Mon, 12 Jun 2023 01:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686558441; cv=none; d=google.com; s=arc-20160816; b=M4QqLrzt9RIFb2dD30nep6MKZYlktG8/6OuoQzRoPTmQAAlb+mEy6HJ5kDg5e4H4HV 8uD1298AlYYSJ2rizmiPNf0VBrTl2qceJBXaf3NKw2Npdxkphb6ZBbB20U+L9Vk7jycl v0L+RILmUGnxjh7ZqSQoeNwmHaufAQkknlQrdtzs3v+vgEmgjLMCm/mYVPDMIwJC9JGO uJHMOmH7JXtRrDF1AlNvs83t2IoNvchAE4//bWBrvWTmN2IoIN4w9dbselIdj4goV23c oJSx6l7Mqohvhf5QtiDO7FVxgPnUC55ncrXaCt5Syk/sPOkF740QPPKK1Na2I5dnGaGZ gIDg== 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=qqs6PYWxr6amVjehvnSXauf3IGKKl/o67YTmLBa8zfM=; b=zwlp2DiVt3UGevCuVsITIU7ErO/lORyh+bCGGGHgWfId1swbkWPnwoQv6ii9NymE+W /ufBPXwC1jGx2xfg6EcxOV5LWk24hZlq2WbHgsPD10iycF9APhMvtIJ0yV2r9VOWUS8d iSq6+lEtyARTbH4KAiI7GCP2qaAH4jM83B+q8T0wVfeD/fQhlQwp8yeo+Fy7guJUTL5l APKNj3ROFieYtFFr51Brm7VoCmdaOA6cD8u/YwWbmkSMSve1alRsX1HYqjwdXett4C9P +/VqQyTbiX3LIjedplY/AWzdW2DdBr3lVejZ6ZHKSa3K70jOE8k+BxfV9MpSdvsCZSoG e+Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=g8HorBvM; 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 v135-20020a63618d000000b0054f9f9c744fsi255237pgb.639.2023.06.12.01.27.10; Mon, 12 Jun 2023 01:27:21 -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=g8HorBvM; 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 S229596AbjFLIBY (ORCPT + 99 others); Mon, 12 Jun 2023 04:01:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231918AbjFLIAo (ORCPT ); Mon, 12 Jun 2023 04:00:44 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E99B2718; Mon, 12 Jun 2023 01:00:11 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f6e1394060so27082295e9.3; Mon, 12 Jun 2023 01:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686556809; x=1689148809; 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=qqs6PYWxr6amVjehvnSXauf3IGKKl/o67YTmLBa8zfM=; b=g8HorBvM1wg+Ji9yD1iaXxMTCzu3O62g8IEei/WOCAk1IsVunXoaEDC93zw5FcMVjQ wTPO+ZTDs0wjLtMi/Pxj/5XimnMAyjsbI8tvY7dt3VvlUVsTtW00rtkzdscf4Ts6vsI1 Xl37VM5txiVUIB4Jr2OZxHQRqVgo0Iba5rt0uqvFqx/QaozD+/1ZdiNRBoLjAhFDGeqY R58mBBJ9wlW9zOhMbYHM8ALz47dnr9FLYaHIoTt1h1VXy8M6vwxmLisQVM4p+MdjxZY3 +3v6fL4BuZex1E1wHJIVEYiYRnV4U1Z8HICfIKqVisA01JiOLCkA6FrsUlGCm7NSojAu ONCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686556809; x=1689148809; 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=qqs6PYWxr6amVjehvnSXauf3IGKKl/o67YTmLBa8zfM=; b=FDB/bsqtLnrZhLVD5xowDnhG1tCJd+80yiAR4GlwH5exl/R0dku4E2CLFOXeeDcOOM HnQsJx3Ha7BsGpbapfv3Gi+M2giGQEfXPE0rWW39XgMoOYTrLAlvu9Iequ6onuTaqAvz ITIEU5SII/Mm5HD/NKaneoNpb4+Wee+1awt5lt89DZSD4Y2u1/HX4RdgDOxQxe/LaOO3 PNSHtR3Db4ZRTgllBi9ddqNS0JWaM9MWe7GERPJWdlzDyxa4DEJa7FLFojRiFpNbW1Uy ZA5Efpyk2BAg8R5qPiHgr3L8AboubwLMrTH8VwmqbFPeVtvCeSofL780cGbXpDkvkUyI tOaA== X-Gm-Message-State: AC+VfDy9PberNEe/5mGFcR1InWIbtFUj22HxAyd3FRwE7G+9/4ai9otP TwwxonWVB5acC41X3vst4IQ= X-Received: by 2002:a1c:4b14:0:b0:3f7:f2d0:b8fc with SMTP id y20-20020a1c4b14000000b003f7f2d0b8fcmr5237120wma.34.1686556809458; Mon, 12 Jun 2023 01:00:09 -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 y22-20020a7bcd96000000b003f7f2a1484csm10552195wmj.5.2023.06.12.01.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 01:00:09 -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 v4 4/7] net: dsa: mt7530: fix handling of BPDUs on MT7530 switch Date: Mon, 12 Jun 2023 10:59:42 +0300 Message-Id: <20230612075945.16330-5-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612075945.16330-1-arinc.unal@arinc9.com> References: <20230612075945.16330-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. 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 --- 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 2bde2fdb5fba..e4c169843f2e 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