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 4F343C38159 for ; Fri, 20 Jan 2023 21:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbjATVQM (ORCPT ); Fri, 20 Jan 2023 16:16:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbjATVQK (ORCPT ); Fri, 20 Jan 2023 16:16:10 -0500 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E86101DB94; Fri, 20 Jan 2023 13:16:05 -0800 (PST) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id 4A5AF1883A74; Fri, 20 Jan 2023 21:16:03 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id 412112500327; Fri, 20 Jan 2023 21:16:03 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id 2D75D91201E4; Fri, 20 Jan 2023 21:16:03 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 MIME-Version: 1.0 Date: Fri, 20 Jan 2023 22:16:03 +0100 From: netdev@kapio-technology.com To: Vladimir Oltean Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Florian Fainelli , Andrew Lunn , Eric Dumazet , Paolo Abeni , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , "maintainer:MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER" , Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , Claudiu Manoil , Alexandre Belloni , =?UTF-8?Q?Cl=C3=A9ment_L=C3=A9ger?= , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Russell King , Christian Marangi , open list , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , "open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER" , "moderated list:ETHERNET BRIDGE" Subject: Re: [RFC PATCH net-next 1/5] net: bridge: add dynamic flag to switchdev notifier In-Reply-To: <20230119134045.fqdt6zrna5x3iavt@skbuf> References: <20230117185714.3058453-1-netdev@kapio-technology.com> <20230117185714.3058453-2-netdev@kapio-technology.com> <20230117230806.ipwcbnq4jcc4qs7z@skbuf> <20230119093358.gbyka2x4qbxxr43b@skbuf> <20230119134045.fqdt6zrna5x3iavt@skbuf> User-Agent: Gigahost Webmail Message-ID: <29501147c96e7e2f06c999410d42e2bf@kapio-technology.com> 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: linux-kernel@vger.kernel.org On 2023-01-19 14:40, Vladimir Oltean wrote: > On Thu, Jan 19, 2023 at 11:33:58AM +0200, Vladimir Oltean wrote: >> On Wed, Jan 18, 2023 at 11:14:00PM +0100, netdev@kapio-technology.com >> wrote: >> > > > + item->is_dyn = !test_bit(BR_FDB_STATIC, &fdb->flags); >> > > >> > > Why reverse logic? Why not just name this "is_static" and leave any >> > > further interpretations up to the consumer? >> > >> > My reasoning for this is that the common case is to have static entries, >> > thus is_dyn=false, so whenever someone uses a switchdev_notifier_fdb_info >> > struct the common case does not need to be entered. >> > Otherwise it might also break something when someone uses this struct and if >> > it was 'is_static' and they forget to code is_static=true they will get >> > dynamic entries without wanting it and it can be hard to find such an error. >> >> I'll leave it up to bridge maintainers if this is preferable to >> patching >> all callers of SWITCHDEV_FDB_ADD_TO_BRIDGE such that they set >> is_static=true. > > Actually, why would you assume that all users of > SWITCHDEV_FDB_ADD_TO_BRIDGE > want to add static FDB entries? You can't avoid inspecting the code and > making sure that the is_dyn/is_static flag is set correctly either way. Well, up until this patch set there is no option, besides entries from SWITCHDEV_FDB_ADD_TO_BRIDGE events will get the external learned flag set, so they will not be aged by the bridge, and so dynamic entries that way don't make much sense I think. Is that not right?