Re: [PATCH 2/9] IB: add a proper completion queue abstraction

Bart Van Assche
2015-11-23T22:33:14Z

On 11/23/2015 02:18 PM, Jason Gunthorpe wrote:
> On Mon, Nov 23, 2015 at 01:54:05PM -0800, Bart Van Assche wrote:
> What I don't see is how SRP handles things when the
> sendq fills up, ie the case where __srp_get_tx_iu() == NULL. It looks
> like the driver starts to panic and generates printks. I can't tell if
> it can survive that, but it doesn't look very good..

Hello Jason,

From srp_cm_rep_handler():

target->scsi_host->can_queue
= min(ch->req_lim - SRP_TSK_MGMT_SQ_SIZE,
target->scsi_host->can_queue);

In other words, the SCSI core is told to ensure that the number of
outstanding SCSI commands is one less than the number of elements in the
ch->free_tx list. And since the SRP initiator serializes task management
requests it is guaranteed that __srp_get_tx_iu() won't fail due to
ch->free_tx being empty.

Bart.