Bumps up queue_depth on fc_change_queue_depth call back with
reason SCSI_QDEPTH_RAMP_UP.

Sets up ramp up period in case current queue_depth is lower
than max queue_depth in libfc.

Signed-off-by: Vasu Dev <[email protected]>
---

 drivers/scsi/libfc/fc_fcp.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 316767e..3502f80 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -129,6 +129,7 @@ static void fc_fcp_srr_error(struct fc_fcp_pkt *, struct 
fc_frame *);
 #define FC_MAX_RECOV_RETRY     3
 
 #define FC_FCP_DFLT_QUEUE_DEPTH 32
+#define FC_FCP_RAMP_UP_PERIOD  (120 * HZ)
 
 /**
  * fc_fcp_pkt_alloc - allocation routine for scsi_pkt packet
@@ -2054,9 +2055,20 @@ int fc_change_queue_depth(struct scsi_device *sdev, int 
qdepth, int reason)
        case SCSI_QDEPTH_QFULL:
                scsi_track_queue_full(sdev, qdepth);
                break;
+       case SCSI_QDEPTH_RAMP_UP:
+               if (qdepth + 1 <= FC_FCP_DFLT_QUEUE_DEPTH)
+                       scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev),
+                                               qdepth + 1);
+               break;
        default:
                return -EOPNOTSUPP;
        }
+
+       if (sdev->queue_depth < FC_FCP_DFLT_QUEUE_DEPTH)
+               sdev_set_rampup_period(sdev, FC_FCP_RAMP_UP_PERIOD);
+       else
+               sdev_set_rampup_period(sdev, 0);
+
        return sdev->queue_depth;
 }
 EXPORT_SYMBOL(fc_change_queue_depth);

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to