From patchwork Tue Nov 21 00:00:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10067513 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 795C560224 for ; Tue, 21 Nov 2017 00:01:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B41B29194 for ; Tue, 21 Nov 2017 00:01:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 603382923B; Tue, 21 Nov 2017 00:01:23 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 03BC129194 for ; Tue, 21 Nov 2017 00:01:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751994AbdKUABF (ORCPT ); Mon, 20 Nov 2017 19:01:05 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:38593 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915AbdKUABB (ORCPT ); Mon, 20 Nov 2017 19:01:01 -0500 Received: by mail-qk0-f195.google.com with SMTP id a142so9762095qkb.5 for ; Mon, 20 Nov 2017 16:01:01 -0800 (PST) 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=cF2hvEQAjfODkDbb+kQpiiSZQCPPSdNWNdvg+32Pksw=; b=XT3W9P6DvQq7HYjhN/ivVu0PMSIg4JXBO3sXH59dv+q4bwxGwCOAQh4q0T4JLSrOml FFFH8DAmM88VxS/W6jchVKZD2lFoChNWWYdZaHvJtj/JPXoV60GlsKtxdNuNtZ8Tsg7x oIPFcxhsBF/TBh3aa79ECzDx3eD6Mf+6xzbGv4rE2v/XKIGs8Lrk3P4/E0zU1BaxdQr6 5MGE/bCU0NO2rBA1v/YVJEw/TwB5K80VJaoGQvlf5VfaSPxQdmFNd2rYI1etwvf/AK30 bd9ITplXNAY0+YNYi3U2Zu8ZCBkRi+ezDa00ZbQ5fkgVM6i2TPTUIB31vgoNZgDI5m5O SsTA== 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=cF2hvEQAjfODkDbb+kQpiiSZQCPPSdNWNdvg+32Pksw=; b=XmrZcSwD5znSTuOH4VpoA0PYWEt9cBu4pKM5hWV3wO3bwQ9jgsCc5gYvHVmveCNLx6 3OwXzxUbBNQdZupGnZU+SunkBqWpzVxQ38DOgGSBwzxA9pv8mlrsyJ5r9d+jAOMovA1O IyrvNnO06CeXtkqsoD7S8/PJPT6oCyQh1FGf+5ULh5JOFLtY2vvIs3NUXU45jyNjE0/z 8X5P7CPcza5GsSQ8jTq4kEdXPRxYrm+0SFFe+aHow1IlgsM9jkiomdGJ9K6YgnnhDzYT cObkeZTq0hLTg9FacOQe3V4Ld7++/E3igGvXRS//nFKBD1lYHKp+KrSciP/2x+eVfxCC +Btw== X-Gm-Message-State: AJaThX5mMjJjcmz2l3/GnQaG/I+R6qbYmUjfLtnitg2NMUUJEkWNQaxo 3Bff8zTqGgZLidVh5xslbw3yv6Lx X-Google-Smtp-Source: AGs4zMaqYkVhXoCnm2Pp438wEfv4M+ZrRKneHTB41NEghVn2RhR1yBjKlN9j26cl9GA6SMa6ZqvbRA== X-Received: by 10.55.22.221 with SMTP id 90mr23154496qkw.284.1511222461060; Mon, 20 Nov 2017 16:01:01 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id w143sm1612821qka.84.2017.11.20.16.00.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Nov 2017 16:01:00 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v3 07/17] lpfc: Driver fails to detect direct attach storage array Date: Mon, 20 Nov 2017 16:00:34 -0800 Message-Id: <20171121000044.27702-8-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20171121000044.27702-1-jsmart2021@gmail.com> References: <20171121000044.27702-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 The driver does not respond to PLOGI from the direct attach target. The driver uses incorrect S_ID in CONFIG_LINK, after FLOGI completion Correct by issuing CONFIG_LINK with the correct S_ID after receiving the PLOGI from the target Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_els.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index c81cdc637e64..532cd4b49c5d 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -858,6 +858,9 @@ lpfc_cmpl_els_flogi_nport(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, vport->fc_flag |= FC_PT2PT; spin_unlock_irq(shost->host_lock); + /* If we are pt2pt with another NPort, force NPIV off! */ + phba->sli3_options &= ~LPFC_SLI3_NPIV_ENABLED; + /* If physical FC port changed, unreg VFI and ALL VPIs / RPIs */ if ((phba->sli_rev == LPFC_SLI_REV4) && phba->fc_topology_changed) { lpfc_unregister_fcf_prep(phba); @@ -916,28 +919,29 @@ lpfc_cmpl_els_flogi_nport(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NPR_2B_DISC; spin_unlock_irq(shost->host_lock); - } else + + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mbox) + goto fail; + + lpfc_config_link(phba, mbox); + + mbox->mbox_cmpl = lpfc_mbx_cmpl_local_config_link; + mbox->vport = vport; + rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) { + mempool_free(mbox, phba->mbox_mem_pool); + goto fail; + } + } else { /* This side will wait for the PLOGI, decrement ndlp reference * count indicating that ndlp can be released when other * references to it are done. */ lpfc_nlp_put(ndlp); - /* If we are pt2pt with another NPort, force NPIV off! */ - phba->sli3_options &= ~LPFC_SLI3_NPIV_ENABLED; - - mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); - if (!mbox) - goto fail; - - lpfc_config_link(phba, mbox); - - mbox->mbox_cmpl = lpfc_mbx_cmpl_local_config_link; - mbox->vport = vport; - rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); - if (rc == MBX_NOT_FINISHED) { - mempool_free(mbox, phba->mbox_mem_pool); - goto fail; + /* Start discovery - this should just do CLEAR_LA */ + lpfc_disc_start(vport); } return 0;