[PATCH net V5 0/4] net/mlx5: Fixes for Socket-Direct
From: Tariq Toukan
Date: Mon May 04 2026 - 14:03:39 EST
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/20260428060111.221086-1-tariqt@xxxxxxxxxx/
V3: https://lore.kernel.org/all/20260423123104.201552-1-tariqt@xxxxxxxxxx/
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
--
2.44.0