]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
bnx2fc: Set ELS transfer length correctly for middle path commands.
authorChad Dupuis <chad.dupuis@qlogic.com>
Mon, 19 Oct 2015 19:40:37 +0000 (15:40 -0400)
committerJames Bottomley <JBottomley@Odin.com>
Tue, 10 Nov 2015 01:30:03 +0000 (17:30 -0800)
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/bnx2fc/bnx2fc_els.c
drivers/scsi/bnx2fc/bnx2fc_io.c

index 49d1e4d74bec72ccb2b6bea883558f7558e8bf4e..0d0ab2e272cbe626023e542b51606a347ea7860c 100644 (file)
@@ -707,6 +707,7 @@ static int bnx2fc_initiate_els(struct bnx2fc_rport *tgt, unsigned int op,
        els_req->cb_func = cb_func;
        cb_arg->io_req = els_req;
        els_req->cb_arg = cb_arg;
+       els_req->data_xfer_len = data_len;
 
        mp_req = (struct bnx2fc_mp_req *)&(els_req->mp_req);
        rc = bnx2fc_init_mp_req(els_req);
index 520dabecc90b4d8ab40a1733079acc5c09881353..30916fd3a9f01f57a626966c0941bb169b94aa29 100644 (file)
@@ -623,8 +623,12 @@ int bnx2fc_init_mp_req(struct bnx2fc_cmd *io_req)
        mp_req = (struct bnx2fc_mp_req *)&(io_req->mp_req);
        memset(mp_req, 0, sizeof(struct bnx2fc_mp_req));
 
-       mp_req->req_len = sizeof(struct fcp_cmnd);
-       io_req->data_xfer_len = mp_req->req_len;
+       if (io_req->cmd_type != BNX2FC_ELS) {
+               mp_req->req_len = sizeof(struct fcp_cmnd);
+               io_req->data_xfer_len = mp_req->req_len;
+       } else
+               mp_req->req_len = io_req->data_xfer_len;
+
        mp_req->req_buf = dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE,
                                             &mp_req->req_buf_dma,
                                             GFP_ATOMIC);