Re: [PATCH rdma-next 00/11] RDMA/mlx5: Preparation for SD support

From: Edward Srouji

Date: Sun Nov 22 2026 - 05:33:03 EST




On 11/17/2026 4:01 PM, Edward Srouji wrote:
This series prepares mlx5_ib for Socket Direct (SD), where one IB device
spans several core devices, one per PCIe function. Today the driver
assumes a single core device per IB device and reaches it through
dev->mdev all over the code.

Instead, each call site now finds its core device through the resource
it works on: QPs, SRQs, AHs and MWs through their PD, and DEVX objects,
UARs and mmaps through their ucontext. A CQ and an MR store the core
device they were created on, since they cannot always reach their owner
when they need it. The SD series can then change where a resource lives
in the resolvers, without touching the call sites.

The resolvers follow one naming scheme: <resource>_to_mdev() returns a
core device and <resource>_to_dev() an IB device. Where several resource
types are accepted, a _Generic() dispatches to per-type helpers, which
are prefixed with '__' and are not meant to be called directly.

State kept once per IB device, such as the ODP page-fault EQ, delay drop
and local loopback, stays on dev->mdev. The SD series decides how each
of them works across core devices.

This series only changes how each call site finds its core device. With
one core device per IB device every resolver returns dev->mdev, so the
behaviour is unchanged. Pre-existing issues in the touched code are
intentionally left alone so that each patch stays a mechanical
conversion.

Patches 1-2: name device pointers consistently, dev for the IB device
and mdev for the core device.
Patches 3-7: resolve the core device through the PD.
Patches 8-11: resolve the core device through the ucontext, and keep it
on the CQ.

Signed-off-by: Edward Srouji <edwards@xxxxxxxxxx>
Since this preparation series touches many files as part of a renaming process and some minor field changes, it is expected from Sashiko to flood us with many pre-existing issues.
I'll keep fixes for such issues out of this series and send them as separate patches with proper Fixes tags.
I'll reply briefly on each patch to note which findings we confirmed (and will fix separately) and which we believe can't happen.