All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, jiri@nvidia.com, idosch@nvidia.com,
	petrm@nvidia.com, simon.horman@corigine.com,
	louis.peens@corigine.com, leon@kernel.org,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 0/6] devlink: expose instance locking and simplify port splitting
Date: Mon, 14 Mar 2022 23:00:03 -0700	[thread overview]
Message-ID: <20220315060009.1028519-1-kuba@kernel.org> (raw)

This series puts the devlink ports fully under the devlink instance
lock's protection. As discussed in the past it implements my preferred
solution of exposing the instance lock to the drivers. This way drivers
which want to support port splitting can lock the devlink instance
themselves on the probe path, and we can take that lock in the core
on the split/unsplit paths.

nfp and mlxsw are converted, with slightly deeper changes done in
nfp since I'm more familiar with that driver.

Now that the devlink port is protected we can pass a pointer to
the drivers, instead of passing a port index and forcing the drivers
to do their own lookups. Both nfp and mlxsw can container_of() to
their own structures.

v1:
 - redo the lockdep check (patch 1)
 - add a small section to the docs (patch 1)
 - build fix (patch 2)
 - keeping the devl_ prefix :X

Jakub Kicinski (6):
  devlink: expose instance locking and add locked port registering
  eth: nfp: wrap locking assertions in helpers
  eth: nfp: replace driver's "pf" lock with devlink instance lock
  eth: mlxsw: switch to explicit locking for port registration
  devlink: hold the instance lock in port_split / port_unsplit callbacks
  devlink: pass devlink_port to port_split / port_unsplit callbacks

 Documentation/networking/devlink/index.rst    |  16 ++
 drivers/net/ethernet/mellanox/mlxsw/core.c    |  36 ++---
 drivers/net/ethernet/mellanox/mlxsw/minimal.c |   6 +
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |   7 +
 .../net/ethernet/netronome/nfp/flower/main.c  |   4 +-
 drivers/net/ethernet/netronome/nfp/nfp_app.c  |   2 +-
 drivers/net/ethernet/netronome/nfp/nfp_app.h  |  12 +-
 .../net/ethernet/netronome/nfp/nfp_devlink.c  |  55 +++----
 drivers/net/ethernet/netronome/nfp/nfp_main.c |  19 +--
 drivers/net/ethernet/netronome/nfp/nfp_main.h |   6 +-
 .../net/ethernet/netronome/nfp/nfp_net_main.c |  34 +++--
 .../net/ethernet/netronome/nfp/nfp_net_repr.c |   4 +-
 drivers/net/ethernet/netronome/nfp/nfp_port.c |  17 ---
 drivers/net/ethernet/netronome/nfp/nfp_port.h |   2 -
 include/net/devlink.h                         |  15 +-
 net/core/devlink.c                            | 144 ++++++++++--------
 16 files changed, 208 insertions(+), 171 deletions(-)

-- 
2.34.1


             reply	other threads:[~2022-03-15  6:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15  6:00 Jakub Kicinski [this message]
2022-03-15  6:00 ` [PATCH net-next 1/6] devlink: expose instance locking and add locked port registering Jakub Kicinski
2022-03-16  8:29   ` Leon Romanovsky
2022-03-16 16:48     ` Jakub Kicinski
2022-03-16 18:39       ` Leon Romanovsky
2022-03-16 18:39   ` Leon Romanovsky
2022-03-15  6:00 ` [PATCH net-next 2/6] eth: nfp: wrap locking assertions in helpers Jakub Kicinski
2022-03-15  6:00 ` [PATCH net-next 3/6] eth: nfp: replace driver's "pf" lock with devlink instance lock Jakub Kicinski
2022-03-16  8:34   ` Leon Romanovsky
2022-03-16 16:45     ` Jakub Kicinski
2022-03-15  6:00 ` [PATCH net-next 4/6] eth: mlxsw: switch to explicit locking for port registration Jakub Kicinski
2022-03-15  8:29   ` Ido Schimmel
2022-03-15  6:00 ` [PATCH net-next 5/6] devlink: hold the instance lock in port_split / port_unsplit callbacks Jakub Kicinski
2022-03-15  8:30   ` Ido Schimmel
2022-03-15  6:00 ` [PATCH net-next 6/6] devlink: pass devlink_port to " Jakub Kicinski
2022-03-15  8:32   ` Ido Schimmel
2022-03-16 20:07 ` [PATCH net-next 0/6] devlink: expose instance locking and simplify port splitting Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220315060009.1028519-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=leon@kernel.org \
    --cc=louis.peens@corigine.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=simon.horman@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.