Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1942143imm; Thu, 24 May 2018 03:19:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpcOnFioQyH34r1UyMT9eWppBroRn1/3RnJEbszZjM+Qf7kdnUeRTZofPM3gNpod3ZzZRru X-Received: by 2002:a63:934d:: with SMTP id w13-v6mr5492888pgm.212.1527157169482; Thu, 24 May 2018 03:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527157169; cv=none; d=google.com; s=arc-20160816; b=qYdWDhLz1N1dp/dvSnWRsq0RJs0DR7zSaF7xp1GxCrup7q86E96C1LMCmIOwVKhZsp uiBkEkqsUCTMaE59MB9i6HZOF/noiVwtZiknCvMDmlYaHjGK5/Pu1q7zDm7da6ZG9gXR 2+0xqzStahNx2qwxmAlRxo0aBeHNxJ3cf5mNH82AoY9F6uCWIv3cATkQZmmIhWV1xiC2 eMzHGlgYUb2txYmcrqSyWvZnDp1kQmZVsmf/HJuMPWuWRJV/0UDIm4zXdCiJ0updbew9 mQPJqsqGUk/RrfX3uObqjBIBcySPeYjbpz91VOpXXVilIyUeMnoGDA3KbohtfGftm+wl evyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=h12Y9VF6C5XY37Pu9pqpgEF3NiqQug/EB5Wf+MeRu4U=; b=pHK7QKRtFcoe0MbFe/M6VFybFiI37p28dwj9y6LFux/G/VyRZCeerUXqOFJQayp9Sz 3nrqSrI6RAM+GGrYlFQQjHk6ixFKWK/2OX/Hy9pvSeLAEWNnReDv4RqAzWokAmYP1d0c MBRKkEmCIytZtqBkYUnYtdglGzCMkS/KPmGPDciypAOMLZ/D9Zs5pyvbPCUZFfdOzW2x bV+67MyTWNvPC/MmFFOO4gZi1/jTkA8PVzha63leTkowOzUVG6HVtN0G+cTilV3X0lx+ UYoqZVZpY8DIiCPqbK4QaIX06kZWPDwpwgPcHcwNiGoYrtFl9A1cxefOQKTOz0EaTqkL Fuvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GDiBRtst; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l13-v6si4043620pga.589.2018.05.24.03.19.14; Thu, 24 May 2018 03:19:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GDiBRtst; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031885AbeEXKSW (ORCPT + 99 others); Thu, 24 May 2018 06:18:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:52982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030969AbeEXKDo (ORCPT ); Thu, 24 May 2018 06:03:44 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8406F20891; Thu, 24 May 2018 10:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156223; bh=pwBJsX0u9Kb8vm2J5Ah/Fkf49GvzU+ZcDZ1MX3VjGWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GDiBRtstpLEsAk0MJniW62WaR5mubbBgcWnkOrT0TI44HEg+/x3zyxhUbGJ2t0Q3R KvB9gTYiyki/p8+zXxBicalfxbjk7RY0dVethzadwVockn+2cqJsT0nQYojhYapAOE kVvReKKwBOlc4vI6WKbyzsYranzzTvt/CS84ZoP8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.16 109/161] scsi: lpfc: Fix NVME Initiator FirstBurst Date: Thu, 24 May 2018 11:38:54 +0200 Message-Id: <20180524093031.445200161@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: James Smart [ Upstream commit 0709263abe0de70a798dcdf481d5dd489ca4752e ] First Burst support was not properly indicated in NVMe PRLI. Correct the bit position and the logic to check and set first burst support. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/lpfc/lpfc_nportdisc.c | 15 ++++++++++++++- drivers/scsi/lpfc/lpfc_nvme.h | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -1998,8 +1998,14 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vp ndlp->nlp_type |= NLP_NVME_TARGET; if (bf_get_be32(prli_disc, nvpr)) ndlp->nlp_type |= NLP_NVME_DISCOVERY; + + /* + * If prli_fba is set, the Target supports FirstBurst. + * If prli_fb_sz is 0, the FirstBurst size is unlimited, + * otherwise it defines the actual size supported by + * the NVME Target. + */ if ((bf_get_be32(prli_fba, nvpr) == 1) && - (bf_get_be32(prli_fb_sz, nvpr) > 0) && (phba->cfg_nvme_enable_fb) && (!phba->nvmet_support)) { /* Both sides support FB. The target's first @@ -2008,6 +2014,13 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vp ndlp->nlp_flag |= NLP_FIRSTBURST; ndlp->nvme_fb_size = bf_get_be32(prli_fb_sz, nvpr); + + /* Expressed in units of 512 bytes */ + if (ndlp->nvme_fb_size) + ndlp->nvme_fb_size <<= + LPFC_NVME_FB_SHIFT; + else + ndlp->nvme_fb_size = LPFC_NVME_MAX_FB; } } --- a/drivers/scsi/lpfc/lpfc_nvme.h +++ b/drivers/scsi/lpfc/lpfc_nvme.h @@ -27,6 +27,8 @@ #define LPFC_NVME_WAIT_TMO 10 #define LPFC_NVME_EXPEDITE_XRICNT 8 +#define LPFC_NVME_FB_SHIFT 9 +#define LPFC_NVME_MAX_FB (1 << 20) /* 1M */ struct lpfc_nvme_qhandle { uint32_t index; /* WQ index to use */