diff mbox

[3/7] bnx2fc: Set ELS transfer length correctly for middle path commands.

Message ID 1445283641-7358-4-git-send-email-chad.dupuis@qlogic.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Chad Dupuis Oct. 19, 2015, 7:40 p.m. UTC
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
---
 drivers/scsi/bnx2fc/bnx2fc_els.c |    1 +
 drivers/scsi/bnx2fc/bnx2fc_io.c  |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

Comments

Hannes Reinecke Oct. 21, 2015, 10:23 a.m. UTC | #1
On 10/19/2015 09:40 PM, Chad Dupuis wrote:
> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
> ---
>  drivers/scsi/bnx2fc/bnx2fc_els.c |    1 +
>  drivers/scsi/bnx2fc/bnx2fc_io.c  |    8 ++++++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c b/drivers/scsi/bnx2fc/bnx2fc_els.c
> index 49d1e4d..0d0ab2e 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_els.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_els.c
> @@ -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);
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
> index 520dabe..5d6a81b 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_io.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
> @@ -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);
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Tomas Henzl Oct. 22, 2015, 2:53 p.m. UTC | #2
On 19.10.2015 21:40, Chad Dupuis wrote:
> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Tomas


--
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
diff mbox

Patch

diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c b/drivers/scsi/bnx2fc/bnx2fc_els.c
index 49d1e4d..0d0ab2e 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_els.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_els.c
@@ -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);
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 520dabe..5d6a81b 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -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);