From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8313D416C5 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 1C0CF415F6 MIME-Version: 1.0 Date: Fri, 20 Jan 2023 22:16:03 +0100 From: netdev@kapio-technology.com 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> Message-ID: <29501147c96e7e2f06c999410d42e2bf@kapio-technology.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Bridge] [RFC PATCH net-next 1/5] net: bridge: add dynamic flag to switchdev notifier List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Oltean Cc: Andrew Lunn , Alexandre Belloni , Nikolay Aleksandrov , Kurt Kanzenbach , Eric Dumazet , Ivan Vecera , Florian Fainelli , "moderated list:ETHERNET BRIDGE" , Russell King , Roopa Prabhu , kuba@kernel.org, Paolo Abeni , =?UTF-8?Q?Cl=C3=A9ment_L=C3=A9ger?= , Christian Marangi , Woojung Huh , Landen Chao , Jiri Pirko , Hauke Mehrtens , Sean Wang , DENG Qingfang , Claudiu Manoil , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , "moderated list:ARM/Mediatek SoC support" , netdev@vger.kernel.org, open list , "maintainer:MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER" , "open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER" , davem@davemloft.net 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?