Skip to content

devlink: hold the instance lock in eswitch callbacks

Jakub Kicinski netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 0 repliesApplied 5/5
  2. v15 patches 8 repliesSuperseded

Patches in v2 All 5 applied

#Subject and filesSizeRepliesApplied
1/5bnxt: use the devlink instance lock to protect sriovdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +1 more+4 -110 repliesApplied
2/5devlink: add explicitly locked flavor of the rate node APIsinclude/net/devlink.h net/core/devlink.c+65 -250 repliesApplied
3/5netdevsim: replace port_list_lock with devlink instance lockdrivers/net/netdevsim/dev.c drivers/net/netdevsim/netdevsim.h+20 -210 repliesApplied
4/5netdevsim: replace vfs_lock with devlink instance lockdrivers/net/netdevsim/dev.c drivers/net/netdevsim/netdevsim.h+20 -180 repliesApplied
5/5devlink: hold the instance lock during eswitch_mode callbacksdrivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c drivers/net/ethernet/netronome/nfp/nfp_devlink.c +2 more+54 -510 repliesApplied

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchJiri PirkoLeon Romanovsky
1/5
2/5R-b
3/5
4/5
5/5R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net-next v2 0/5] devlink: hold the instance lock in eswitch callbacks

Series number 2 in the effort to hold the devlink instance lock in call driver callbacks. We have the following drivers using this API:

- bnxt, nfp, netdevsim - their own locking is removed / simplified by this series; all of them needed a lock to protect from changes to the number of VFs while switching modes, now the VF config bus callback takes the devlink instance lock via devl_lock();
- ice - appears not to allow changing modes while SR-IOV enabled, so nothing to do there;
- liquidio - does not contain any locking;
- octeontx2/af - is very special but at least doesn't have locking so doesn't get in the way either;
- mlx5 has a wealth of locks - I chickened out and dropped the lock in the callbacks so that I can leave the driver be, for now.

The last one is obviously not ideal, but I would prefer to transition the API already as it make take longer.

v2: use a wrapper in mlx5 and extend the comment

Jakub Kicinski (5):
bnxt: use the devlink instance lock to protect sriov
devlink: add explicitly locked flavor of the rate node APIs
netdevsim: replace port_list_lock with devlink instance lock
netdevsim: replace vfs_lock with devlink instance lock
devlink: hold the instance lock during eswitch_mode callbacks

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |  1 -
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |  6 --
 .../net/ethernet/broadcom/bnxt/bnxt_sriov.c   |  4 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 22 ++---
 .../mellanox/mlx5/core/eswitch_offloads.c     | 54 ++++++++---
 .../net/ethernet/netronome/nfp/nfp_devlink.c  |  7 +-
 drivers/net/netdevsim/dev.c                   | 85 +++++++++---------
 drivers/net/netdevsim/netdevsim.h             |  2 -
 include/net/devlink.h                         |  4 +
 net/core/devlink.c                            | 90 ++++++++++++-------
 10 files changed, 156 insertions(+), 119 deletions(-)
Signature · 1 line
2.34.1