Skip to contentSkip to conversation

IB/cache: update gid cache on client reregister event

PATCH Applied Etienne AUJAMES 3 participants 4 messages Dec 31, 2025 – Jan 4 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/cache: update gid cache on client reregister event

Some HCAs (e.g: ConnectX4) do not trigger a IB_EVENT_GID_CHANGE on subnet prefix update from SM (PortInfo).

Since the d58c23c92548, the GID cache is updated exclusively on IB_EVENT_GID_CHANGE. If this event is not emitted, the subnet prefix in the IPoIB interface’s hardware address remains set to its default value (0xfe80000000000000).
Then rdma_bind_addr() failed because it relies on hardware address to find the port GID (subnet_prefix + port GUID).

This patch fixes this issue by updating the GID cache on IB_EVENT_CLIENT_REREGISTER event (emitted on PortInfo::ClientReregister=1).

Fixes d58c23c92548 ("IB/core: Only update PKEY and GID caches onrespective events")
---
 drivers/infiniband/core/cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/core/cache.c +2 -1
index 81cf3c902e81..0fc1c5bce2f0 100644
@@ -1537,7 +1537,8 @@ static void ib_cache_event_task(struct work_struct *_work)
 	 * the cache.
 	 */
 	ret = ib_cache_update(work->event.device, work->event.element.port_num,
-			      work->event.event == IB_EVENT_GID_CHANGE,
+			      work->event.event == IB_EVENT_GID_CHANGE ||
+			      work->event.event == IB_EVENT_CLIENT_REREGISTER,
 			      work->event.event == IB_EVENT_PKEY_CHANGE,
 			      work->enforce_security);
 
Signature · 1 line
2.51.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines

From: Etienne AUJAMES <[email protected]>
Sent: 31 December 2025 06:38 PM

Some HCAs (e.g: ConnectX4) do not trigger a IB_EVENT_GID_CHANGE on subnet prefix update from SM (PortInfo).

Quoted 7 lines

Since the d58c23c92548, the GID cache is updated exclusively on IB_EVENT_GID_CHANGE. If this event is not emitted, the subnet prefix in the IPoIB interface’s hardware address remains set to its default value (0xfe80000000000000).
Then rdma_bind_addr() failed because it relies on hardware address to find the port GID (subnet_prefix + port GUID).

Commit message should be referenced as d58c23c92548 ("IB/core: Only update PKEY and GID caches onrespective events"). (instead of just above commit id).
Please change the reference to full.

Quoted 25 lines

This patch fixes this issue by updating the GID cache on IB_EVENT_CLIENT_REREGISTER event (emitted on PortInfo::ClientReregister=1).

Fixes d58c23c92548 ("IB/core: Only update PKEY and GID caches onrespective events")
---
 drivers/infiniband/core/cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/core/cache.c +2 -2
index 81cf3c902e81..0fc1c5bce2f0 100644
@@ -1537,7 +1537,8 @@ static void ib_cache_event_task(struct work_struct *_work)
 	 * the cache.
 	 */
 	ret = ib_cache_update(work->event.device, work->event.element.port_num,
-			      work->event.event == IB_EVENT_GID_CHANGE,
+			      work->event.event == IB_EVENT_GID_CHANGE ||
+			      work->event.event == IB_EVENT_CLIENT_REREGISTER,
 			      work->event.event == IB_EVENT_PKEY_CHANGE,
 			      work->enforce_security);
 
--
Quoted 2 lines

2.51.1

Apart from above nit,

#2 lore raw
Quoted 14 lines · Parav Pandit
Quoted 7 lines

From: Etienne AUJAMES <[email protected]>
Sent: 31 December 2025 06:38 PM

Some HCAs (e.g: ConnectX4) do not trigger a IB_EVENT_GID_CHANGE on subnet prefix update from SM (PortInfo).

Quoted 7 lines

Since the d58c23c92548, the GID cache is updated exclusively on IB_EVENT_GID_CHANGE. If this event is not emitted, the subnet prefix in the IPoIB interface’s hardware address remains set to its default value (0xfe80000000000000).
Then rdma_bind_addr() failed because it relies on hardware address to find the port GID (subnet_prefix + port GUID).

Quoted 3 lines

Commit message should be referenced as d58c23c92548 ("IB/core: Only update PKEY and GID caches onrespective events"). (instead of just above commit id).
Please change the reference to full.

I fixed it and applied.

Thanks

#3 lore raw
In reply to Etienne AUJAMES
Quoted 11 lines · Etienne AUJAMES

Some HCAs (e.g: ConnectX4) do not trigger a IB_EVENT_GID_CHANGE on subnet prefix update from SM (PortInfo).

Since the d58c23c92548, the GID cache is updated exclusively on IB_EVENT_GID_CHANGE. If this event is not emitted, the subnet prefix in the IPoIB interface’s hardware address remains set to its default value (0xfe80000000000000).
Then rdma_bind_addr() failed because it relies on hardware address to find the port GID (subnet_prefix + port GUID).

[...]

Applied, thanks!

[1/1] IB/cache: update gid cache on client reregister event

      https://git.kernel.org/rdma/rdma/c/ddd6c8c873e912

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>