From patchwork Fri Nov 10 01:08:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10052217 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 45ABA6032D for ; Fri, 10 Nov 2017 01:08:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36F7F2B20E for ; Fri, 10 Nov 2017 01:08:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BE4E2B227; Fri, 10 Nov 2017 01:08:56 +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 CB32F2B20E for ; Fri, 10 Nov 2017 01:08:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755525AbdKJBIy (ORCPT ); Thu, 9 Nov 2017 20:08:54 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:43624 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755472AbdKJBIu (ORCPT ); Thu, 9 Nov 2017 20:08:50 -0500 Received: by mail-qk0-f193.google.com with SMTP id 78so10123572qkz.0 for ; Thu, 09 Nov 2017 17:08:50 -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=E0BlCu9SzAybBN9R62aVY7B9H18a6IY2Vp122jmAzsULZTuzRdbvl4B5bSdLoanYE2 WpaORDrIdKUPO1UXqdtSkIVfN1ri9bwdIhZDue70UtzxlHirO0fwkFCFJA3ZUXyyV78p 7IRmEj/o6pfOG4l6m1YxgrjOVMawSCZ/LRv8dJ4A3tj6UhI8R6s5gjekln0PAe6ue0Wh LT7PBuTb+dFJPklly5vMCYMG0Si6hKbvuHXNsXVsiLh/gB/ObsD8pNEyoFhl6AXI4dGA CcpVDKHY1hRPaK+gbWphItnQRsuCObxntZB6ldJvEYcothEPGQmGdZoalu/f3tLyfZZA yBPw== 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=l+Yl29F2hh9llUBBwvVSDneBchWr7GuhULms1pWpCnWl8b6Pnm5qjBJp3vYPsAb5gT ZRcypbxNV5zxXBjpQMSsXVIAfH7zoYE92/2MljWuYAySJ66JzRUmBGz/av8GqA0csvIU gcn7zccCFHK+ONk2MTeJixPwyGiL3GJHDrEX9j9n8H54u5ps/brEIiKTKwXL6oz/wBMj alMXzPLm9yfRurgprDOKhbaJAEI5a385Vexj548WB5HSkWzhgn0mb1KJzghnr9JVgT6v ddLH/QPtODAHU5n16LZRC0sg4XSjJVzoK4HSxZUi4jkEOZqKiBILkyIo5BJrwYHiOARd 9Jaw== X-Gm-Message-State: AJaThX5g95q3POIQZC91gM1hiVVBmgWSx0L68t7TDir9S317biY6iP1E hTGeBaYwpOM6T6ilh3VocAvyzsUM X-Google-Smtp-Source: AGs4zMZs+CgNH1rJrrqX/qHUc90m5ebM9PWPFZLg55U6Bgb/hdwi+yKLfKmGT2UWP5crJhPZoxpIFw== X-Received: by 10.55.40.76 with SMTP id o73mr3926042qkh.301.1510276129742; Thu, 09 Nov 2017 17:08:49 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id j48sm5661969qta.96.2017.11.09.17.08.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Nov 2017 17:08:49 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v2 07/17] lpfc: Driver fails to detect direct attach storage array Date: Thu, 9 Nov 2017 17:08:24 -0800 Message-Id: <20171110010834.4542-8-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20171110010834.4542-1-jsmart2021@gmail.com> References: <20171110010834.4542-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;