Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1401793pxv; Fri, 2 Jul 2021 02:58:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIPygugcq67CQGkucyJmaMUaLHaok5pqDdR3Fji84yDI9NRF1Ftf52rO6FrBCS6OgNMXyP X-Received: by 2002:a5d:850d:: with SMTP id q13mr1252743ion.3.1625219912673; Fri, 02 Jul 2021 02:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625219912; cv=none; d=google.com; s=arc-20160816; b=tfrK8R5fOcaxoXNv7XE69Dn9NEK7XEfppt83UThvS9+tckYey3Ppmw5EUlrUOgmfLi tX6yuP7zEhDGglW9aRyJUMM6oFhjizN0y+xBA1Z9j4D5VUw+OpX/zfjDP9zq3QnE7tAX eJ/Jvf31PjsRzQW8iu289JhSLl9EjZMhTpLHBpVi7xKuRsubIf0CXjZfYmwyir4ousQo TLYD/bzukniNfEBcX6Q7vtd5Cv0ByL8VOY9ytqJInz251z1DbEXSysNneRjdBIBhte0M 7/9GVUCeeQkcYmFZEH7djeKXHwyceVT0+tVhMyO+/XsCNkrZzbQetRdwkB2aZBrrUwqP jNcQ== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=917ZlYP36XkgOQn6r9EovU4chAB4GY0K6ElVDj7YODY=; b=HNLXiDFrx/WK1rdKgzWim6yxSP9jV3kSyEFYIyX1BEOPsGMKgRpP5XQOvOk7Vzf8qh KM/qgBucQuVK4Z9ySakt2yYp+eKgTmuih/TEkHLkO6SLBjR9FjswOCj9GDXImhBiCNxx oNRAn4ueGQNktgZmASLi6q9Pofo2mLld+ek9ywDOa6VtAnUguef1repLgh1ux38sP9cA hFJr/1SNMEQIElv2FNYd0D1btGKbQ5g0h7EM6+Yh88dCtJjPw1yD/qWr6NdbmfuJeA+T 0JDUqk7g8y68iE/g22F9RXHHxsCHMYrJ7DxRYXQPy3F1kjSTL5HDQX1gcJfCU8GdA4rv 47Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=sLajJTTF; dkim=neutral (no key) header.i=@suse.de; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si3012642jak.4.2021.07.02.02.58.06; Fri, 02 Jul 2021 02:58:32 -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=@suse.de header.s=susede2_rsa header.b=sLajJTTF; dkim=neutral (no key) header.i=@suse.de; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230429AbhGBJXf (ORCPT + 99 others); Fri, 2 Jul 2021 05:23:35 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:35490 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230256AbhGBJXe (ORCPT ); Fri, 2 Jul 2021 05:23:34 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 1756A228DD; Fri, 2 Jul 2021 09:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625217662; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=917ZlYP36XkgOQn6r9EovU4chAB4GY0K6ElVDj7YODY=; b=sLajJTTFNmV8Nvktrd+o8uuIMUZxAEl9Tr+QVltAoqWdc0T68npjmSCP4hl6TO1Wztud5m VSRRya4UauV2ui9ptakCit2uKdYO8xW5KXl0wtAM11svE+jfQ7ZgYmITEsrJV5hWG1wto4 BBLOehp4Ll9UayhwyK/cnS3LVEHxNAI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625217662; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=917ZlYP36XkgOQn6r9EovU4chAB4GY0K6ElVDj7YODY=; b=M+nDoxHbMNqYAN19hifaQ4MMP4HpxJ+X4dKVxedPAkqyOlTdCvbAcktsKmUfUopxSTgbTP y6Ekl88qQ9B30IDA== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 0A1DAA3B87; Fri, 2 Jul 2021 09:21:02 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id EFDFA5170E26; Fri, 2 Jul 2021 11:21:01 +0200 (CEST) From: Daniel Wagner To: linux-scsi@vger.kernel.org Cc: GR-QLogic-Storage-Upstream@marvell.com, linux-kernel@vger.kernel.org, Nilesh Javali , Arun Easi , Himanshu Madhani , Benjamin Block , Roman Bolshakov , James Smart , Hannes Reinecke , Daniel Wagner , kernel test robot Subject: [PATCH v2] qla2xxx: synchronize rport dev_loss_tmo setting Date: Fri, 2 Jul 2021 11:20:52 +0200 Message-Id: <20210702092052.93202-1-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hannes Reinecke Currently, the dev_loss_tmo setting is only ever used for SCSI devices. This patch reshuffles initialisation such that the SCSI remote ports are registered before the NVMe ones, allowing the dev_loss_tmo setting to be synchronized between SCSI and NVMe. Signed-off-by: Hannes Reinecke Signed-off-by: Daniel Wagner [lkp: Do not depend on nvme_fc_set_remoteport_devloss() for !NVME_FC] Reported-by: kernel test robot --- This patch got some more testing by one of our partners. So far, no regression identified. changes v2: - fixed build failure for !NVME_FC reported by lkp drivers/scsi/qla2xxx/qla_attr.c | 6 ++++++ drivers/scsi/qla2xxx/qla_init.c | 10 +++------- drivers/scsi/qla2xxx/qla_nvme.c | 5 ++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 3aa9869f6fae..dad48a982804 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -2648,7 +2648,13 @@ qla2x00_get_starget_port_id(struct scsi_target *starget) static inline void qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) { + fc_port_t *fcport = *(fc_port_t **)rport->dd_data; + rport->dev_loss_tmo = timeout ? timeout : 1; + + if (IS_ENABLED(CONFIG_NVME_FC) && fcport->nvme_remote_port) + nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, + rport->dev_loss_tmo); } static void diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 0de250570e39..d078f16933c0 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5631,13 +5631,6 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) qla2x00_dfs_create_rport(vha, fcport); - if (NVME_TARGET(vha->hw, fcport)) { - qla_nvme_register_remote(vha, fcport); - qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_COMPLETE); - qla2x00_set_fcport_state(fcport, FCS_ONLINE); - return; - } - qla24xx_update_fcport_fcp_prio(vha, fcport); switch (vha->host->active_mode) { @@ -5659,6 +5652,9 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) break; } + if (NVME_TARGET(vha->hw, fcport)) + qla_nvme_register_remote(vha, fcport); + qla2x00_set_fcport_state(fcport, FCS_ONLINE); if (IS_IIDMA_CAPABLE(vha->hw) && vha->hw->flags.gpsc_supported) { diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 0cacb667a88b..678083a34e4d 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -41,7 +41,7 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport) req.port_name = wwn_to_u64(fcport->port_name); req.node_name = wwn_to_u64(fcport->node_name); req.port_role = 0; - req.dev_loss_tmo = 0; + req.dev_loss_tmo = fcport->dev_loss_tmo; if (fcport->nvme_prli_service_param & NVME_PRLI_SP_INITIATOR) req.port_role = FC_PORT_ROLE_NVME_INITIATOR; @@ -68,6 +68,9 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport) return ret; } + nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, + fcport->dev_loss_tmo); + if (fcport->nvme_prli_service_param & NVME_PRLI_SP_SLER) ql_log(ql_log_info, vha, 0x212a, "PortID:%06x Supports SLER\n", req.port_id); -- 2.29.2