Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4676541rwb; Sun, 4 Dec 2022 06:19:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf5tNQBUfEvmXavqV5mHzQP0f91jnGie1vkT3jwCJ44d2HxTZffo+wJD7S934yv4kpIMLO3R X-Received: by 2002:a17:902:a3c9:b0:179:f580:bca5 with SMTP id q9-20020a170902a3c900b00179f580bca5mr67704751plb.139.1670163544519; Sun, 04 Dec 2022 06:19:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670163544; cv=none; d=google.com; s=arc-20160816; b=aMm0BoNhqDN+kveWJLe6TVyfpf3wpK8yvEQZ5PDft6KWualGY3j9o/I+eER6kWe1qu mHsC512WwpPRYBu8ndvnTH/H+PfomRdTAF27spB31V/ahlzDehNPDjufXgIp1CoPXG8P HEluI+D+P3lmzr2n2ZHXqw3OMfOQ+7AG7qjypSj5IzUIve0kmoDhP9vKOWD40R8kc0A1 vo6WTq0M7qUa5eS3HsFRROOAchwKh11XbJKfvZads8yzgK3f7IvL6MygHx9iQ8ds/nNn S2ILbtPRgU8scG/OR4HKZi6BuEhFy4HbulervUqdByr/kLk3n57W3QpGSVgnoW5QPB3r 9sfA== 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=lXBftCmBCXZDqytKxnvhYDLumWFEgV+SM0f2NkaUAvg=; b=TWc841s2/cNBOrl7kXCivHcYyMYKacR+qOY6BTSC214hTe0GwwgJJs+IQEw3CuB9ms c30ol5BY9x6ogSxWuq0PLqtMW06v9DLoPs6I7aBQC+Nus9GfUm1HNc9O8gCLTOh7ozM2 f3GsjYz6kgxazylWEZ8hmm6nYaWvi/1XdWrlWmRZ+gSjVEpKJy2QHrSY2ZC8sM5pQ+Al q5JXxdS1kAx8JIJ6jZLYnhEV7l37e7Oymmci+FwUWU25zEIYKrxHT0nmNF7w7UDhSZ3n /84ZbHXNsBCf1BbIkGRAcg588Xzq/+O3u/B1deVQSkMK5QnZ4i9Mv5q1AvPG2eBrJVms XGXA== 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 c4-20020aa78e04000000b0056ee105315fsi11526707pfr.178.2022.12.04.06.18.53; Sun, 04 Dec 2022 06:19:04 -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 S230024AbiLDN0u (ORCPT + 82 others); Sun, 4 Dec 2022 08:26:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbiLDN0s (ORCPT ); Sun, 4 Dec 2022 08:26:48 -0500 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47E83178BA; Sun, 4 Dec 2022 05:26:46 -0800 (PST) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id 9A7DA18838DB; Sun, 4 Dec 2022 13:26:43 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id 80C4B25003AB; Sun, 4 Dec 2022 13:26:43 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id 70F3C9EC002A; Sun, 4 Dec 2022 13:26:43 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 MIME-Version: 1.0 Date: Sun, 04 Dec 2022 14:26:43 +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: 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: > > Is it beneficial in any way to pass the violation type to > mv88e6xxx_handle_violation(), considering that we only call it from the > "miss" code path, and if we were to call it with something else > ("member"), > it would return a strange error code (1)? > > I don't necessarily see any way in which we'll need to handle the > "member" (migration, right?) violation any different in the future, > except ignore it, either. > MV88E6XXX_G1_ATU_OP_AGE_OUT_VIOLATION will also be handled, and it could be that MV88E6XXX_G1_ATU_OP_FULL_VIOLATION would want handling, though I don't know of plans for that. The MV88E6XXX_G1_ATU_OP_MEMBER_VIOLATION interrupt can be suppressed if we want. I think a switch on the type is the most readable code form. p.s. I have changed it, so that global1_atu.c reads: if (val & MV88E6XXX_G1_ATU_OP_MISS_VIOLATION) { dev_err_ratelimited(chip->dev, "ATU miss violation for %pM portvec %x spid %d\n", entry.mac, entry.portvec, spid); chip->ports[spid].atu_miss_violation++; if (!fid) { err = -EINVAL; goto out; } if (chip->ports[spid].mab) err = mv88e6xxx_handle_violation(chip, spid, &entry, fid, MV88E6XXX_G1_ATU_OP_MISS_VIOLATION); if (err) goto out; } with the use of out_unlock in the chip mutex locked case.