]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
IB/cache: update gid cache on client reregister event
authorEtienne AUJAMES <eaujames@ddn.com>
Wed, 31 Dec 2025 13:07:45 +0000 (14:07 +0100)
committerLeon Romanovsky <leon@kernel.org>
Sun, 4 Jan 2026 14:07:22 +0000 (09:07 -0500)
Some HCAs (e.g: ConnectX4) do not trigger a IB_EVENT_GID_CHANGE on
subnet prefix update from SM (PortInfo).

Since the commit d58c23c92548 ("IB/core: Only update PKEY and GID caches
on respective events"), 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 on respective events")
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Link: https://patch.msgid.link/aVUfsO58QIDn5bGX@eaujamesFR0130
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/cache.c

index 81cf3c902e81951647e4960df3ae547c0d825666..0fc1c5bce2f0d32ee28296b8c66fd194bde700a8 100644 (file)
@@ -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);