From patchwork Mon Oct 19 19:40:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Dupuis X-Patchwork-Id: 7439651 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4F7BA9F302 for ; Mon, 19 Oct 2015 20:19:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71FFB206E8 for ; Mon, 19 Oct 2015 20:19:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91A8E206E2 for ; Mon, 19 Oct 2015 20:19:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754472AbbJSUTW (ORCPT ); Mon, 19 Oct 2015 16:19:22 -0400 Received: from mx0a-0016ce01.pphosted.com ([67.231.148.157]:37507 "EHLO mx0a-0016ce01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752771AbbJSUTP (ORCPT ); Mon, 19 Oct 2015 16:19:15 -0400 Received: from pps.filterd (m0045602.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id t9JKI8NB020175; Mon, 19 Oct 2015 13:19:13 -0700 Received: from avcashub1.qlogic.com (avcashub1.qlogic.com [198.70.193.115]) by mx0a-0016ce01.pphosted.com with ESMTP id 1xn79br0cd-2 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 19 Oct 2015 13:19:13 -0700 Received: from dut6217.mv.qlogic.com (172.29.56.217) by qlc.com (10.1.4.190) with Microsoft SMTP Server id 14.3.235.1; Mon, 19 Oct 2015 13:19:11 -0700 Received: by dut6217.mv.qlogic.com (Postfix, from userid 0) id 3B0F7522042; Mon, 19 Oct 2015 15:40:42 -0400 (EDT) From: Chad Dupuis To: CC: , Subject: [PATCH 3/7] bnx2fc: Set ELS transfer length correctly for middle path commands. Date: Mon, 19 Oct 2015 15:40:37 -0400 Message-ID: <1445283641-7358-4-git-send-email-chad.dupuis@qlogic.com> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1445283641-7358-1-git-send-email-chad.dupuis@qlogic.com> References: <1445283641-7358-1-git-send-email-chad.dupuis@qlogic.com> MIME-Version: 1.0 disclaimer: bypass X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=7959 signatures=670649 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1510190347 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Giridhar Malavali Signed-off-by: Chad Dupuis Reviewed-by: Hannes Reinecke Reviewed-by: Tomas Henzl --- 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);