Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2104098lkv; Thu, 20 May 2021 03:30:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznHFbnES7Ak78ZLhgv3zKIJXBjPmK0gr82n1lQ7Fei+pGtZWoDMGCUmBYaG8aeH11bPwEI X-Received: by 2002:a92:d342:: with SMTP id a2mr4380172ilh.11.1621506621854; Thu, 20 May 2021 03:30:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621506621; cv=none; d=google.com; s=arc-20160816; b=BYGldE1XQEybkH6VnRmiMD4QErhyWK6+OjyMLA4jOM9WjLEnCwQs6lsFd+yjwvWQQa 0sv9ck7ceOW6J3jc+FDk9VSRgDIePhV9aulYTSD3zgL6r1TUaweLE9cl956svtov2tiF jQuqrTqTu7MbyeyEm5e2ZuL9Q4MGYMK8t0zENT2xvNxq1716B0sH2RpcbBC+1Kg8Drgr JcoGcywnOXSuNpTKAKELLOOXIcIwcR9Zwijpgbts4NZS4IDI7yNaIWUeitrynQCstOnh sfrmSaDT1pDMfEjeobUSn+Q2X+EB/HV+ZNjs+WF66GOkyqzaWtwZOZUREXb+CRpFqfeB YJiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9A0qdn83W0jVPV/X2ZgfpEnaONq+yFCop3Qm/xL0Tm8=; b=EE0Mm+ss0qYk4egXHHKj0yQRSAFocXhdFz7VOJmpojvwk7yqBZDFhQUTEH1r/K3b0z AVWyy+v1eLD9uh6qL3rAqdSFjI4czfF1dlU7K2jMa6bnZs2H+G3Kup75SUM2juvYlAin 36t205OoEf7poUJWGhDekevqtjO/u09febPDg+cDyjsofJjAMjdepTOARumUnauCPBaI 0NMd5aHupxRzsYk3CdTdF5c17iF3Uc5wljEHRjAOyoq4/F+mEoWKLEaNWPOwLsNrmTO0 Sy4XHKOFdmPTuFHPdpq/+IE1yq2DNz7DlBB3LaLFqjL7fD7FZOI5t9OBD6/3DEzW7w19 KhPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qiHVkVDD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e22si1738652iog.50.2021.05.20.03.30.08; Thu, 20 May 2021 03:30:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qiHVkVDD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236736AbhETKaU (ORCPT + 99 others); Thu, 20 May 2021 06:30:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:48688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236055AbhETKRe (ORCPT ); Thu, 20 May 2021 06:17:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E6A4561074; Thu, 20 May 2021 09:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503994; bh=E/VjnYJy91YhTHT/RiVfvE26KSzttDEQeUZREHPw+9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qiHVkVDDdr0Q3oZ2KUpyDULZRavuh5ZPa8VZy5FnAf+ugCvdIGwTEuhB7MHdGGV/s LFAFLvrF4YuteFH/e2zH9dbEdBMGEKaQcU8hLfaJP6nuRkkL5UPf78+lf/jAEtipjq sQZ3m4lzNMN4Z/V73oRK9Dj7i6Vp8+dhv72IaDWM= 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.14 046/323] scsi: lpfc: Fix pt2pt connection does not recover after LOGO Date: Thu, 20 May 2021 11:18:58 +0200 Message-Id: <20210520092121.685465667@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart [ Upstream commit bd4f5100424d17d4e560d6653902ef8e49b2fc1f ] On a pt2pt setup, between 2 initiators, if one side issues a a LOGO, there is no relogin attempt. The FC specs are grey in this area on which port (higher wwn or not) is to re-login. As there is no spec guidance, unconditionally re-PLOGI after the logout to ensure a login is re-established. Link: https://lore.kernel.org/r/20210301171821.3427-8-jsmart2021@gmail.com Co-developed-by: Dick Kennedy Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_nportdisc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 96411754aa43..40c6d6eacea9 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -708,9 +708,14 @@ lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, } } else if ((!(ndlp->nlp_type & NLP_FABRIC) && ((ndlp->nlp_type & NLP_FCP_TARGET) || - !(ndlp->nlp_type & NLP_FCP_INITIATOR))) || + (ndlp->nlp_type & NLP_NVME_TARGET) || + (vport->fc_flag & FC_PT2PT))) || (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { - /* Only try to re-login if this is NOT a Fabric Node */ + /* Only try to re-login if this is NOT a Fabric Node + * AND the remote NPORT is a FCP/NVME Target or we + * are in pt2pt mode. NLP_STE_ADISC_ISSUE is a special + * case for LOGO as a response to ADISC behavior. + */ mod_timer(&ndlp->nlp_delayfunc, jiffies + msecs_to_jiffies(1000 * 1)); spin_lock_irq(shost->host_lock); -- 2.30.2