Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2877553rwb; Sun, 20 Nov 2022 03:26:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf5sdzCWCHeR6SA/kC6jPOIeZ2KHMsH5vjwEUtgUl0CDlaAW4NOenvWNqqYgXngt/TtKpwZj X-Received: by 2002:a17:902:c409:b0:182:bccf:619f with SMTP id k9-20020a170902c40900b00182bccf619fmr7305322plk.9.1668943600197; Sun, 20 Nov 2022 03:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668943600; cv=none; d=google.com; s=arc-20160816; b=ZTtRyeG286IvKTsLMcOLaIkHxps36T9RS5nAY/L1Rfi0CXHIrUxpu2FDzwnGh2wAxc bMXscA+JGP7KcRBGgwbwbZSqjOvK65RnShkq53mJUmD1hqC3pSIvRMUNnwGAR0unTkcI 1gGTHYSVLHrark93Gt0eznsdBlS51yjmFmhROBRMel0I6OVcf0jw0vXFpZyJ+Q6WkJ4p oOElUojajMeWhh7gHJ/ngr6PvagOwdSYUZNki8NBZIB48z5SPFAswy1y82ZXHp+5Qh/1 o/qda/joTwsmujzh4jSGAKRm9OiTgaOptvqJ5/5ohIPLScuiUNgYC3MhhlRYzNMRO2ys YIyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version; bh=1BJBv9NG3ac1mfdW/KH4NXdLIF3vL6mGlr1mRrzQKoE=; b=z3JfMONPuxXv7A1Bqvo1SXnP6MgA1k8LcFpDu/Id0VpPtWcS//zWnhaNY8v/Rp+kMi KzDrE6Z8wK5rbUZpKjtucNDOoNU9MaWFtauvALMkcbDkibDSbWzOI1b2pk+yo6vILS0Y jOPKRdKBZIeaz1zr62ZHe2xzZ8/4nuoX+QcDL4jA2I2HA5aQFuvQK0l8KAv599Dcx8gs zxBwybn0ZBZcW1PYi8zqFieRN+yA8JN8SQcY6GLWoia22ZpaOfjvgm9UFVGbqNZvRxLM EyJUlcTfl1D41rOO1oQ2ENaXimD2jfwbiNBW2Q69X7jbKRRgcfHDBmHTIfCdswbNQQNZ TrzQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e11-20020a170902cf4b00b0017d2bb81273si8483255plg.600.2022.11.20.03.26.29; Sun, 20 Nov 2022 03:26:40 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbiKTKVM (ORCPT + 92 others); Sun, 20 Nov 2022 05:21:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbiKTKVL (ORCPT ); Sun, 20 Nov 2022 05:21:11 -0500 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2441C6D973; Sun, 20 Nov 2022 02:21:10 -0800 (PST) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id D619218838C6; Sun, 20 Nov 2022 10:21:08 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id C375125002DE; Sun, 20 Nov 2022 10:21:08 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id B97969EC0020; Sun, 20 Nov 2022 10:21:08 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 MIME-Version: 1.0 Date: Sun, 20 Nov 2022 11:21:08 +0100 From: netdev@kapio-technology.com To: Vladimir Oltean Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Andrew Lunn , Florian Fainelli , Eric Dumazet , Paolo Abeni , open list Subject: Re: [PATCH v8 net-next 2/2] net: dsa: mv88e6xxx: mac-auth/MAB implementation In-Reply-To: <20221115222312.lix6xpvddjbsmoac@skbuf> References: <20221112203748.68995-1-netdev@kapio-technology.com> <20221112203748.68995-1-netdev@kapio-technology.com> <20221112203748.68995-3-netdev@kapio-technology.com> <20221112203748.68995-3-netdev@kapio-technology.com> <20221115222312.lix6xpvddjbsmoac@skbuf> User-Agent: Gigahost Webmail Message-ID: <6c77f91d096e7b1eeaa73cd546eb6825@kapio-technology.com> X-Sender: netdev@kapio-technology.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 2022-11-15 23:23, Vladimir Oltean wrote: >> diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c >> b/drivers/net/dsa/mv88e6xxx/global1_atu.c >> index 8a874b6fc8e1..0a57f4e7dd46 100644 >> --- a/drivers/net/dsa/mv88e6xxx/global1_atu.c >> +++ b/drivers/net/dsa/mv88e6xxx/global1_atu.c >> @@ -12,6 +12,7 @@ >> >> #include "chip.h" >> #include "global1.h" >> +#include "switchdev.h" >> >> /* Offset 0x01: ATU FID Register */ >> >> @@ -426,6 +427,8 @@ static irqreturn_t >> mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) >> if (err) >> goto out; >> >> + mv88e6xxx_reg_unlock(chip); >> + > > I concur with Ido's suggestion to split up changes which are only > tangentially related as preparatory patches, with the motivation which > you explained over email as the commit message. Also, the current "out" > label needs to become something like "out_unlock", and a new "out" > created, for the error path jumps below, that don't have the register > lock held. > >> spid = entry.state; >> >> if (val & MV88E6XXX_G1_ATU_OP_AGE_OUT_VIOLATION) { >> @@ -446,6 +449,12 @@ static irqreturn_t >> mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) >> "ATU miss violation for %pM portvec %x spid %d\n", >> entry.mac, entry.portvec, spid); >> chip->ports[spid].atu_miss_violation++; >> + >> + if (fid && chip->ports[spid].mab) >> + err = mv88e6xxx_handle_violation(chip, spid, &entry, >> + fid, MV88E6XXX_G1_ATU_OP_MISS_VIOLATION); > > The check for non-zero FID looks strange until one considers that FID 0 > is MV88E6XXX_FID_STANDALONE. But then again, since only standalone > ports > use FID 0 and standalone ports cannot have the MAB/locked feature > enabled, > I consider the check to be redundant. We should know for sure that the > FID is non-zero. > I have something like this, using 'mvls vtu' from https://github.com/wkz/mdio-tools: VID FID SID P Q F 0 1 2 3 4 5 6 7 8 9 a 0 0 0 y - - = = = = = = = = = = = 1 2 0 - - - u u u u u u u u u u = 4095 1 0 - - - = = = = = = = = = = = as a vtu table. I don't remember exactly the consequences, but I am quite sure that fid=0 gave incorrect handling, but there might be something that I have missed as to other setups.