From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 792E060D52 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 5031260BAA MIME-Version: 1.0 Date: Sat, 04 Feb 2023 09:48:24 +0100 From: netdev@kapio-technology.com In-Reply-To: References: <20230130173429.3577450-1-netdev@kapio-technology.com> <20230130173429.3577450-6-netdev@kapio-technology.com> <9b12275969a204739ccfab972d90f20f@kapio-technology.com> <20230203204422.4wrhyathxfhj6hdt@skbuf> Message-ID: <4abbe32d007240b9c3aea9c8ca936fa3@kapio-technology.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Bridge] [PATCH net-next 5/5] net: dsa: mv88e6xxx: implementation of dynamic ATU entries List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Simon Horman 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" , Vladimir Oltean , davem@davemloft.net On 2023-02-04 09:12, Simon Horman wrote: > On Fri, Feb 03, 2023 at 10:44:22PM +0200, Vladimir Oltean wrote: >> On Fri, Feb 03, 2023 at 09:20:22AM +0100, Simon Horman wrote: >> > > else if (someflag) >> > > dosomething(); >> > > >> > > For now only one flag will actually be set and they are mutually exclusive, >> > > as they will not make sense together with the potential flags I know, but >> > > that can change at some time of course. >> > >> > Yes, I see that is workable. I do feel that checking for other flags would >> > be a bit more robust. But as you say, there are none. So whichever >> > approach you prefer is fine by me. >> >> The model we have for unsupported bits in the >> SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS >> and SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS handlers is essentially this: >> >> if (flags & ~(supported_flag_mask)) >> return -EOPNOTSUPP; >> >> if (flags & supported_flag_1) >> ... >> >> if (flags & supported_flag_2) >> ... >> >> I suppose applying this model here would address Simon's extensibility >> concern. > > Yes, that is the model I had in mind. The only thing is that we actually need to return both 0 and -EOPNOTSUPP for unsupported flags. The dynamic flag requires 0 when not supported (and supported) AFAICS. Setting a mask as 'supported' for a feature that is not really supported defeats the notion of 'supported' IMHO.