From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 488F5C4332F for ; Sun, 4 Dec 2022 13:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbiLDN0t (ORCPT ); Sun, 4 Dec 2022 08:26:49 -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 Precedence: bulk List-ID: X-Mailing-List: netdev@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.