Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4357109imw; Thu, 7 Jul 2022 17:45:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tRmVu2L4MpwJns9gr8YEDofKjqSD4Hj99eBk+JlSQ2w2pePoTCgSdFMna77brEQ0sdBD2k X-Received: by 2002:a17:902:9044:b0:16b:d7e4:cf7a with SMTP id w4-20020a170902904400b0016bd7e4cf7amr744194plz.74.1657241140983; Thu, 07 Jul 2022 17:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657241140; cv=none; d=google.com; s=arc-20160816; b=ddiapt3hbpwahoChYXAaG9xdRzVCLAsjF16Gk01UcYH9n/m+4Q6NBLBr/Bn/lwofoR ctgMNHlX+5rbGJ21G7AYci2LailcxCxm4vAqA38A0vLXNvikUJUyFz2O6OntpRqx9e3i db74vmwuOgc7JjvH42O/AOFdq74+td+FIZIN8coq9eZbBat1XdwM7JfJn4Obxw1YecYz 8oEB27HJAj8i/OBRPeBCCc2zySAYBdxxyj2KDa0X/RWWnQg8vYXNheYdPKWAzgVmCGyN naL6N5PsS5ltrzX9g7pqYoNb74rC8sAfW6yzwIdUD0UJFIZGwHWlNeB9wuf+/wsRyyhy wiuw== 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:subject:cc:to:from:date :dkim-signature; bh=8FENHk9JLXesjDtvp1QRZonpWiHL1S/kyHe6J0wnFaQ=; b=trfKFzeI9z2Gp0w4CiwEYyqloB0EOUG8QPBDWR2ClMNPMn0+mY8+n0H/IJDzc4kGzP vGjbzzkq8UexxDpW4lWeJG9bl4UnFGOyExI8kT8poQCtvvFC7AEivLKRMNhr4DNavntj Mos0y33iE5JaLolVRJVslkqfCaLvtCGgrgC+tLnDIKDS8E+KK+7Usvl4/1yJ9m32xQBw YBryWbLICtUPUoihdvWmXBhNfmvj0DcGQmWN4zZOwAPf3Hjin4KeIMGAowDAGkq/+k7+ Cu9h8BHz0J77khJh0x8+npgkHAi8LJEjAjxogggjS2P77CkfiPSK0DDDIa0q+GqLRjlc Po0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J7buxAjo; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a170903244b00b0016c06a1087dsi8404009pls.394.2022.07.07.17.45.29; Thu, 07 Jul 2022 17:45:40 -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=@kernel.org header.s=k20201202 header.b=J7buxAjo; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235936AbiGHAoN (ORCPT + 99 others); Thu, 7 Jul 2022 20:44:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiGHAoL (ORCPT ); Thu, 7 Jul 2022 20:44:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C16A670E44; Thu, 7 Jul 2022 17:44:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7E2D8B824B5; Fri, 8 Jul 2022 00:44:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E0EDC3411E; Fri, 8 Jul 2022 00:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657241048; bh=EC7a4jTfAaizoRSMF4FsVpM10jc1Vx60by0MKMOikKI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=J7buxAjoy+adEYbK2ndgRVkdH/bRZQd1xQJ83dKqMYPLqzO7K8SohPXucoAmj7lJw lXlK98vnwsMtyUs6cqJvdncgZSM+u8iWNEd84GaJxGEb8JwmJznOQ8diA8yX3EE+9t AyBc2jtDAHiy/c9qalzH/C4zpxEfR44rctLToIM/H+o6DzxW+shjErAqPIZ51BH2Tj w3PhcIgxKUGzp6rfEjTCNkv8zm+iHrtWRB+8L8NEZ7Mv9xOAjzyEzGVOLdus18aNvi qFBhYl1bIalHBXubutm/9Fbfkaocgls6Zfa3BLkpbMVdpgT4B7+bPE8Q+LLXcKle9S rXNUZKZHDb9sw== Date: Thu, 7 Jul 2022 17:43:58 -0700 From: Jakub Kicinski To: Hans Schultz Cc: Vladimir Oltean , davem@davemloft.net, 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 Message-ID: <20220707174358.3b1b804a@kernel.org> In-Reply-To: <20220707102836.u7ig6rr2664mcrlf@skbuf> References: <20220706122502.1521819-1-netdev@kapio-technology.com> <20220707102836.u7ig6rr2664mcrlf@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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, 7 Jul 2022 13:28:36 +0300 Vladimir Oltean wrote: > 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. > > 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. > > 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. I reckon it'll be useful to render some of this info into the commit message and adjust the subject so marking Changes Requested.