Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: implementation of dynamic ATU entries

From
Simon Horman <hidden>
Date
2023-02-04 08:13:13
Also in
bridge, linux-mediatek, linux-renesas-soc, lkml, netdev
Reply to
Vladimir Oltean, 2023-02-03
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:
quoted
quoted
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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (37 messages) 37 messages, 4 authors, last reply 2023-02-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help