IB/mlx5: Fix obj_type mismatch for SRQ event subscriptions
authorOr Har-Toov <ohartoov@nvidia.com>
Wed, 13 Aug 2025 12:43:20 +0000 (15:43 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 25 Aug 2025 18:06:46 +0000 (15:06 -0300)
commit85fe9f565d2d5af95ac2bbaa5082b8ce62b039f5
tree1bd575449a7da6cd49dbe09e927358e3965d3544
parent1b237f190eb3d36f52dffe07a40b5eb210280e00
IB/mlx5: Fix obj_type mismatch for SRQ event subscriptions

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")
Link: https://patch.msgid.link/r/8f1048e3fdd1fde6b90607ce0ed251afaf8a148c.1755088962.git.leon@kernel.org
Signed-off-by: Or Har-Toov <ohartoov@nvidia.com>
Reviewed-by: Edward Srouji <edwards@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/devx.c