* [PATCH rdma-rc] IB/mlx5: Fix obj_type mismatch for SRQ event subscriptions
@ 2025-08-13 12:43 Leon Romanovsky
2025-08-25 18:07 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2025-08-13 12:43 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: Or Har-Toov, Edward Srouji, linux-rdma
From: Or Har-Toov <ohartoov@nvidia.com>
Fix a bug where the driver's event subscription logic for SRQ-related
events incorrectly sets obj_type for RMP objects.
When subscribing to SRQ events, get_legacy_obj_type() did not handle
the MLX5_CMD_OP_CREATE_RMP case, which caused obj_type to be 0
(default).
This led to a mismatch between the obj_type used during subscription
(0) and the value used during notification (1, taken from the event's
type field). As a result, event mapping for SRQ objects could fail and
event notification would not be delivered correctly.
This fix adds handling for MLX5_CMD_OP_CREATE_RMP in get_legacy_obj_type,
returning MLX5_EVENT_QUEUE_TYPE_RQ so obj_type is consistent between
subscription and notification.
Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX")
Signed-off-by: Or Har-Toov <ohartoov@nvidia.com>
Reviewed-by: Edward Srouji <edwards@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
drivers/infiniband/hw/mlx5/devx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c
index f21c82cb9a15..fad2c6142a8a 100644
--- a/drivers/infiniband/hw/mlx5/devx.c
+++ b/drivers/infiniband/hw/mlx5/devx.c
@@ -233,6 +233,7 @@ static u16 get_legacy_obj_type(u16 opcode)
{
switch (opcode) {
case MLX5_CMD_OP_CREATE_RQ:
+ case MLX5_CMD_OP_CREATE_RMP:
return MLX5_EVENT_QUEUE_TYPE_RQ;
case MLX5_CMD_OP_CREATE_QP:
return MLX5_EVENT_QUEUE_TYPE_QP;
--
2.50.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH rdma-rc] IB/mlx5: Fix obj_type mismatch for SRQ event subscriptions
2025-08-13 12:43 [PATCH rdma-rc] IB/mlx5: Fix obj_type mismatch for SRQ event subscriptions Leon Romanovsky
@ 2025-08-25 18:07 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2025-08-25 18:07 UTC (permalink / raw)
To: Leon Romanovsky; +Cc: Or Har-Toov, Edward Srouji, linux-rdma
On Wed, Aug 13, 2025 at 03:43:20PM +0300, Leon Romanovsky wrote:
> From: Or Har-Toov <ohartoov@nvidia.com>
>
> Fix a bug where the driver's event subscription logic for SRQ-related
> events incorrectly sets obj_type for RMP objects.
>
> When subscribing to SRQ events, get_legacy_obj_type() did not handle
> the MLX5_CMD_OP_CREATE_RMP case, which caused obj_type to be 0
> (default).
> This led to a mismatch between the obj_type used during subscription
> (0) and the value used during notification (1, taken from the event's
> type field). As a result, event mapping for SRQ objects could fail and
> event notification would not be delivered correctly.
>
> This fix adds handling for MLX5_CMD_OP_CREATE_RMP in get_legacy_obj_type,
> returning MLX5_EVENT_QUEUE_TYPE_RQ so obj_type is consistent between
> subscription and notification.
>
> Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX")
> Signed-off-by: Or Har-Toov <ohartoov@nvidia.com>
> Reviewed-by: Edward Srouji <edwards@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
> drivers/infiniband/hw/mlx5/devx.c | 1 +
> 1 file changed, 1 insertion(+)
Applied to for-next
Thanks,
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-25 18:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 12:43 [PATCH rdma-rc] IB/mlx5: Fix obj_type mismatch for SRQ event subscriptions Leon Romanovsky
2025-08-25 18:07 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).