Re: [PATCH 35/35] libfc: adds can_queue ramp up

Mike Christie
2009-09-14T17:18:41Z

Robert Love wrote:
> From: Vasu Dev <vasu.dev@intel.com>
>
> Adds last_can_queue_ramp_down_time and updates this on every
> ramp down. If last_can_queue_ramp_down_time is not zero then
> do ramp up on any IO completion in added fc_fcp_can_queue_ramp_up.
>
> Reset last_can_queue_ramp_down_time to zero once can_queue
> is ramped up to added max_can_queue limit, this is to avoid any
> more ramp up attempts on subsequent IO completion.
>
> The ramp down and up are skipped for FC_CAN_QUEUE_PERIOD
> to avoid infrequent changes to can_queue, this required
> keeping track of ramp up time also in last_can_queue_ramp_up_time.
>
> Adds code to ramp down can_queue if lp->qfull is set, with added
> new ramp up code the can_queue will be increased after
> FC_CAN_QUEUE_PERIOD, therefore it is safe to do ramp down
> without fsp in this case and will avoid thrash. This required
> fc_fcp_can_queue_ramp_down locking change so that it can be
> called with Scsi_Host lock held.
>

It looks like this could be a more common helper like the sdev ramp
up/down code. Software drivers like iscsi_tcp and drivers that do not
have hardware cmd limits like ib_iser, srp and cxgb3i could use it. And
I think this what lpfc wants in lpfc_queuecommand when lpfc_get_scsi_buf
fails instead of doing lpfc_rampdown_queue_depth.