On 10/17/23 10:58, Jason Gunthorpe wrote:
eg this kind of design pattern carries a subtle assumption that the rx and send CQ are ordered together. Getting a rx CQ before a matching tx CQ can trigger the unusual scenario where the send side runs out of resources.
If an rx CQ is received before the matching tx CQ by srp_queuecommand(), then srp_queuecommand() will return SCSI_MLQUEUE_HOST_BUSY and the SCSI core will retry the srp_queuecommand() after a small delay. This is a common approach in Linux kernel SCSI drivers. Thanks, Bart.