]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
bnx2i: Fixed packet error created when the sq_size is set to 16
authorEddie Wai <eddie.wai@broadcom.com>
Mon, 16 May 2011 18:13:18 +0000 (11:13 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Jun 2011 01:34:03 +0000 (10:34 +0900)
commit 7287c63e986fe1a51a89f4bb1327320274a7a741 upstream.

The number of chip's internal command cell, which is use to generate
SCSI cmd packets to the target, was not initialized correctly by
the driver when the sq_size is changed from the default 128.
This, in turn, will create a problem where the chip's transmit pipe
will erroneously reuse an old command cell that is no longer valid.
The fix is to correctly initialize the chip's command cell upon setup.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/bnx2i/bnx2i_hwi.c
drivers/scsi/bnx2i/bnx2i_iscsi.c

index 96505e3ab9861de88f4d95afa840ee9b238a43f6..34f28fea222848e688fadcdf515082e441c252a1 100644 (file)
@@ -1221,6 +1221,7 @@ int bnx2i_send_fw_iscsi_init_msg(struct bnx2i_hba *hba)
        iscsi_init.dummy_buffer_addr_hi =
                (u32) ((u64) hba->dummy_buf_dma >> 32);
 
+       hba->num_ccell = hba->max_sqes >> 1;
        hba->ctx_ccell_tasks =
                        ((hba->num_ccell & 0xFFFF) | (hba->max_sqes << 16));
        iscsi_init.num_ccells_per_conn = hba->num_ccell;
index f0dce26593eb9783bd482f2a9ad56c49e606c87a..204d9629600d9ff86c7c3a93fc049bd2056b189a 100644 (file)
@@ -1205,6 +1205,9 @@ static int bnx2i_task_xmit(struct iscsi_task *task)
        struct bnx2i_cmd *cmd = task->dd_data;
        struct iscsi_cmd *hdr = (struct iscsi_cmd *) task->hdr;
 
+       if (bnx2i_conn->ep->num_active_cmds + 1 > hba->max_sqes)
+               return -ENOMEM;
+
        /*
         * If there is no scsi_cmnd this must be a mgmt task
         */