OpenCloudOS-Kernel/drivers/infiniband
Michael Guralnik b8c5f63599 IB/core: Implement a limit on UMAD receive List
[ Upstream commit ca0b44e20a6f3032224599f02e7c8fb49525c894 ]

The existing behavior of ib_umad, which maintains received MAD
packets in an unbounded list, poses a risk of uncontrolled growth.
As user-space applications extract packets from this list, the rate
of extraction may not match the rate of incoming packets, leading
to potential list overflow.

To address this, we introduce a limit to the size of the list. After
considering typical scenarios, such as OpenSM processing, which can
handle approximately 100k packets per second, and the 1-second retry
timeout for most packets, we set the list size limit to 200k. Packets
received beyond this limit are dropped, assuming they are likely timed
out by the time they are handled by user-space.

Notably, packets queued on the receive list due to reasons like
timed-out sends are preserved even when the list is full.

Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Reviewed-by: Mark Zhang <markzhang@nvidia.com>
Link: https://lore.kernel.org/r/7197cb58a7d9e78399008f25036205ceab07fbd5.1713268818.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-11 12:49:03 +02:00
..
core IB/core: Implement a limit on UMAD receive List 2024-07-11 12:49:03 +02:00
hw RDMA/mlx5: Follow rb_key.ats when creating new mkeys 2024-06-27 13:49:12 +02:00
sw RDMA/rxe: Fix data copy for IB_SEND_INLINE 2024-06-27 13:49:12 +02:00
ulp RDMA/IPoIB: Fix format truncation compilation errors 2024-06-12 11:12:11 +02:00
Kconfig RDMA: Disable IB HW for UML 2022-12-04 15:22:03 +02:00
Makefile