Skip to content

UCT/IB/MLX5: Avoid caching AH for UD/DC connect - #11833

Open
tvegas1 wants to merge 1 commit into
openucx:masterfrom
tvegas1:ud_x_ah_uncached
Open

UCT/IB/MLX5: Avoid caching AH for UD/DC connect#11833
tvegas1 wants to merge 1 commit into
openucx:masterfrom
tvegas1:ud_x_ah_uncached

Conversation

@tvegas1

@tvegas1 tvegas1 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What?

UD mlx5 and DC connect no longer use cached address handle (AH). The shared uct_ud_mlx5_iface_get_av() helper now creates a temporary, uncached AH just to extract the AV bytes, then destroys it right away.

Why?

The cached AH is keyed by resolved LID/GID and has no reliable invalidation path, so a peer's stale L2 address could keep being reused. The AH is only needed transiently here to read its AV bytes.

How?

uct_ud_mlx5_iface_get_av() does not go through the cached AH store anymore. This single shared helper covers both callers: UD mlx5 connect and DC connect.

Connection matching and is_connected() already compared the resolved LID/GID/QPN params, not the AH itself, so nothing else needed to change there. DC's pure-grant reply still uses the cached path, left as a follow-up TODO since it could have performance implications.

UD mlx5 and DC connect extract the resolved AV bytes from a
device-cached AH, which can retain a stale MAC once the peer's
IP-to-MAC mapping changes. Create this AH uncached and destroy it
right after copying out the AV, matching the fix already applied to
the RC DevX QP-connect path.

DC's pure-grant reply still relies on the cached AH; left unchanged
for now, with a TODO to move it to the same uncached helper.
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

@svc-nvidia-pr-review

Copy link
Copy Markdown

Optional (non-blocking): was this validated on RoCE hardware? The stale-L2-address case that motivates the fix is RoCE-specific, and there's no regression test — worth confirming the AV extraction path still behaves on a real RoCE device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants