Re: [PATCH v2] RDMA/srp: Reserve send queue and CQ space for ib_drain_qp()
From: Leon Romanovsky
Date: Thu Nov 26 2026 - 13:53:09 EST
On Wed, 25 Nov 2026 16:22:27 -0800, Praneeth Balasubramanian wrote:
> srp_destroy_qp() calls ib_drain_qp(), which also drains the send queue.
> ib_drain_sq() requires the caller to "ensure there is room in the CQ and
> SQ for the drain work request and completion".
>
> SRP reserves that room on the receive side, where the queue and CQ have
> queue_size + 1 entries. Commit 9294000d6d89 ("IB/srp: Drain the send
> queue before destroying a QP") switched from ib_drain_rq() to
> ib_drain_qp() but did not grow the send side. The send queue and send
> CQ hold exactly m * queue_size entries, which is the most work requests
> SRP can have outstanding. If the channel is torn down while the send
> queue is full, for example during error handling after a target stops
> responding, posting the drain work request can fail with "failed to
> drain send queue", or its completion can find the CQ full. The QP is
> then destroyed without the guarantee that ib_drain_qp() is meant to
> provide.
>
> [...]
Applied, thanks!
[1/1] RDMA/srp: Reserve send queue and CQ space for ib_drain_qp()
https://git.kernel.org/rdma/rdma/c/2e869a30085ec1
Best regards,
--
Leon Romanovsky <leon@xxxxxxxxxx>