All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch net-next v2 0/7] switchdev: change locking
@ 2015-10-12 13:15 Jiri Pirko
  2015-10-12 13:15 ` [patch net-next v2 1/7] switchdev: introduce switchdev workqueue Jiri Pirko
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Jiri Pirko @ 2015-10-12 13:15 UTC (permalink / raw)
  To: netdev
  Cc: davem, idosch, eladr, sfeldma, f.fainelli, linux, vivien.didelot,
	andrew, john.fastabend, David.Laight, stephen

From: Jiri Pirko <jiri@mellanox.com>

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 makes 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.

So from now on, the locking of switchdev mod ops is consistent. Caller either
holds rtnl mutex or in case it does not, caller sets defer flag, telling
switchdev core to process the op later in delayed work.

Flush function for switchdev deferred ops can be called by op
caller in appropriate location, for example after it releases
spin lock, to force switchdev core to process pending ops.

v1->v2:
- rebased on current net-next head (including Scott's ageing patchset)

Jiri Pirko (7):
  switchdev: introduce switchdev workqueue
  switchdev: allow caller to explicitly request attr_set as deferred
  switchdev: remove pointers from switchdev objects
  switchdev: introduce possibility to defer obj_add/del
  bridge: defer switchdev fdb del call in fdb_del_external_learn
  rocker: remove nowait from switchdev callbacks.
  switchdev: assert rtnl mutex when going over lower netdevs

 drivers/net/ethernet/rocker/rocker.c |  13 +-
 include/net/switchdev.h              |  14 +-
 net/bridge/br_fdb.c                  |   7 +-
 net/bridge/br_if.c                   |   3 +
 net/bridge/br_stp.c                  |   3 +-
 net/dsa/slave.c                      |   2 +-
 net/switchdev/switchdev.c            | 289 ++++++++++++++++++++++++-----------
 7 files changed, 231 insertions(+), 100 deletions(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-10-12 14:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 13:15 [patch net-next v2 0/7] switchdev: change locking Jiri Pirko
2015-10-12 13:15 ` [patch net-next v2 1/7] switchdev: introduce switchdev workqueue Jiri Pirko
2015-10-12 13:15 ` [patch net-next v2 2/7] switchdev: allow caller to explicitly request attr_set as deferred Jiri Pirko
2015-10-12 13:15 ` [patch net-next v2 3/7] switchdev: remove pointers from switchdev objects Jiri Pirko
2015-10-12 13:15 ` [patch net-next v2 4/7] switchdev: introduce possibility to defer obj_add/del Jiri Pirko
2015-10-12 14:34   ` Nikolay Aleksandrov
2015-10-12 14:42     ` Nikolay Aleksandrov
2015-10-12 14:57       ` Jiri Pirko
2015-10-12 14:44     ` Jiri Pirko
2015-10-12 14:46       ` Nikolay Aleksandrov
2015-10-12 13:15 ` [patch net-next v2 5/7] bridge: defer switchdev fdb del call in fdb_del_external_learn Jiri Pirko
2015-10-12 13:15 ` [patch net-next v2 6/7] rocker: remove nowait from switchdev callbacks Jiri Pirko
2015-10-12 13:15 ` [patch net-next v2 7/7] switchdev: assert rtnl mutex when going over lower netdevs Jiri Pirko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.