Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH rdma-next 0/9] RDMA/mlx5: Don't lose port configuration events during probe
@ 2026-11-22 17:39 Edward Srouji
  2026-11-22 17:39 ` [PATCH rdma-next 1/9] RDMA/mlx5: Validate port number in handle_port_change() Edward Srouji
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Edward Srouji @ 2026-11-22 17:39 UTC (permalink / raw)
  To: Leon Romanovsky, Jason Gunthorpe, Maor Gottlieb, Chiara Meiohas,
	Mark Bloch, Maher Sanalla, Patrisious Haddad
  Cc: linux-rdma, linux-kernel, Edward Srouji, Michael Gur

mlx5_ib registers its event notifier after ib_register_device() and
dispatches no event until the device is active, so a port
configuration change that races with probe is lost: ib_core and the
clients keep what they read. A lost P_Key change leaves ib_sa on a
stale P_Key index and IPoIB without a carrier for good, as OpenSM
writes a P_Key block only when it differs from the one on the port.
This is hit on hypervisor setups, where the SM can program a VF's
partitions while it probes.

Patches 1-3 fix the event handling the rest builds on: the port
number taken from the EQE is validated before use, a slave port no
longer marks its master active, and the work of the system error and
slave port notifiers is flushed once they are unregistered. Patches 4-5
add ib_dispatch_event_sync(), which processes an event before it
returns, and patches 6-7 prepare mlx5_ib. Patch 8 records the
configuration changes of InfiniBand ports while the device is inactive
and replays them with ib_dispatch_event_sync() once it is active, which
lets patch 9 register the notifier before ib_register_device() and
flush its work before teardown.

Patch 1 overlaps with "RDMA/mlx5: Validate EQE port and GSI port before
indexing devr.ports[]" from Yishai's adversarial mode series [1].
Whichever lands first, the other can be trivially rebased.
I'll drop my patch if that series is applied first.

[1] lore.kernel.org/r/20261117170914.27410-1-yishaih@nvidia.com

Signed-off-by: Edward Srouji <edwards@nvidia.com>
---
Edward Srouji (9):
      RDMA/mlx5: Validate port number in handle_port_change()
      RDMA/mlx5: Don't let a slave port mark its master active
      RDMA/mlx5: Flush system error and slave port event work
      RDMA/core: Derive enforce_security from the cache event
      RDMA/core: Add ib_dispatch_event_sync()
      RDMA/mlx5: Pass the port and subtype to handle_port_change()
      RDMA/mlx5: Activate the device in a stage of its own
      RDMA/mlx5: Replay port configuration events after probe
      RDMA/mlx5: Register event notifier before IB registration

 drivers/infiniband/core/cache.c      |  67 +++++++---
 drivers/infiniband/hw/mlx5/main.c    | 246 +++++++++++++++++++++++++++++------
 drivers/infiniband/hw/mlx5/mlx5_ib.h |  17 ++-
 include/rdma/ib_verbs.h              |   1 +
 4 files changed, 274 insertions(+), 57 deletions(-)
---
base-commit: 7404c82cbf1246e0e84e2ec21834d23c26f9a8ed
change-id: 20261122-mlx5-port-events-probe-710a67521354

Best regards,
-- 
Edward Srouji <edwards@nvidia.com>


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

end of thread, other threads:[~2026-11-22 17:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 17:39 [PATCH rdma-next 0/9] RDMA/mlx5: Don't lose port configuration events during probe Edward Srouji
2026-11-22 17:39 ` [PATCH rdma-next 1/9] RDMA/mlx5: Validate port number in handle_port_change() Edward Srouji
2026-11-22 17:39 ` [PATCH rdma-next 2/9] RDMA/mlx5: Don't let a slave port mark its master active Edward Srouji
2026-11-22 17:39 ` [PATCH rdma-next 3/9] RDMA/mlx5: Flush system error and slave port event work Edward Srouji
2026-11-22 17:39 ` [PATCH rdma-next 4/9] RDMA/core: Derive enforce_security from the cache event Edward Srouji
2026-11-22 17:39 ` [PATCH rdma-next 5/9] RDMA/core: Add ib_dispatch_event_sync() Edward Srouji
2026-11-22 17:39 ` [PATCH rdma-next 6/9] RDMA/mlx5: Pass the port and subtype to handle_port_change() Edward Srouji
2026-11-22 17:39 ` [PATCH rdma-next 7/9] RDMA/mlx5: Activate the device in a stage of its own Edward Srouji
2026-11-22 17:39 ` [PATCH rdma-next 8/9] RDMA/mlx5: Replay port configuration events after probe Edward Srouji
2026-11-22 17:39 ` [PATCH rdma-next 9/9] RDMA/mlx5: Register event notifier before IB registration Edward Srouji
2026-11-22 17:58 ` [PATCH rdma-next 0/9] RDMA/mlx5: Don't lose port configuration events during probe sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox