Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp172631imw; Fri, 8 Jul 2022 00:14:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uGthpI5dM/D2Due0B8iC8ZCAdkpJEOXXHHz6FoXqXbQD8k8BTxmS/kHTpW2p2ldhtMDV8K X-Received: by 2002:a17:902:f54a:b0:16a:5850:5775 with SMTP id h10-20020a170902f54a00b0016a58505775mr2234109plf.13.1657264449592; Fri, 08 Jul 2022 00:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657264449; cv=none; d=google.com; s=arc-20160816; b=obvGU4ucK6HuDBYsvDFuTWQEtOLdoX6wjsugdK2v4N/MeZKolPyx/Q1+dXqKKjVf5S IN+CTXpo6hBp0v7qGd6z7AIpKZCZ5+13p2HCy5glxLXIWlqpcVgw4/cBmb6qU60xVSQY PQrxZ6aCSGbn/CaYMUCW9NFSM9SfHaya0ZIR7+RMmE31xoxrZiuOPEkL/p3Ki/WzfwSU OIr4eHLs3U7DWhEA/ES8SHf6j1pDdOmTOtGn1Um47dh+E2pWukCIYEsASTtwukx5h9ES 7WGyDiDP3mlwq5OJtfnmZ20/uVGQNnXuMO0imki1h3w0qvg0TSSR4JFtbj4TAPjrnjYX /Azg== 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=GnNs3HMqHd1B0V0SwwcVwVwDvbddm1rTOOSMteDnS1w=; b=Pz9iS9k97kia7THN24JNE5MqgJlgHRn8LMqP/2AjMu3J4qLYdE200wRl33Pmd0hFGQ tWtD0FB3e63aH5iOdkI3cWAVAR2BdHtQTEDK7AKXoIOaUm/yvQGwUe7c73hX+ZcbjAlt io5h3zLBUvvEyyAANX+FhsL8xyBnW/riJEKf26VV2RKNCJSVpRESk2l1YUSigfDv+sDF cncHQeuhb2RCi/ExbF66sZF9VQqjw7F/P0rKvSxptAOUivzo9WnFdumD6DXFunVNzJtt 9oBmFpMRWjWbrIHuDDff9eAooD3XaMUeYyhU8qMH5v5H8WmU4TdRxMmV1aMcIrXagO58 OnDQ== 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 u1-20020a632341000000b003fdc8b4d872si36064613pgm.602.2022.07.08.00.13.52; Fri, 08 Jul 2022 00:14:09 -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; 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 S237453AbiGHHMv (ORCPT + 99 others); Fri, 8 Jul 2022 03:12:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236525AbiGHHMu (ORCPT ); Fri, 8 Jul 2022 03:12:50 -0400 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C9287696F; Fri, 8 Jul 2022 00:12:48 -0700 (PDT) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id 910741887361; Fri, 8 Jul 2022 07:12:46 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id 8876325032B7; Fri, 8 Jul 2022 07:12:46 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id 70813A1E00B7; Fri, 8 Jul 2022 07:12:46 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 MIME-Version: 1.0 Date: Fri, 08 Jul 2022 09:12:46 +0200 From: netdev@kapio-technology.com To: Vladimir Oltean Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Andrew Lunn , Vivien Didelot , Florian Fainelli , Eric Dumazet , Paolo Abeni , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Daniel Borkmann , Ido Schimmel , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH net-next 1/1] net: dsa: mv88e6xxx: allow reading FID when handling ATU violations In-Reply-To: <20220707102836.u7ig6rr2664mcrlf@skbuf> References: <20220706122502.1521819-1-netdev@kapio-technology.com> <20220707102836.u7ig6rr2664mcrlf@skbuf> User-Agent: Gigahost Webmail Message-ID: X-Sender: netdev@kapio-technology.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,FROM_FMBLA_NEWDOM, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-07-07 12:28, Vladimir Oltean wrote: > On Wed, Jul 06, 2022 at 02:25:02PM +0200, Hans Schultz wrote: >> For convenience the function mv88e6xxx_g1_atu_op() has been used to >> read >> ATU violations, but the function has other purposes and does not >> enable >> the possibility to read the FID when reading ATU violations. >> >> The FID is needed to get hold of which VID was involved in the >> violation, >> thus the need for future purposes to be able to read the FID. > > Make no mistake, the existing code doesn't disallow reading back the > FID > during an ATU Get/Clear Violation operation, and your patch isn't > "allowing" something that wasn't disallowed. It would only read 0 the way it worked. And I don't understand why mv88e6xxx_g1_atu_op() writes the FID? > > The documentation for the ATU FID register says that its contents is > ignored before the operation starts, and it contains the returned ATU > entry's FID after the operation completes. > > So the change simply says: don't bother to write the ATU FID register > with zero, it doesn't matter what this contains. This is probably true, > but the patch needs to do what's written on the box. Writing 0 to the ATU fID register resulted in a read giving zero of course. > > Please note that this only even matters at all for switches with > mv88e6xxx_num_databases(chip) > 256, where MV88E6352_G1_ATU_FID is a > dedicated register which this patch avoids writing. For other switches, > the FID is embedded within MV88E6XXX_G1_ATU_CTL or MV88E6XXX_G1_ATU_OP. > So _practically_, for those switches, you are still emitting the > GET_CLR_VIOLATION ATU op with a FID of 0 whether you like it or not, > and > this patch introduces a (most likely irrelevant) discrepancy between > the > access methods for various switches. > > Please note that this observation is relevant for your future changes > to > read back the FID too. As I said here: > https://patchwork.kernel.org/project/netdevbpf/patch/20220524152144.40527-4-schultz.hans+netdev@gmail.com/#24912482 > you can't just assume that the FID lies within the MV88E6352_G1_ATU_FID > register, just look at the way it is packed within > mv88e6xxx_g1_atu_op(). > You'll need to unpack it in the same way. So I need a new function to read the FID that mimics mv88e6xxx_g1_atu_op() as far as I understand?