Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2869037rwd; Mon, 22 May 2023 05:41:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ijQNW22u89pkcO4hhlWbPdWGc3Y9DrxeasxB8U8JwJWPzU964KCXwT2Xu9tek9ZHAo0ru X-Received: by 2002:a17:903:1249:b0:1ab:220a:9068 with SMTP id u9-20020a170903124900b001ab220a9068mr12513234plh.42.1684759280074; Mon, 22 May 2023 05:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684759280; cv=none; d=google.com; s=arc-20160816; b=QZv6vfD5xq4nLNsmQMBXaoCZrKx9OYShLAq0ZkBypUqE8dyYEd1/tMYcmGa4jt87dP RDjAMXyfk3o1WR8nkp9bNMDIt9GX8IBKh+u1SmYdmbXqQEIjhQ2QoWCQgWzkN3mZQco7 DyJZVTAL5ofNgsFuwfN8pGvv+6ApQvtIaDepRA3OXmC5qtsHtZ6H1WM/hEqPAgZwC5t5 zCS/dJgL3sVyBDWJjvAfKTK7h7nr6JfWLpDzdVrXj8I3seWDBs4j3l4ZRywYgFGI56Nl BrX0Hx9WJhLzc2hFpcM4yTsvDp6jeXRsF5KbEPHET2drL4hMxpmYDE0vQEDuZ9bg9wu6 SbuA== 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=BR4WaMfs6beJCKcHWOQHHYOIrYTJQ7SOSyqfSGCZK48=; b=h4Q15dF2YUkkaOvgyGIlBRNNlUIjqW+9Lgni949AigBLZziOioKURCA4yGc+X5vWCy UxLELFGfNDjRLCWs73U4Pt21bxrvA0NzP+aJranwfvpIhqmtCic2vUVMzuk/O48Rd4Wt JZ83/DdwA1gIRt3LFhCImYmql3m1pkLL7pfTO80BDz2zopD4ZWrZfirAIB9JXQXencc6 l9Zgu/lSLmwRWpmeGBcV1zEsVYX3wMqkttN9d0/38/PIcntI794qmkRUcrZt3p8gLpRJ NSHrYNidB/g85+tNFFzCDd1OFlUN8bCZhCZiCypsrz9X1IfVhpOTt5YWSFSj/Pc1/Tx7 C3qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=nwiwhL23; 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 ix19-20020a170902f81300b0019e2eb49236si4426294plb.229.2023.05.22.05.41.05; Mon, 22 May 2023 05:41:20 -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=nwiwhL23; 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 S233914AbjEVMUs (ORCPT + 99 others); Mon, 22 May 2023 08:20:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233890AbjEVMTV (ORCPT ); Mon, 22 May 2023 08:19:21 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CF3C1703; Mon, 22 May 2023 05:17:09 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-96f5d651170so717215666b.1; Mon, 22 May 2023 05:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684757827; x=1687349827; 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=BR4WaMfs6beJCKcHWOQHHYOIrYTJQ7SOSyqfSGCZK48=; b=nwiwhL23+3X1oPllcBS1eFqvx6YOW0qrnjo6coLOpG+/Db0N6PmxOO20Bgw4/Ko7jC NNQFp+/ri7bHwwBz1/mJDxdeV7ipq02QonFCuub9e8XWjjowcJenASuiwMeUCw7AmKBq ZTd7O2Nbd9X1aRA1nGMwka7Cu/XaR7hXZxF4WzI+1gTuK3kFppDxa5C+QUxNnmp8L49h ZRJepRgXz5UXIkIh9T2ToZJIfwb5dZYtSxMf994Xd1X2OO6S6XpTcyUS7S7P1o5LreyU Nv87UeNeTA4S9RSGc5qa8+EULyB46WbQOvE5VuO5jQuqp7gNlsRVEegDRBiChqB+ds3h IhlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684757827; x=1687349827; 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=BR4WaMfs6beJCKcHWOQHHYOIrYTJQ7SOSyqfSGCZK48=; b=Wk88Isiivb+N5CnrhVjc5D3RWdK0vQn3ZYyVUtCLQ7xbmZpBTkdACZSkJSC7Dzxf0h //oNQnEyHs6jNb7M9u/9QxOP+maL4z0qXWy9OzHM/5lVrNAGOdqKxxnXcW0jsvUBrVuW guElToUQBQ9yCSLcJ3r2FFkIESxYS3sQeRrLTHGxPjGlH0VX8KB5wBuG3u5/ZsvgBL3w psKlEnejZh8stISxq80gxfFCnl7pK4Bc9bYKA68njkm0JbGSy9zEPSRFFQnEK3hc9dJF GC9NAqab1Lq625/KHlCV8ELnEpzA3gg7rgmkLueZF3EahyUwj0VRczx3CAz9fVgwdEtC YpTA== X-Gm-Message-State: AC+VfDzK/aLNkopz1biCb1NipLknuhZfbguHOA6wZBJGSmBi+2yvmJ8/ 4gQqM9kk4Z+RfIDULLO0bpg= X-Received: by 2002:a17:907:7211:b0:96f:8afc:b310 with SMTP id dr17-20020a170907721100b0096f8afcb310mr6981274ejc.3.1684757827140; Mon, 22 May 2023 05:17:07 -0700 (PDT) Received: from arinc9-PC.. ([149.91.1.15]) by smtp.gmail.com with ESMTPSA id y26-20020a17090614da00b009659fed3612sm2999950ejc.24.2023.05.22.05.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:17:06 -0700 (PDT) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com To: Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Cc: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , 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 Subject: [PATCH net-next 27/30] net: dsa: mt7530: introduce BPDU trapping for MT7530 switch Date: Mon, 22 May 2023 15:15:29 +0300 Message-Id: <20230522121532.86610-28-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522121532.86610-1-arinc.unal@arinc9.com> References: <20230522121532.86610-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 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); + /* Enable and reset MIB counters */ mt7530_mib_reset(ds); -- 2.39.2