Re: [RFC PATCH net-next 1/5] net: bridge: add dynamic flag to switchdev notifier

From
Vladimir Oltean <olteanv@gmail.com>
Date
2023-01-19 09:34:12
Also in
bridge, linux-arm-kernel, linux-mediatek, linux-renesas-soc, lkml
Reply to
unknown sender, 2023-01-18
On Wed, Jan 18, 2023 at 11:14:00PM +0100, netdev@kapio-technology.com wrote:
quoted
quoted
+	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.
Thread (15 messages) 15 messages, 2 authors, last reply 2023-01-22
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