From patchwork Sat Aug 5 00:47:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 9882797 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 122766031B for ; Sat, 5 Aug 2017 00:48:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03C6828A14 for ; Sat, 5 Aug 2017 00:48:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED0B128A1D; Sat, 5 Aug 2017 00:48:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0CB728A14 for ; Sat, 5 Aug 2017 00:48:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659AbdHEAsB (ORCPT ); Fri, 4 Aug 2017 20:48:01 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33204 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752610AbdHEAr7 (ORCPT ); Fri, 4 Aug 2017 20:47:59 -0400 Received: by mail-pg0-f68.google.com with SMTP id u185so3142598pgb.0 for ; Fri, 04 Aug 2017 17:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PXUGVmUA4EPzw/wzjnlVP/hI8cLeOjJUGqEksXee3BY=; b=rZYK5XElXeecwpVcqk95/H+RSSpsnTBhaI+KrSI3LhFjbeTmqauSCg9tF6IpTlFZpT y3wc1yKW3lJvwRoPTzaQAqG0Pf1x4ElII+dApjgHUEkqu2e3yP0VJmicCBmdp6sWE7Nn 3wMwXJOu8lRtibIXRKbCgcs1ZfmiLEpPdPBuAvAiWUwZGASKAX2qEKRRqyxdYFad/Cxa Qi477jEn2HOZg8obCZjb+zq2JPWuElxUj6NKUv7ngjMRYv9S+jgQ2HfHSwgPL7z1FOUl RcWs6MzD8uE8K7jmg994CPS1sqB3PE96ANZcS4lOhcp+1pQeHempVhj+VexG2mpjBpqk bB4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PXUGVmUA4EPzw/wzjnlVP/hI8cLeOjJUGqEksXee3BY=; b=rAt0arPl0McnUHwOf/h3ey/ukWlcR9mEN4uGABiUoDB1Ijq+WRBytK/HdLNrDxeV2S mZ0eIS9Ruy9Hdm84vYZqsMhx/ImvlV+n4O8yH+R/zIcEK1h2abXPkU3RcKeHFdQOjv1s rg+dfVubFB76y//0pwF0dnYQNjqgPB2P8kaYCOgHu6OewHf+0iImPeckmnUGmgpK+jeC 0xcGuKSSiwRT3Jg9wfBAMom2YTyY1QLlT/1ivchfzCkajWL4Wr/SiHyo78vVLoU8QNwh HgtbtdX52xeXuHuheNJepjGuSZ4pHO2UN0ijhdaZIk4oYuF6eMNd7T6GhrEcu3iC8R5S ea0w== X-Gm-Message-State: AIVw113KkEKlN2dARo2lYmVwxsN+ZjceUs0kEoyq9ArsX69ijGxMxPi9 5q8WQlwEjPvOaBaR X-Received: by 10.84.128.69 with SMTP id 63mr4884502pla.54.1501894078370; Fri, 04 Aug 2017 17:47:58 -0700 (PDT) Received: from linux-8upr.localdomain (ip68-4-115-207.oc.oc.cox.net. [68.4.115.207]) by smtp.gmail.com with ESMTPSA id 69sm2725708pfh.186.2017.08.04.17.47.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Aug 2017 17:47:56 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, Dick Kennedy , James Smart Subject: [PATCH v2 10/20] lpfc: Fix NVME PRLI handling during RSCN Date: Fri, 4 Aug 2017 17:47:21 -0700 Message-Id: <20170805004731.1335-11-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170805004731.1335-1-jsmart2021@gmail.com> References: <20170805004731.1335-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dick Kennedy A race condition was found whereby the initiator would receive the RSCN for a new NVME device before it had a chance to register its FC4 support with the fabric. Thus, when queried by the initiator, it would see that the target supported FC-NVME. Corrected by making the assumption that the target always supports FC-NVME thus a PRLI is sent. It's ok for the target to reject it. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Johannes Thumshirn --- 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 fe0dd42b75af..9a8808abe61f 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2177,6 +2177,16 @@ lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, uint16_t cmdsize; u32 local_nlp_type, elscmd; + /* + * If we are in RSCN mode, the FC4 types supported from a + * previous GFT_ID command may not be accurate. So, if we + * are a NVME Initiator, always look for the possibility of + * the remote NPort beng a NVME Target. + */ + if (phba->sli_rev == LPFC_SLI_REV4 && + vport->fc_flag & FC_RSCN_MODE && + vport->nvmei_support) + ndlp->nlp_fc4_type |= NLP_FC4_NVME; local_nlp_type = ndlp->nlp_fc4_type; send_next_prli: