From patchwork Fri Nov 3 22:56:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10041311 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 BFCDC603D7 for ; Fri, 3 Nov 2017 22:57:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B24C4299CE for ; Fri, 3 Nov 2017 22:57:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7313299E1; Fri, 3 Nov 2017 22:57:09 +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 51601299D9 for ; Fri, 3 Nov 2017 22:57:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756120AbdKCW4s (ORCPT ); Fri, 3 Nov 2017 18:56:48 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:50730 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756020AbdKCW4o (ORCPT ); Fri, 3 Nov 2017 18:56:44 -0400 Received: by mail-qt0-f193.google.com with SMTP id d9so5052998qtd.7 for ; Fri, 03 Nov 2017 15:56:44 -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=KmbzJgTTfPqU0jmo8T0NtGX0qCQG5/1WLAVxG1TslkQ=; b=KAR6v+Cm0RrAb0c5vUrpgBTbL3YFsxk7oHDySw8kVmiKMVZM2j7cqoGIHUAeCuYet5 sHDBawxbsEmoHl9HWGI5jqWaYI5BiUq1d32CPpv3XiZ4kaoi4HJcdpNOG7qOJIW055CX m78LPgxTul4QJm0fMAwRGuF52BIw9zDCK5gvUabijPKqWpjqZKnLy2ao6imVhZyAe7LS Msx3svjDWi+vPKeq2rb8+GrWni0ODJxHWNacybhUxUSuaj1ZRIB7fPm4CdWcSQmhI2gM du5cc9xEv2V6Ufhbeeiejv3I/UB9LiNKuse1ChqhRSCZtWRS1JTEjNUl9b7sHYTTFWh/ IU8w== 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=KmbzJgTTfPqU0jmo8T0NtGX0qCQG5/1WLAVxG1TslkQ=; b=fW4vDUnKRMcqW91phpYB0lmy7bqi3wWPp7qQEV9yidDoCK5aUKlRLrBaycqmNaJwk3 T5BIrpv18U5r8kQfkTJiuagF9MBIj0+nsxzK+R57MlsuE75St25lYwXlXrmCIPqWeVXd j6WUJfGBnlhOV1Gf5ssALx+dO30NwqG6EAZc9amL91Of849pwk79NR005hjHGT23Op7R c1O+1ugxHIyk21B+jwUvYGGHye0SVm6rbLrAw51LPSixM4gjKo3J2A6tvZ1V3WIuIo/z cg0OEyqWN7dmzkqfyps6i5EFpsQGGiTMR0AQTO1bJygeZ1da70P+yFKsw2rERdOeUchq HiwQ== X-Gm-Message-State: AMCzsaXEOqjh0Fed4AHosh7FXPtQYSCpzohuF6csNw5nJHBjLR1Qjlk4 1b4k8dGXXhtPUYQZ1G+kPGG0JkEI X-Google-Smtp-Source: ABhQp+TqiOXUUhJ0oCyIXn8sy0hF8N4fJZxtm0eJwi+4BgdvKx+CYV08415ZMGJijhnb31Dq8p5ONA== X-Received: by 10.200.49.188 with SMTP id h57mr12628495qte.115.1509749803977; Fri, 03 Nov 2017 15:56:43 -0700 (PDT) Received: from pallmd1.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id v21sm4765626qtv.21.2017.11.03.15.56.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Nov 2017 15:56:43 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH 07/17] lpfc: Driver fails to detect direct attach storage array Date: Fri, 3 Nov 2017 15:56:18 -0700 Message-Id: <20171103225628.24716-8-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20171103225628.24716-1-jsmart2021@gmail.com> References: <20171103225628.24716-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 7df791047f55..95872a0329ad 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;