linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] qla2xxx: Micro optimization in queuecommand handler
@ 2012-02-14 14:47 Chetan Loke
  2012-02-22 16:51 ` Loke, Chetan
  0 siblings, 1 reply; 4+ messages in thread
From: Chetan Loke @ 2012-02-14 14:47 UTC (permalink / raw)
  To: JBottomley, linux-scsi, andrew.vasquez; +Cc: linux-driver, loke.chetan

Optimized queuecommand handler's to eliminate double head-room checks.
The checks are moved inside the 1st if-loop otherwise you would end up checking twice when there is enough head room.

Signed-off-by: Chetan Loke <loke.chetan@gmail.com>
---
 drivers/scsi/qla2xxx/qla_iocb.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 55a9676..825a046 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -383,9 +383,10 @@ qla2x00_start_scsi(srb_t *sp)
 		else
 			req->cnt = req->length -
 			    (req->ring_index - cnt);
+		/* If still no head room then bail out */
+		if (req->cnt < (req_cnt + 2))
+			goto queuing_error;
 	}
-	if (req->cnt < (req_cnt + 2))
-		goto queuing_error;
 
 	/* Build command packet */
 	req->current_outstanding_cmd = handle;
@@ -1502,9 +1503,9 @@ qla24xx_start_scsi(srb_t *sp)
 		else
 			req->cnt = req->length -
 				(req->ring_index - cnt);
+		if (req->cnt < (req_cnt + 2))
+			goto queuing_error;
 	}
-	if (req->cnt < (req_cnt + 2))
-		goto queuing_error;
 
 	/* Build command packet. */
 	req->current_outstanding_cmd = handle;
@@ -1717,11 +1718,10 @@ qla24xx_dif_start_scsi(srb_t *sp)
 		else
 			req->cnt = req->length -
 				(req->ring_index - cnt);
+		if (req->cnt < (req_cnt + 2))
+			goto queuing_error;
 	}
 
-	if (req->cnt < (req_cnt + 2))
-		goto queuing_error;
-
 	status |= QDSS_GOT_Q_SPACE;
 
 	/* Build header part of command packet (excluding the OPCODE). */
@@ -2349,11 +2349,10 @@ sufficient_dsds:
 			else
 				req->cnt = req->length -
 					(req->ring_index - cnt);
+			if (req->cnt < (req_cnt + 2))
+				goto queuing_error;
 		}
 
-		if (req->cnt < (req_cnt + 2))
-			goto queuing_error;
-
 		ctx = sp->ctx = mempool_alloc(ha->ctx_mempool, GFP_ATOMIC);
 		if (!sp->ctx) {
 			ql_log(ql_log_fatal, vha, 0x3010,
-- 
1.7.5.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] qla2xxx: Micro optimization in queuecommand handler
  2012-02-14 14:47 [PATCH 1/1] qla2xxx: Micro optimization in queuecommand handler Chetan Loke
@ 2012-02-22 16:51 ` Loke, Chetan
  2012-02-22 18:49   ` Chad Dupuis
  0 siblings, 1 reply; 4+ messages in thread
From: Loke, Chetan @ 2012-02-22 16:51 UTC (permalink / raw)
  To: JBottomley, linux-scsi, andrew.vasquez; +Cc: linux-driver, lokechetan

> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Chetan Loke
> Sent: February 14, 2012 9:48 AM
> To: JBottomley@parallels.com; linux-scsi@vger.kernel.org;
> andrew.vasquez@qlogic.com
> Cc: linux-driver@qlogic.com; loke.chetan@gmail.com
> Subject: [PATCH 1/1] qla2xxx: Micro optimization in queuecommand
> handler
> 
> Optimized queuecommand handler's to eliminate double head-room checks.
> The checks are moved inside the 1st if-loop otherwise you would end up
> checking twice when there is enough head room.
> 
> Signed-off-by: Chetan Loke <loke.chetan@gmail.com>
> ---

Ping...





>  drivers/scsi/qla2xxx/qla_iocb.c |   19 +++++++++----------
>  1 files changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_iocb.c
> b/drivers/scsi/qla2xxx/qla_iocb.c
> index 55a9676..825a046 100644
> --- a/drivers/scsi/qla2xxx/qla_iocb.c
> +++ b/drivers/scsi/qla2xxx/qla_iocb.c
> @@ -383,9 +383,10 @@ qla2x00_start_scsi(srb_t *sp)
>  		else
>  			req->cnt = req->length -
>  			    (req->ring_index - cnt);
> +		/* If still no head room then bail out */
> +		if (req->cnt < (req_cnt + 2))
> +			goto queuing_error;
>  	}
> -	if (req->cnt < (req_cnt + 2))
> -		goto queuing_error;
> 
>  	/* Build command packet */
>  	req->current_outstanding_cmd = handle;
> @@ -1502,9 +1503,9 @@ qla24xx_start_scsi(srb_t *sp)
>  		else
>  			req->cnt = req->length -
>  				(req->ring_index - cnt);
> +		if (req->cnt < (req_cnt + 2))
> +			goto queuing_error;
>  	}
> -	if (req->cnt < (req_cnt + 2))
> -		goto queuing_error;
> 
>  	/* Build command packet. */
>  	req->current_outstanding_cmd = handle;
> @@ -1717,11 +1718,10 @@ qla24xx_dif_start_scsi(srb_t *sp)
>  		else
>  			req->cnt = req->length -
>  				(req->ring_index - cnt);
> +		if (req->cnt < (req_cnt + 2))
> +			goto queuing_error;
>  	}
> 
> -	if (req->cnt < (req_cnt + 2))
> -		goto queuing_error;
> -
>  	status |= QDSS_GOT_Q_SPACE;
> 
>  	/* Build header part of command packet (excluding the OPCODE).
*/
> @@ -2349,11 +2349,10 @@ sufficient_dsds:
>  			else
>  				req->cnt = req->length -
>  					(req->ring_index - cnt);
> +			if (req->cnt < (req_cnt + 2))
> +				goto queuing_error;
>  		}
> 
> -		if (req->cnt < (req_cnt + 2))
> -			goto queuing_error;
> -
>  		ctx = sp->ctx = mempool_alloc(ha->ctx_mempool,
GFP_ATOMIC);
>  		if (!sp->ctx) {
>  			ql_log(ql_log_fatal, vha, 0x3010,
> --
> 1.7.5.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] qla2xxx: Micro optimization in queuecommand handler
  2012-02-22 16:51 ` Loke, Chetan
@ 2012-02-22 18:49   ` Chad Dupuis
  2012-02-22 19:06     ` Loke, Chetan
  0 siblings, 1 reply; 4+ messages in thread
From: Chad Dupuis @ 2012-02-22 18:49 UTC (permalink / raw)
  To: Loke, Chetan
  Cc: JBottomley@parallels.com, linux-scsi@vger.kernel.org,
	Andrew Vasquez, Dept-Eng Linux Driver, lokechetan@gmail.com



On Wed, 22 Feb 2012, Loke, Chetan wrote:

>> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
>> owner@vger.kernel.org] On Behalf Of Chetan Loke
>> Sent: February 14, 2012 9:48 AM
>> To: JBottomley@parallels.com; linux-scsi@vger.kernel.org;
>> andrew.vasquez@qlogic.com
>> Cc: linux-driver@qlogic.com; loke.chetan@gmail.com
>> Subject: [PATCH 1/1] qla2xxx: Micro optimization in queuecommand
>> handler
>>
>> Optimized queuecommand handler's to eliminate double head-room checks.
>> The checks are moved inside the 1st if-loop otherwise you would end up
>> checking twice when there is enough head room.
>>
>> Signed-off-by: Chetan Loke <loke.chetan@gmail.com>
>> ---
>
> Ping...
>

Hi Chetan,

We have picked this up and it will be part of our next submission.  Since
this affects the I/O path we wanted to have this patch go through one of
our full test cycles.

Thanks,
Chad

>
>
>
>
>>  drivers/scsi/qla2xxx/qla_iocb.c |   19 +++++++++----------
>>  1 files changed, 9 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/scsi/qla2xxx/qla_iocb.c
>> b/drivers/scsi/qla2xxx/qla_iocb.c
>> index 55a9676..825a046 100644
>> --- a/drivers/scsi/qla2xxx/qla_iocb.c
>> +++ b/drivers/scsi/qla2xxx/qla_iocb.c
>> @@ -383,9 +383,10 @@ qla2x00_start_scsi(srb_t *sp)
>>              else
>>                      req->cnt = req->length -
>>                          (req->ring_index - cnt);
>> +            /* If still no head room then bail out */
>> +            if (req->cnt < (req_cnt + 2))
>> +                    goto queuing_error;
>>      }
>> -    if (req->cnt < (req_cnt + 2))
>> -            goto queuing_error;
>>
>>      /* Build command packet */
>>      req->current_outstanding_cmd = handle;
>> @@ -1502,9 +1503,9 @@ qla24xx_start_scsi(srb_t *sp)
>>              else
>>                      req->cnt = req->length -
>>                              (req->ring_index - cnt);
>> +            if (req->cnt < (req_cnt + 2))
>> +                    goto queuing_error;
>>      }
>> -    if (req->cnt < (req_cnt + 2))
>> -            goto queuing_error;
>>
>>      /* Build command packet. */
>>      req->current_outstanding_cmd = handle;
>> @@ -1717,11 +1718,10 @@ qla24xx_dif_start_scsi(srb_t *sp)
>>              else
>>                      req->cnt = req->length -
>>                              (req->ring_index - cnt);
>> +            if (req->cnt < (req_cnt + 2))
>> +                    goto queuing_error;
>>      }
>>
>> -    if (req->cnt < (req_cnt + 2))
>> -            goto queuing_error;
>> -
>>      status |= QDSS_GOT_Q_SPACE;
>>
>>      /* Build header part of command packet (excluding the OPCODE).
> */
>> @@ -2349,11 +2349,10 @@ sufficient_dsds:
>>                      else
>>                              req->cnt = req->length -
>>                                      (req->ring_index - cnt);
>> +                    if (req->cnt < (req_cnt + 2))
>> +                            goto queuing_error;
>>              }
>>
>> -            if (req->cnt < (req_cnt + 2))
>> -                    goto queuing_error;
>> -
>>              ctx = sp->ctx = mempool_alloc(ha->ctx_mempool,
> GFP_ATOMIC);
>>              if (!sp->ctx) {
>>                      ql_log(ql_log_fatal, vha, 0x3010,
>> --
>> 1.7.5.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-scsi"
>> in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] qla2xxx: Micro optimization in queuecommand handler
  2012-02-22 18:49   ` Chad Dupuis
@ 2012-02-22 19:06     ` Loke, Chetan
  0 siblings, 0 replies; 4+ messages in thread
From: Loke, Chetan @ 2012-02-22 19:06 UTC (permalink / raw)
  To: Chad Dupuis
  Cc: JBottomley, linux-scsi, Andrew Vasquez, Dept-Eng Linux Driver,
	lokechetan

> From: Chad Dupuis [mailto:chad.dupuis@qlogic.com]
> Sent: February 22, 2012 1:49 PM
> To: Loke, Chetan
> Cc: JBottomley@parallels.com; linux-scsi@vger.kernel.org; Andrew
> Vasquez; Dept-Eng Linux Driver; lokechetan@gmail.com
> Subject: RE: [PATCH 1/1] qla2xxx: Micro optimization in queuecommand
> handler
> 
> 
.......
> 
> >> Optimized queuecommand handler's to eliminate double head-room
checks.
> >> The checks are moved inside the 1st if-loop otherwise you would end
up
> >> checking twice when there is enough head room.
> >>
> >> Signed-off-by: Chetan Loke <loke.chetan@gmail.com>
> >> ---
> >
> > Ping...
> >
> 
> Hi Chetan,
> 
> We have picked this up and it will be part of our next submission.
> Since this affects the I/O path we wanted to have this patch go
through one
> of our full test cycles.
> 

No problem. Thanks for the update Chad.

> Thanks,
> Chad

Chetan


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-22 19:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-14 14:47 [PATCH 1/1] qla2xxx: Micro optimization in queuecommand handler Chetan Loke
2012-02-22 16:51 ` Loke, Chetan
2012-02-22 18:49   ` Chad Dupuis
2012-02-22 19:06     ` Loke, Chetan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).