Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2720770rwd; Fri, 26 May 2023 10:11:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Kzh1Y01QR2LEUzeuuDiqjBzf0nHmzfVHaYNrXlB/9pwiI3EV3HlSniL5mZ5IKDKh96Ebk X-Received: by 2002:a17:90a:62cc:b0:255:33ba:7bf8 with SMTP id k12-20020a17090a62cc00b0025533ba7bf8mr3666307pjs.23.1685121095426; Fri, 26 May 2023 10:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685121095; cv=none; d=google.com; s=arc-20160816; b=lN4h2RCNTh21v2uY9jj+7DqJyh/5CYv0mn85dNeca1fLuWGN8Ius3iyqESfThPugtp DH7apezw8CM6KGGjmZaRphc7tOEbDLCvbvi8vSILV4pQkBo0yWPXLrhYiM3KhEXHcK17 TFiDcXBRFFEmOrJp9nVKaMOJ5q5RBZ7aQD85B9sT5xVJz7Tpl7yReRtzjcnYuJKpieMv bvBa/1GKWJYtji4wmyat8lC/lfK//D7zTPVXv05g2TGJulDnaO3qruuaHdD359rF6xMJ LUeaoNGWHR8Ty51rE13zklq8yn6l2eBIM1k95YAJaELkwUoEd8lQQh0oHjsxxhxRB2dE qaJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SS6kMs+u9yaM8ffbjosYMxdgJboVzMiJqPmKQK1XNCQ=; b=uvf0FQi7lyZjbpeqp2UZFFNU4Y+MybmB42QFI2keD5CYjNJ/O3OPlFqNBqQUCLudi7 BuSTtH2t2WpNR00Nk77olJCsul/SON9nPB4vGV8m7tWOBBGAZFlufsms60wKYElu3iyl OcAGxLca9pbfG/ftnE7xq1sDlKU382T6uE/nISqHgZQt5R/l5EyWxTBtBSCEAIw5PxeI IJvdZUoi/e80NAhXoyvfJdU4zHYf/B3e3ricLilBJzFfJOATELp1M5wtHQFmyn+Ahva3 sSynSp3kcPrtnoU8EIaIuSREXx2CLAQB3HYPYB54el0WQTFH1+PCY4trZqfFFpIIXAWC oxEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=FYcJg0QR; 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 34-20020a631062000000b0053b0da378edsi3280913pgq.789.2023.05.26.10.11.22; Fri, 26 May 2023 10:11:35 -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=FYcJg0QR; 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 S230231AbjEZRCa (ORCPT + 99 others); Fri, 26 May 2023 13:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbjEZRC3 (ORCPT ); Fri, 26 May 2023 13:02:29 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23CBAD9; Fri, 26 May 2023 10:02:28 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-96f53c06babso172257166b.3; Fri, 26 May 2023 10:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685120546; x=1687712546; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=SS6kMs+u9yaM8ffbjosYMxdgJboVzMiJqPmKQK1XNCQ=; b=FYcJg0QRD45Vj7/k3uaWJMQtzn9rB2pItBRDJkRbTotkXsg4f5QYHx0yOXaV1zcA2R KzGQ1jCP6N3cX0T757RcOsr7vj1fBnAIjWTpRkIhMFsWvhXrgaz9Wwn3jTgl8Jct9Dnf kxy2z5mX++KMGhTonEZKso80z5qhGVbwhvNdN5ZBh1FmjPLubRIbmIFp9U/uu6rdbhqP f04eF7x47WIvMjZobgdsM3Yd03n5uqRrELll9hTawVeoXfKKpiZIHeKw/rqKZk2o3OPX iAo0Rh+v9s7VLHqxx3HEWMSBWp3QlXNLSroFHB7tZvALUXsrWseavTVEU8tZwwCpiqPc mRFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120546; x=1687712546; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SS6kMs+u9yaM8ffbjosYMxdgJboVzMiJqPmKQK1XNCQ=; b=Jl1AUuuS7wqmTuspl7S8HOmnoIkq/KF4RkjrrwsocgBs7ziSJNeJrytZaPLxL/meAd LKj6HOO9n3jZHQas0n0La/jzVwRwG8FV4Ggqhqz/50XN5cHk7t+9aV7YG9s3xRRw4VqI 3kd/B+HBCLf8mYrh9yT60fgCwvmyQTdM6+2TNMswZlXCXY1bLyZtdNo1EMN7i4zpP5Ji 4UtlE7XTUDSKodegbVepe3Rz8lzjv0UEYubz8G8uQodeFz2YR0xH1QjLn07ybZt4GiFH v4uavZW5bZIxqw6r2vjjLveCbRMpASDwCXQrv/Ex5QlSN1CzxucCTykYWtYAh0iLW7i4 O7xQ== X-Gm-Message-State: AC+VfDyTLbL/usALFqL9We4j1GMeqFEY9x8qAA772Y5+aZuFmBif/JRY m0kYK97/1AvXXcbGtLwOEjU= X-Received: by 2002:a17:907:743:b0:969:9fd0:7cee with SMTP id xc3-20020a170907074300b009699fd07ceemr2636652ejb.10.1685120546389; Fri, 26 May 2023 10:02:26 -0700 (PDT) Received: from skbuf ([188.27.184.189]) by smtp.gmail.com with ESMTPSA id qw23-20020a170906fcb700b0096f71ace804sm2371847ejb.99.2023.05.26.10.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 10:02:26 -0700 (PDT) Date: Fri, 26 May 2023 20:02:23 +0300 From: Vladimir Oltean To: arinc9.unal@gmail.com 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 , =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= , 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: Re: [PATCH net-next 27/30] net: dsa: mt7530: introduce BPDU trapping for MT7530 switch Message-ID: <20230526170223.gjdek6ob2w2kibzr@skbuf> References: <20230522121532.86610-1-arinc.unal@arinc9.com> <20230522121532.86610-28-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230522121532.86610-28-arinc.unal@arinc9.com> 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 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? 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) > /* Enable and reset MIB counters */ > mt7530_mib_reset(ds); > > -- > 2.39.2 >