linux/drivers/infiniband/core
Maher Sanalla 37826f0a8c IB/mad: Check available slots before posting receive WRs
The ib_post_receive_mads() function handles posting receive work
requests (WRs) to MAD QPs and is called in two cases:
1) When a MAD port is opened.
2) When a receive WQE is consumed upon receiving a new MAD.

Whereas, if MADs arrive during the port open phase, a race condition
might cause an extra WR to be posted, exceeding the QP’s capacity.
This leads to failures such as:
infiniband mlx5_0: ib_post_recv failed: -12
infiniband mlx5_0: Couldn't post receive WRs
infiniband mlx5_0: Couldn't start port
infiniband mlx5_0: Couldn't open port 1

Fix this by checking the current receive count before posting a new WR.
If the QP’s receive queue is full, do not post additional WRs.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Link: https://patch.msgid.link/c4984ba3c3a98a5711a558bccefcad789587ecf1.1741875592.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2025-03-19 04:43:03 -04:00
..
Makefile RDMA/uverbs: Introduce UCAP (User CAPabilities) API 2025-03-09 13:13:02 -04:00
addr.c Revert "RDMA/core: Fix ENODEV error for iWARP test over vlan" 2024-11-12 09:53:11 -05:00
agent.c RDMA/core: Create GSI QP only when CM is supported 2024-07-01 15:38:05 +03:00
agent.h
cache.c IB/cache: Add log messages for IB device state changes 2025-02-06 03:40:50 -05:00
cgroup.c
cm.c IB/cm: Rework sending DREQ when destroying a cm_id 2024-11-17 04:51:49 -05:00
cm_msgs.h
cm_trace.c
cm_trace.h
cma.c RDMA/rxe: Make rping work with tun device 2025-02-03 06:38:43 -05:00
cma_configfs.c
cma_priv.h
cma_trace.c
cma_trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
core_priv.h RDMA/core: Remove unused declaration rdma_resolve_ip_route() 2024-08-19 15:19:52 -03:00
counters.c RDMA/core: Pass port to counter bind/unbind operations 2025-03-18 06:18:46 -04:00
cq.c
device.c RDMA/core: Create and destroy rdma_counter using rdma_zalloc_drv_obj() 2025-03-18 06:18:37 -04:00
ib_core_uverbs.c
iwcm.c RDMA/core: Fixes infiniband sysctl bounds 2025-03-03 13:49:02 -05:00
iwcm.h
iwpm_msg.c
iwpm_util.c
iwpm_util.h
lag.c RDMA/core: Remove NULL check before dev_{put, hold} 2024-05-05 15:12:35 +03:00
mad.c IB/mad: Check available slots before posting receive WRs 2025-03-19 04:43:03 -04:00
mad_priv.h
mad_rmpp.c
mad_rmpp.h
mr_pool.c
multicast.c
netlink.c RDMA/nldev: Add support for RDMA monitoring 2024-09-13 08:29:14 +03:00
nldev.c RDMA/core: Add support to optional-counters binding configuration 2025-03-18 06:18:42 -04:00
opa_smi.h
packer.c
rdma_core.c RDMA/core: Move ib_uverbs_file struct to uverbs_types.h 2024-11-04 06:57:21 -05:00
rdma_core.h
restrack.c RDMA/core: Add an option to display driver-specific QPs in the rdmatool 2024-04-30 11:19:29 +03:00
restrack.h
roce_gid_mgmt.c RDMA/core: Implement RoCE GID port rescan and export delete function 2024-11-04 06:57:21 -05:00
rw.c
sa.h
sa_query.c treewide: correct the typo 'retun' 2024-09-09 16:47:43 -07:00
security.c
smi.c
smi.h
sysfs.c RDMA/core: Don't expose hw_counters outside of init net namespace 2025-03-03 07:14:48 -05:00
trace.c
ucaps.c RDMA/uverbs: Introduce UCAP (User CAPabilities) API 2025-03-09 13:13:02 -04:00
ucma.c RDMA/core: Fixes infiniband sysctl bounds 2025-03-03 13:49:02 -05:00
ud_header.c RDMA/core: Remove unused ib_ud_header_unpack 2024-12-24 05:00:42 -05:00
umem.c RDMA/core: Fix best page size finding when it can cross SG entries 2025-02-19 07:17:39 -05:00
umem_dmabuf.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
umem_odp.c
user_mad.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
uverbs.h RDMA/core: Move ib_uverbs_file struct to uverbs_types.h 2024-11-04 06:57:21 -05:00
uverbs_cmd.c RDMA/uverbs: Propagate errors from rdma_lookup_get_uobject() 2025-03-13 08:26:37 -04:00
uverbs_ioctl.c
uverbs_main.c RDMA/uverbs: Introduce UCAP (User CAPabilities) API 2025-03-09 13:13:02 -04:00
uverbs_marshall.c RDMA/core: Remove unused ib_copy_path_rec_from_user 2024-12-24 05:00:42 -05:00
uverbs_std_types.c
uverbs_std_types_async_fd.c
uverbs_std_types_counters.c
uverbs_std_types_cq.c RDMA: Pass entire uverbs attr bundle to create cq function 2024-06-27 16:28:21 -03:00
uverbs_std_types_device.c RDMA/uverbs: Add support for UCAPs in context creation 2025-03-09 13:13:02 -04:00
uverbs_std_types_dm.c
uverbs_std_types_flow_action.c
uverbs_std_types_mr.c RDMA: Pass uverbs_attr_bundle as part of '.reg_user_mr_dmabuf' API 2024-08-11 11:12:50 +03:00
uverbs_std_types_qp.c
uverbs_std_types_srq.c
uverbs_std_types_wq.c
uverbs_uapi.c
verbs.c RDMA/core: Pass port to counter bind/unbind operations 2025-03-18 06:18:46 -04:00