IB/cache: update gid cache on client reregister event
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).
--- drivers/infiniband/core/cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/core/cache.c +2 -1
@@ -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
Quoted 7 lines
From: Etienne AUJAMES <[email protected]>
Sent: 31 December 2025 06:38 PMSome HCAs (e.g: ConnectX4) do not trigger a
IB_EVENT_GID_CHANGEon subnet prefix update from SM (PortInfo).
Quoted 7 lines
Since the
d58c23c92548, the GID cache is updated exclusively onIB_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).
Thenrdma_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_REREGISTERevent (emitted on PortInfo::ClientReregister=1).Fixes d58c23c92548 ("IB/core: Only update PKEY and GID caches onrespective events")Signed-off-by Etienne AUJAMES <[email protected]>--- drivers/infiniband/core/cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/infiniband/core/cache.c +2
-2@@ -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,
Quoted 14 lines · Parav Pandit
Quoted 7 lines
From: Etienne AUJAMES <[email protected]>
Sent: 31 December 2025 06:38 PMSome HCAs (e.g: ConnectX4) do not trigger a
IB_EVENT_GID_CHANGEon subnet prefix update from SM (PortInfo).Quoted 7 lines
Since the
d58c23c92548, the GID cache is updated exclusively onIB_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).
Thenrdma_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
Leon Romanovsky
AppliedQuoted 11 lines · Etienne AUJAMES
Some HCAs (e.g: ConnectX4) do not trigger a
IB_EVENT_GID_CHANGEon subnet prefix update from SM (PortInfo).Since the
d58c23c92548, the GID cache is updated exclusively onIB_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).
Thenrdma_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]>