Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH] IB/cache: update gid cache on client reregister event
@ 2025-12-31 13:07 Etienne AUJAMES
  2026-01-03 14:11 ` Parav Pandit
  2026-01-04 14:24 ` Leon Romanovsky
  0 siblings, 2 replies; 4+ messages in thread
From: Etienne AUJAMES @ 2025-12-31 13:07 UTC (permalink / raw)
  To: linux-rdma; +Cc: Romain Fihue, Gael Delbary

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")
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
---
 drivers/infiniband/core/cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 81cf3c902e81..0fc1c5bce2f0 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -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);
 
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] IB/cache: update gid cache on client reregister event
  2025-12-31 13:07 [PATCH] IB/cache: update gid cache on client reregister event Etienne AUJAMES
@ 2026-01-03 14:11 ` Parav Pandit
  2026-01-04 14:37   ` Leon Romanovsky
  2026-01-04 14:24 ` Leon Romanovsky
  1 sibling, 1 reply; 4+ messages in thread
From: Parav Pandit @ 2026-01-03 14:11 UTC (permalink / raw)
  To: Etienne AUJAMES, linux-rdma@vger.kernel.org; +Cc: Romain Fihue, Gael Delbary


> From: Etienne AUJAMES <eaujames@ddn.com>
> 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).
> 
> 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.

> 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")
> Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
> ---
>  drivers/infiniband/core/cache.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
> index 81cf3c902e81..0fc1c5bce2f0 100644
> --- a/drivers/infiniband/core/cache.c
> +++ b/drivers/infiniband/core/cache.c
> @@ -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);
> 
> --
> 2.51.1
>
Apart from above nit,
 
Reviewed-by: Parav Pandit <parav@nvidia.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] IB/cache: update gid cache on client reregister event
  2025-12-31 13:07 [PATCH] IB/cache: update gid cache on client reregister event Etienne AUJAMES
  2026-01-03 14:11 ` Parav Pandit
@ 2026-01-04 14:24 ` Leon Romanovsky
  1 sibling, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2026-01-04 14:24 UTC (permalink / raw)
  To: linux-rdma, Etienne AUJAMES; +Cc: Romain Fihue, Gael Delbary


On Wed, 31 Dec 2025 14:07:45 +0100, Etienne AUJAMES wrote:
> 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,
-- 
Leon Romanovsky <leon@kernel.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] IB/cache: update gid cache on client reregister event
  2026-01-03 14:11 ` Parav Pandit
@ 2026-01-04 14:37   ` Leon Romanovsky
  0 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2026-01-04 14:37 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Etienne AUJAMES, linux-rdma@vger.kernel.org, Romain Fihue,
	Gael Delbary

On Sat, Jan 03, 2026 at 02:11:49PM +0000, Parav Pandit wrote:
> 
> > From: Etienne AUJAMES <eaujames@ddn.com>
> > 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).
> > 
> > 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.

I fixed it and applied.

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-04 14:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-31 13:07 [PATCH] IB/cache: update gid cache on client reregister event Etienne AUJAMES
2026-01-03 14:11 ` Parav Pandit
2026-01-04 14:37   ` Leon Romanovsky
2026-01-04 14:24 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox