> We could add (e.g.) bridge_setup_tc to dsa_switch_ops, which (in the
> mv88e6xxx implementation) could validate the bridge contained all
> user ports. But it would not be possible to block a port from
> leaving as port_bridge_leave cannot return an error, and tearing
> MQPRIO config down silently would be a different sort of bad.
There can be multiple bridges, even as far as one bridge per port.
For switch wide properties, you basically have to allow the first user
to configure it, refcount additional users get added and removed, and
only allow the last user to change it.
The alternative is return -EOPNOTSUPP, and let the kernel do it in
software, if a user wants something different to the global
setting. The hardware is only there to accelerate what Linux can
already do in software. That is the model we use.
Andrew