linux/drivers/infiniband/hw
Akiva Goldberger e5eba42f01 mlx5: Fix default values in create CQ
Currently, CQs without a completion function are assigned the
mlx5_add_cq_to_tasklet function by default. This is problematic since
only user CQs created through the mlx5_ib driver are intended to use
this function.

Additionally, all CQs that will use doorbells instead of polling for
completions must call mlx5_cq_arm. However, the default CQ creation flow
leaves a valid value in the CQ's arm_db field, allowing FW to send
interrupts to polling-only CQs in certain corner cases.

These two factors would allow a polling-only kernel CQ to be triggered
by an EQ interrupt and call a completion function intended only for user
CQs, causing a null pointer exception.

Some areas in the driver have prevented this issue with one-off fixes
but did not address the root cause.

This patch fixes the described issue by adding defaults to the create CQ
flow. It adds a default dummy completion function to protect against
null pointer exceptions, and it sets an invalid command sequence number
by default in kernel CQs to prevent the FW from sending an interrupt to
the CQ until it is armed. User CQs are responsible for their own
initialization values.

Callers of mlx5_core_create_cq are responsible for changing the
completion function and arming the CQ per their needs.

Fixes: cdd04f4d4d ("net/mlx5: Add support to create SQ and CQ for ASO")
Signed-off-by: Akiva Goldberger <agoldberger@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Acked-by: Leon Romanovsky <leon@kernel.org>
Link: https://patch.msgid.link/1762681743-1084694-1-git-send-email-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-11-11 15:12:18 +01:00
..
bnxt_re RDMA/bnxt_re: Fix a potential memory leak in destroy_gsi_sqp 2025-10-19 06:47:55 -04:00
cxgb4 RDMA: Use %pe format specifier for error pointers 2025-09-21 07:34:49 -04:00
efa RDMA/uverbs: Fix umem release in UVERBS_METHOD_CQ_CREATE 2025-10-19 07:31:25 -04:00
erdma RDMA v6.18 merge window pull request 2025-10-03 18:35:22 -07:00
hfi1 RDMA: Use %pe format specifier for error pointers 2025-09-21 07:34:49 -04:00
hns RDMA/hns: Remove an extra blank line 2025-10-27 05:44:00 -04:00
ionic RDMA/ionic: Fix memory leak of admin q_wr 2025-09-26 13:12:56 -03:00
irdma RDMA/irdma: Fix vf_id size to u16 to avoid overflow 2025-11-02 06:46:01 -05:00
mana RDMA: Use %pe format specifier for error pointers 2025-09-21 07:34:49 -04:00
mlx4 RDMA: Use %pe format specifier for error pointers 2025-09-21 07:34:49 -04:00
mlx5 mlx5: Fix default values in create CQ 2025-11-11 15:12:18 +01:00
mthca IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
ocrdma IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
qedr IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
usnic IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
vmw_pvrdma IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
Makefile RDMA/ionic: Add Makefile/Kconfig to kernel build environment 2025-09-11 02:18:36 -04:00