This is something which I'm currently struggling with. Callers of attr_set and obj_add/del often hold not only RTNL, but also spinlock (bridge). So in that case, the driver implementing the op cannot sleep.
The way rocker is dealing with this now is just to invoke driver operation and go out, without any checking or reporting of the operation status. Since it would be nice to at least put a warning in case the operation fails, it might make sense to do this in delayed work directly in switchdev core instead of implementing this in separate drivers. And that is what this patchset is introducing. (The part of removing "nowait" from rocker is not implemented in this patchset, but it is straightforward). Does this make sense. Any ideas? Jiri Pirko (3): switchdev: assert rtnl in switchdev_port_obj_del switchdev: allow caller to explicitly use deferred attr_set version switchdev: introduce deferred variants of obj_add/del helpers include/net/switchdev.h | 6 ++ net/bridge/br_fdb.c | 2 +- net/bridge/br_stp.c | 4 +- net/switchdev/switchdev.c | 203 ++++++++++++++++++++++++++++++++++------------ 4 files changed, 160 insertions(+), 55 deletions(-) -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html