RE: [PATCH 1/1] qla2xxx: Micro optimization in queuecommand handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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

From: linux-scsi-owner@xxxxxxxxxxxxxxx [mailto:linux-scsi-
owner@xxxxxxxxxxxxxxx] On Behalf Of Chetan Loke
Sent: February 14, 2012 9:48 AM
To: JBottomley@xxxxxxxxxxxxx; linux-scsi@xxxxxxxxxxxxxxx;
andrew.vasquez@xxxxxxxxxx
Cc: linux-driver@xxxxxxxxxx; loke.chetan@xxxxxxxxx
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@xxxxxxxxx>
---

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@xxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxx
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.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux