Re: [PATCH v2 net-next 0/5] Make SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE blocking
flat view
From: Vladimir Oltean <olteanv@gmail.com>
Date: 2021-08-21 00:22:20
On Sat, Aug 21, 2021 at 02:36:26AM +0300, Nikolay Aleksandrov wrote:
Hi, I don't like the double-queuing for each fdb for everyone either, it's forcing them to rework it asap due to inefficiency even though that shouldn't be necessary.
Let's be honest, with the vast majority of drivers having absurdities such as the "if (!fdb_info->added_by_user || fdb_info->is_local) => nothing to do here, bye" check placed _inside_ the actual work item (and therefore scheduling for nothing for entries dynamically learned by the bridge), it's hard to believe that driver authors cared too much about inefficiency when mindlessly copy-pasting that snippet from mlxsw [ which for the record does call mlxsw_sp_span_respin for dynamically learned FDB entries, so that driver doesn't schedule for nothing like the rest - although maybe even mlxsw could call mlxsw_sp_port_dev_lower_find_rcu instead of mlxsw_sp_port_dev_lower_find, and could save a queue_work for FDB entries on foreign && non-VXLAN ports. Who knows?! ] Now I get to care for them. But I can see how a partial conversion could leave things in an even more absurd position. I don't want to contribute to the absurdity.
In the long run I hope everyone would migrate to such scheme, but perhaps we can do it gradually. For most drivers this is introducing more work (as in processing) rather than helping them right now, give them the option to convert to it on their own accord or bite the bullet and convert everyone so the change won't affect them, it holds rtnl, it is blocking I don't see why not convert everyone to just execute their otherwise queued work. I'm sure driver maintainers would appreciate such help and would test and review it. You're halfway there already..
Agree, this needs more work. Thanks for looking.