Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9410768rwr; Thu, 11 May 2023 14:43:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4F/HIWeCpnEis9jRR7M5PCCtBosKB7lwzZzKelVEpgD5l8y05g7rx9tkApa16BexylkhmX X-Received: by 2002:a05:6a00:240b:b0:639:28de:a91e with SMTP id z11-20020a056a00240b00b0063928dea91emr27874656pfh.17.1683841435891; Thu, 11 May 2023 14:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683841435; cv=none; d=google.com; s=arc-20160816; b=tMHIpeGMMzi5x5Ac7IgPcumjpPrq0jUg4wQ4IRdQLzq1hEtWm76990XEdAx9BF30Yg 8MzRfJrb4SsoU1hjYjALHi5nchon8W0AI+1q7ySMz2PuAB2T3UBkR4jA5rXY7YJA0IFN 0cTxNf5+2JjRysn4t/finsUlHv3mkXcJjJtDBh49E9wFlP16i4kogaCm+Rg+hiago0dA q9M1zMJkK0GZ7NZ9H4Qm/4ydGEyg2lQtdt398cv44FcDRAx1TPXkQovXgnA88/JWsJGY Qi5XKmQ9S6X9A4ViinTmVXLWKNzFKn3qxN4re5ujUEhjh/2yR/acg1lc+YvLjKGiYqCv c8iw== 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=HP9IX+oFYEkrid2vkZ3A+oMe1Mtqy6JGFpwOKyjaMok=; b=LGtms6nBfxsbQFeVHTMlnjzyFdf9lTsylATxbGUTVo2KgHssscirhtBUk5tx0KpJ9E 5KKEkZwQrO3DKdEPJM94MwmshjOPTfbUZQVVvmu0lAhoPSe0BXvDN4llYOa3yIjTsQu3 nIsdVem0+ogWgVTuCON5iB5APt4o73N3xbCD6wdxnM1EWI1NePz77yHAkJIuAz6X5+sV WbicTChNbSXTMP4qynONGXWKRniCsAO29uDEFpH/t2daEASdmKtQ5VLSb7nQJ9By8TxC LHz6aCODUF7FBf0Li9NuACv3iq85xYXmqnWkbIyf3ZegVUYN/sJcf6PpbYnpo3mxXe49 MsjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=QdJCtUje; 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 i10-20020a636d0a000000b0053045471007si7483009pgc.330.2023.05.11.14.43.41; Thu, 11 May 2023 14:43:55 -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=QdJCtUje; 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 S239164AbjEKViC (ORCPT + 99 others); Thu, 11 May 2023 17:38:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239352AbjEKVh7 (ORCPT ); Thu, 11 May 2023 17:37:59 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AABEB7A88; Thu, 11 May 2023 14:37:53 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f4ad71b00eso16272425e9.2; Thu, 11 May 2023 14:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683841072; x=1686433072; 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=HP9IX+oFYEkrid2vkZ3A+oMe1Mtqy6JGFpwOKyjaMok=; b=QdJCtUjea8qftgI+GZM8430w5EaTtcdx0/3fVmTE5ljy+b8kGp6zY1hEL+T3jRwcDB QESTDMbpcuD0mMfAOgxzRfLlfmXniMDbmgwKc2fQBGE1SIt70IlPPrD6GC2KjphkFuFo oq4WG1QEh+6r6Thsci69a2/2IavsSWOB5zkgGXkopBmTqYJpscD1Upo6pgBCO8nTKWJm hKZ+HhEQKWDNicDH5TW3c5ejYIpn/oIJ0DCuDTINPf+FheikWZ5YFAzqvaBBvqS+4X1Q OZo0uI0Md1CdoT20igJ6qom+4JD3rO9wLmcMBUK/uhch9/p5KLqYzrztuXklH4VoJ0XD fRcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683841072; x=1686433072; 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=HP9IX+oFYEkrid2vkZ3A+oMe1Mtqy6JGFpwOKyjaMok=; b=YsPUEgpUXVh+yOnwmAPxqPGE0O7ngFhSs+aflWC19tE8+i1Awgfv16na2NO5FGuvQ0 SBw66RCvjJdWPtQ4n/QooI8QYE8WpkQWhblWlm9Cd4ghlaNpPRxheHSfc2BmD8XirSfu WdXGgfHpPpe5+CUpy7iYy9K4SgWzOJcDUEpK8y7iQ1gZaVZczv4BHtEVrZGOSq7bLGI9 vI0qF1y04JNpta8hu4U7jYIXxVcu6Oo8ekl4QAlSGr+QeHUW32hxCwW+KR4/gnH7Qb13 VzsHuizwHsP2MY9P2pnsjbDBrfb47Z8/qnVzptstcCMWSNHPWyu3WzNMGvLtmk1dNXEy uDlQ== X-Gm-Message-State: AC+VfDy0EOg3gFjOt1kcQkslVS6OTgtW0agOrim8GHWrEUrt6oJhfNYm xu/MT9Om6cbNJWsj7hQeqyU= X-Received: by 2002:a7b:c381:0:b0:3f1:8c37:fa79 with SMTP id s1-20020a7bc381000000b003f18c37fa79mr15931005wmj.31.1683841071831; Thu, 11 May 2023 14:37:51 -0700 (PDT) Received: from skbuf ([188.27.184.189]) by smtp.gmail.com with ESMTPSA id c3-20020a7bc843000000b003f42314832fsm14806666wml.18.2023.05.11.14.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 14:37:51 -0700 (PDT) Date: Fri, 12 May 2023 00:37:49 +0300 From: Vladimir Oltean To: alexis.lothore@bootlin.com Cc: andrew@lunn.ch, f.fainelli@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, herve.codina@bootlin.com, miquel.raynal@bootlin.com, milan.stevanovic@se.com, jimmy.lalande@se.com, pascal.eberhard@se.com Subject: Re: [PATCH net v2 2/3] net: dsa: rzn1-a5psw: fix STP states handling Message-ID: <20230511213749.j2be7po5n2vgfwmu@skbuf> References: <20230511170202.742087-1-alexis.lothore@bootlin.com> <20230511170202.742087-3-alexis.lothore@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230511170202.742087-3-alexis.lothore@bootlin.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 Thu, May 11, 2023 at 07:02:01PM +0200, alexis.lothore@bootlin.com wrote: > From: Cl?ment L?ger > > stp_set_state() should actually allow receiving BPDU while in LEARNING > mode which is not the case. Additionally, the BLOCKEN bit does not > actually forbid sending forwarded frames from that port. To fix this, add > a5psw_port_tx_enable() function which allows to disable TX. However, while > its name suggest that TX is totally disabled, it is not and can still > allow to send BPDUs even if disabled. This can be done by using forced > forwarding with the switch tagging mechanism but keeping "filtering" > disabled (which is already the case in the rzn1-a5sw tag driver). With > these fixes, STP support is now functional. > > Fixes: 888cdb892b61 ("net: dsa: rzn1-a5psw: add Renesas RZ/N1 advanced 5 port switch driver") > Signed-off-by: Cl?ment L?ger > Signed-off-by: Alexis Lothor? > --- Reviewed-by: Vladimir Oltean > @@ -344,28 +376,35 @@ static void a5psw_port_bridge_leave(struct dsa_switch *ds, int port, > > static void a5psw_port_stp_state_set(struct dsa_switch *ds, int port, u8 state) > { > - u32 mask = A5PSW_INPUT_LEARN_DIS(port) | A5PSW_INPUT_LEARN_BLOCK(port); > struct a5psw *a5psw = ds->priv; > - u32 reg = 0; > + bool learning_enabled, rx_enabled, tx_enabled; Absolutely minor comment: in the networking subsystem there is a coding style preference to order lines with variable declarations longest to shortest (reverse Christmas tree). Since I don't see another less frivolous reason to resend the patch set, I thought I'd just mention for next time.