[RFC PATCH net-next 1/5] net: bridge: add dynamic flag to switchdev notifier
Vladimir Oltean
olteanv at gmail.com
Thu Jan 19 01:33:58 PST 2023
On Wed, Jan 18, 2023 at 11:14:00PM +0100, netdev at 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.
More information about the Linux-mediatek
mailing list