Skip to content

net/mlx5: Fixes for Socket-Direct

Tariq Toukan linux-rdma lkml netdev 5 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 0 repliesApplied 4/4
  2. v44 patches 6 repliesSuperseded
  3. v34 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 patches4 repliesSuperseded
v13 patches8 repliesSuperseded

Changes in v5 from the cover letter

- Adjust "net/mlx5: SD: Serialize init/cleanup" to clear each peer's primary_dev pointer and the primary's secondaries[] under the comp lock, and to set devcom not-ready in the !primary and state != UP early-exit paths so the device cannot unregister while devcom is still marked ready.
- Adjust "net/mlx5e: SD, Fix race condition in secondary device probe/remove" to also take get_device()/put_device() on the primary's adev, since device_lock() alone does not pin the kobject.

Patches in v5 All 4 applied

#Subject and filesSizeRepliesApplied
1/4net/mlx5: SD: Serialize init/cleanupdrivers/net/ethernet/mellanox/mlx5/core/lib/sd.c+50 -60 repliesApplied
2/4net/mlx5: SD, Keep multi-pf debugfs entries on primarydrivers/net/ethernet/mellanox/mlx5/core/lib/sd.c+13 -60 repliesApplied
3/4net/mlx5e: SD, Fix missing cleanup on probe errordrivers/net/ethernet/mellanox/mlx5/core/en_main.c+11 -40 repliesApplied
4/4net/mlx5e: SD, Fix race condition in secondary device probe/removedrivers/net/ethernet/mellanox/mlx5/core/en_main.c drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c drivers/net/ethernet/mellanox/mlx5/core/lib/sd.h+48 -40 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH net V5 0/4] net/mlx5: Fixes for Socket-Direct

Hi,

This series fixes several race conditions and bugs in the mlx5 Socket-Direct (SD) single netdev flow.

Patch 1 serializes mlx5_sd_init()/mlx5_sd_cleanup() with mlx5_devcom_comp_lock() and tracks the SD group state on the primary device, preventing concurrent or duplicate bring-up/tear-down.

Patch 2 fixes the debugfs "multi-pf" directory being stored on the calling device's sd struct instead of the primary's, which caused memory leaks and recreation errors when cleanup ran from a different PF.

Patch 3 fixes a race where a secondary PF could access the primary's auxiliary device after it had been unbound, by holding the primary's device lock while operating on its auxiliary device.

Patch 4 fixes missing cleanup on ETH probe errors. The analogous gap on the resume path requires introducing sd_suspend/resume APIs that only destroy FW resources and is left for a follow-up series.

Regards,
Tariq

---

V5:
- Adjust "net/mlx5: SD: Serialize init/cleanup" to clear each peer's primary_dev pointer and the primary's secondaries[] under the comp lock, and to set devcom not-ready in the !primary and state != UP early-exit paths so the device cannot unregister while devcom is still marked ready.
- Adjust "net/mlx5e: SD, Fix race condition in secondary device probe/remove" to also take get_device()/put_device() on the primary's adev, since device_lock() alone does not pin the kobject.

V4: https://lore.kernel.org/all/[email protected]/
V3: https://lore.kernel.org/all/[email protected]/

Shay Drory (4):
net/mlx5: SD: Serialize init/cleanup
net/mlx5: SD, Keep multi-pf debugfs entries on primary net/mlx5e: SD, Fix missing cleanup on probe error net/mlx5e: SD, Fix race condition in secondary device probe/remove

 .../net/ethernet/mellanox/mlx5/core/en_main.c |  26 +++-
 .../net/ethernet/mellanox/mlx5/core/lib/sd.c  | 114 +++++++++++++++---
 .../net/ethernet/mellanox/mlx5/core/lib/sd.h  |   2 +
 3 files changed, 122 insertions(+), 20 deletions(-)

base-commit: bd3a4795d5744f59a1f485379f1303e5e606f377

Signature · 1 line
2.44.0