From patchwork Wed Dec 16 23:12:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 7866671 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 60E0F9F387 for ; Wed, 16 Dec 2015 23:12:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90B42202FF for ; Wed, 16 Dec 2015 23:12:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1950203B8 for ; Wed, 16 Dec 2015 23:12:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755311AbbLPXM1 (ORCPT ); Wed, 16 Dec 2015 18:12:27 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34616 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755192AbbLPXMU (ORCPT ); Wed, 16 Dec 2015 18:12:20 -0500 Received: by mail-pa0-f45.google.com with SMTP id wq6so31093751pac.1 for ; Wed, 16 Dec 2015 15:12:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=date:from:to:subject:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=n+uw1DnIi0CIGeCApArn4m2P4v5nWsH7Mhgs9UWqhQs=; b=w4eAQ8KlRmiLnq6G2F4QgwAdxhpz4UFdPJN8zm5bljhvHhVqmZsgw0NlIUuwrc4zY/ Y5BAtA9UJsd7uJ0wc7KoFMbOc8Y9KP068vsptaUgbdpPHNuciUKAGCIUKmVSmZzz0KEF 1vydGtT9wUPhqDPw0QoSDOh48YYVjrmEWmjug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=n+uw1DnIi0CIGeCApArn4m2P4v5nWsH7Mhgs9UWqhQs=; b=kH/TBiP2Tec92gIu2W9KPsW+A25D9UstlZfl2kW3jhPgpjS/ayT7BBnufdla75X5jC cbnq2zBg6tzsJGacETBGK30wA53TGSqKuF4MuhGMPHb9QQ6BzK2qZc7FIACLK6aD9pgr zGwa1FZEzSDNgiPVYtJRIQwrtMjH7pelQ0CBoIUjF3gejLQCV+nB8xdkF9GBuLV9bCyN sb4IiDNGtltvgHGK9Xo7RKZII5RG+ncoalBIFSOFCRnQr0Lx6COHiMEv0q/q9W1M04uP mqsLikHv+TvJLEfkd7JK2b2rQdFvpuytLCPechnymAMHwAU4/sjXb+Fp55Jhm3yiWd2C ZRpw== X-Gm-Message-State: ALoCoQmWlJWZiEF5mJkDuHCzXOcbClQmxQpAdn22ofe0SvL0yVhgdfSUnBKyucTq8GBADoocm/o248fflvICHXEH0zLH/kkN8Q== X-Received: by 10.66.232.170 with SMTP id tp10mr67765800pac.38.1450307538890; Wed, 16 Dec 2015 15:12:18 -0800 (PST) Received: from myfc17 (cm-wififw.emulex.com. [138.239.220.50]) by smtp.gmail.com with ESMTPSA id w62sm6875332pfi.48.2015.12.16.15.12.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 Dec 2015 15:12:18 -0800 (PST) Date: Wed, 16 Dec 2015 18:12:00 -0500 From: james.smart@avagotech.com (James Smart) To: linux-scsi@vger.kernel.org Subject: [PATCH 09/17] lpfc: Fix RDP ACC being too long. Message-ID: <5671efc0.SB0qVbj8lP/LNAjA%james.smart@avagotech.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_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 Fix RDP ACC being too long. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_els.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index f7a2967..817cdfc 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -4824,6 +4824,7 @@ lpfc_els_rdp_cmpl(struct lpfc_hba *phba, struct lpfc_rdp_context *rdp_context, struct lpfc_nodelist *ndlp = rdp_context->ndlp; struct lpfc_vport *vport = ndlp->vport; struct lpfc_iocbq *elsiocb; + struct ulp_bde64 *bpl; IOCB_t *icmd; uint8_t *pcmd; struct ls_rjt *stat; @@ -4833,6 +4834,8 @@ lpfc_els_rdp_cmpl(struct lpfc_hba *phba, struct lpfc_rdp_context *rdp_context, if (status != SUCCESS) goto error; + + /* This will change once we know the true size of the RDP payload */ cmdsize = sizeof(struct fc_rdp_res_frame); elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, @@ -4874,6 +4877,13 @@ lpfc_els_rdp_cmpl(struct lpfc_hba *phba, struct lpfc_rdp_context *rdp_context, rdp_res->length = cpu_to_be32(fec_size + RDP_DESC_PAYLOAD_SIZE); elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; + /* Now that we know the true size of the payload, update the BPL */ + bpl = (struct ulp_bde64 *) + (((struct lpfc_dmabuf *)(elsiocb->context3))->virt); + bpl->tus.f.bdeSize = (fec_size + RDP_DESC_PAYLOAD_SIZE + 8); + bpl->tus.f.bdeFlags = 0; + bpl->tus.w = le32_to_cpu(bpl->tus.w); + phba->fc_stat.elsXmitACC++; rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0); if (rc == IOCB_ERROR)