From patchwork Tue Feb 8 14:20:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Lane X-Patchwork-Id: 1589878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=nbKZ1C+x; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JtQCV35P2z9sFn for ; Wed, 9 Feb 2022 01:20:38 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nHRM3-0000Uv-Or; Tue, 08 Feb 2022 14:20:27 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nHRLv-0000RA-DF for kernel-team@lists.ubuntu.com; Tue, 08 Feb 2022 14:20:19 +0000 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 2646A4003D for ; Tue, 8 Feb 2022 14:20:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1644330019; bh=zIc7ZlifrUHewGW2floGvzoqcR61SwDwHEHkzgAv8Ac=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nbKZ1C+xeVem4FUe7DwB7B05Yf5Voe3N01+vt7qRi+lRK7PCVQmeKvrr4QFKR5oON ni/C7mSBrdpqGYJyJacjw45fJn78A0BETJtglAJeMLtIoS7nkfCbLL0pnI+fsAenQp wBTvVdpZ80QNMa7h4cZmeXMDDfHSzeP9oyc0jJgXoO4WcDOZ74vge3wseUn+LljAJY YZOCaViHXi2/xGR5pn+MK3sTQ0a6UVIWllNgyUnv3sb8C+BOgG0+14N3fdBLvTeFm+ 8cUCXGLqKbFtNfg68tDKdsFAQ80MtFEs5DhgpmZ7d9W25ogF6UJdwBA7CAb2Q1gqUp XFTHaiR4YWjhg== Received: by mail-qk1-f197.google.com with SMTP id bk12-20020a05620a1a0c00b00508b8a58a62so1480026qkb.20 for ; Tue, 08 Feb 2022 06:20:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zIc7ZlifrUHewGW2floGvzoqcR61SwDwHEHkzgAv8Ac=; b=S6WvFQ6RCEEzxcgFS1hyFJ4R6VCoby0sq5v91oRLWSvl6HrvnlsOxxP+T5A1GHp6tz /FMUe0eQCtL9g/RP+ST9poz9euX9KKJrdL1a3O12xDre98rcnQuvPSZqDYmmJm3r/UWG 5oU5NZhAWCimkE4CRvZA1rh3FgJ4D4ZZYv1wbCeLX68LB2WOVYavUA5PJ/9zczQFfddK gnyoym5jay5GlN8eW4/PLSY73Eus9bp1oSMuKJDjV/d2tnRw7V4oK9ffHekf9Mtzivxw FStbjJZ0MRQekbJtk64SLnAlb7eUQtsBiVZxjv0qOQ6HgTPALQCf4RyNHIDPkRlpHaPp /WlQ== X-Gm-Message-State: AOAM532VksebITfnz5St8cPdWJ7t88pgdIvZNLHkriWZRTFYmHz+KBLB dH541+F1qTUWGWazsiXdXIywYC3njyE8sMh1obbaAcwx4hB26aMLWZDgeWVuM8nxLCwCLxQnDIb fw939YuZl3iL815kuyhqJUOX49MmtRVadAK+OOfO9XQ== X-Received: by 2002:a05:622a:1881:: with SMTP id v1mr3119867qtc.683.1644330017928; Tue, 08 Feb 2022 06:20:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwx2hX8Ylo5Kjbx14iWHm5Wou/4cZh0mShYQTDo3r+KIhWE7O4njIWXteosfbFE68mTR2+OPg== X-Received: by 2002:a05:622a:1881:: with SMTP id v1mr3119832qtc.683.1644330017438; Tue, 08 Feb 2022 06:20:17 -0800 (PST) Received: from localhost.localdomain ([71.217.161.186]) by smtp.gmail.com with ESMTPSA id b16sm6712977qtk.84.2022.02.08.06.20.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:20:17 -0800 (PST) From: Jeff Lane To: kernel-team@lists.ubuntu.com Subject: [J][PATCH 1/6] scsi: lpfc: Change return code on I/Os received during link bounce Date: Tue, 8 Feb 2022 09:20:09 -0500 Message-Id: <20220208142014.3782820-2-jeffrey.lane@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208142014.3782820-1-jeffrey.lane@canonical.com> References: <20220208142014.3782820-1-jeffrey.lane@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: James Smart BugLink: https://bugs.launchpad.net/bugs/1956982 During heavy I/O testing with issue_lip to bounce the link, occasionally I/O is terminated with status 3 result 9, which means the RPI is suspended. The I/O is completed and this type of error will result in immediate retry by the SCSI layer. The retry count expires and the I/O fails and returns error to the application. To avoid these quick retry/retries exhausted scenarios change the return code given to the midlayer to DID_REQUEUE rather than DID_ERROR. This gets them retried, and eventually succeed when the link recovers. Link: https://lore.kernel.org/r/20211204002644.116455-3-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen (cherry picked from commit 2e81b1a374da5d6024208c16c4a5224a70cafa64) Signed-off-by: Jeff Lane --- drivers/scsi/lpfc/lpfc_hw.h | 2 +- drivers/scsi/lpfc/lpfc_scsi.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 634f8fff7425..61c9db31d9da 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h @@ -3746,7 +3746,7 @@ typedef struct { #define IOERR_ILLEGAL_COMMAND 0x06 #define IOERR_XCHG_DROPPED 0x07 #define IOERR_ILLEGAL_FIELD 0x08 -#define IOERR_BAD_CONTINUE 0x09 +#define IOERR_RPI_SUSPENDED 0x09 #define IOERR_TOO_MANY_BUFFERS 0x0A #define IOERR_RCV_BUFFER_WAITING 0x0B #define IOERR_NO_CONNECTION 0x0C diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 479475845d5b..da6b24aa5116 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -4393,6 +4393,7 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, if (lpfc_cmd->result == IOERR_INVALID_RPI || lpfc_cmd->result == IOERR_NO_RESOURCES || lpfc_cmd->result == IOERR_ABORT_REQUESTED || + lpfc_cmd->result == IOERR_RPI_SUSPENDED || lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) { cmd->result = DID_REQUEUE << 16; break; @@ -4448,10 +4449,11 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, "9039 Iodone <%d/%llu> cmd x%px, error " - "x%x SNS x%x x%x Data: x%x x%x\n", + "x%x SNS x%x x%x LBA x%llx Data: x%x x%x\n", cmd->device->id, cmd->device->lun, cmd, - cmd->result, *lp, *(lp + 3), cmd->retries, - scsi_get_resid(cmd)); + cmd->result, *lp, *(lp + 3), + (u64)scsi_get_lba(cmd), + cmd->retries, scsi_get_resid(cmd)); } lpfc_update_stats(vport, lpfc_cmd); From patchwork Tue Feb 8 14:20:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Lane X-Patchwork-Id: 1589877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Opxp4QZk; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JtQCT2LZBz9sFx for ; Wed, 9 Feb 2022 01:20:37 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nHRLz-0000Ru-Uz; Tue, 08 Feb 2022 14:20:23 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nHRLw-0000RH-6R for kernel-team@lists.ubuntu.com; Tue, 08 Feb 2022 14:20:20 +0000 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id F01223F17B for ; Tue, 8 Feb 2022 14:20:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1644330019; bh=E/8+/zE/VdEJA0agBRt4NX1koZ02JGcL64Jknmc+Q4g=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Opxp4QZkvHhqJn0T3Nen6kChWNdV0sH905KWfPiIDwz733xdHQ8Md7NxrXSEDuKMY NqU7CB2v35AbFdR/fJPZBJ/jvgTACA7VdOW18valZgS22Xe04m8hW8SOLbae5QVLl3 IDDUSrUhjQcupISiJjupniS4mHLsykoqDGhFbG4AtkiQkKhwzvVo4gvtTpfkM7Gt7L tO7L6EwH5iqkjLPa6Qreh3J93or26bBmDTIXQ+pxtpijqvJtMNRhMQ1MvZ1Bqs1YR2 dYfPPq38YMn6v/1FqQbabiSdK0Lf35AhsxiWRgOfLlHum3IRwkZ6XWHf4bLwxNzu3H ExJIMUD6KddZQ== Received: by mail-qk1-f200.google.com with SMTP id z205-20020a3765d6000000b0047db3b020dfso10950881qkb.22 for ; Tue, 08 Feb 2022 06:20:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E/8+/zE/VdEJA0agBRt4NX1koZ02JGcL64Jknmc+Q4g=; b=sdhHqulrk0v4J/KSTXP/W23Mbam81t6JLarVhC88Ei1Q3a1/a4jHnlls+jyQLU9nU+ 4XiGHj60nGvPJivNIdVqp7Gs8Tr7CMA3QeWab5xWGBs/piC1btqRxaIfdBznAcgUkI2C T7BIDqkWlFdlwsimkCmuod3eNA0Ym+nDL1LmPbYoTr6QVwC7uK7DDq4gJTyHz5F868UF yaBHXrM6hK8jn/gnKUWJNEP781wMz7UcOv96pq+kmh4Fcznv1HGagIywnBv5g1+2MvZ6 xDTEUHoC/zVeviWvuxRhoev00DKGI/1u/LlipjWMzX9fa7XSndz16C9aFvwMqAAsvacS A4mA== X-Gm-Message-State: AOAM531I4eaBl3HFtPTgzkFPCLA7ODSMvpGq/EtkmvkJXqM9tAdwtt45 ToGVI5nXSdvX7qsLj45ksRbEBXdR+7qpzbIu/ZD9/immWYuIllSjhXiFJmKwInwsXxTOhQwd0KB Ib/CBW5hAs++dLpzE3xcl8xfKQ1dCtLdqTRpD8FmAjQ== X-Received: by 2002:a05:6214:2306:: with SMTP id gc6mr2017447qvb.119.1644330018620; Tue, 08 Feb 2022 06:20:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwakSio9d+5ZJ2d1eSwr7BZuf1vlRhU+G2cuILVg/068zumi0pKT0FozjaLuk+puxWtt91npQ== X-Received: by 2002:a05:6214:2306:: with SMTP id gc6mr2017410qvb.119.1644330018157; Tue, 08 Feb 2022 06:20:18 -0800 (PST) Received: from localhost.localdomain ([71.217.161.186]) by smtp.gmail.com with ESMTPSA id b16sm6712977qtk.84.2022.02.08.06.20.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:20:17 -0800 (PST) From: Jeff Lane To: kernel-team@lists.ubuntu.com Subject: [J][PATCH 2/6] scsi: lpfc: Fix NPIV port deletion crash Date: Tue, 8 Feb 2022 09:20:10 -0500 Message-Id: <20220208142014.3782820-3-jeffrey.lane@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208142014.3782820-1-jeffrey.lane@canonical.com> References: <20220208142014.3782820-1-jeffrey.lane@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: James Smart BugLink: https://bugs.launchpad.net/bugs/1956982 The driver is calling schedule_timeout after the DA_ID nameserver request and LOGO commands are issued to the fabric by the initiator virtual endport. These fixed delay functions are causing long delays in the driver's worker thread when processing discovery I/Os in a serialized fashion, which is then triggering mailbox timeout errors artificially. To fix this, don't wait on the DA_ID request to complete and call wait_event_timeout to allow the vport delete thread to make progress on an event driven basis rather than fixing the wait time. Link: https://lore.kernel.org/r/20211204002644.116455-5-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen (cherry picked from commit 8ed190a91950564775cbaae9e8e8083a69a8da23) Signed-off-by: Jeff Lane --- drivers/scsi/lpfc/lpfc.h | 2 - drivers/scsi/lpfc/lpfc_els.c | 11 ++++- drivers/scsi/lpfc/lpfc_hbadisc.c | 2 - drivers/scsi/lpfc/lpfc_vport.c | 83 ++++++++++++++++++++++++-------- 4 files changed, 73 insertions(+), 25 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 381f0f1b6666..da5a69a2b78f 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -668,8 +668,6 @@ struct lpfc_vport { struct timer_list els_tmofunc; struct timer_list delayed_disc_tmo; - int unreg_vpi_cmpl; - uint8_t load_flag; #define FC_LOADING 0x1 /* HBA in process of loading drvr */ #define FC_UNLOADING 0x2 /* HBA in process of unloading drvr */ diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 78024f11b794..db5ccae1b63d 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -10973,10 +10973,19 @@ lpfc_cmpl_els_npiv_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, lpfc_can_disctmo(vport); } + if (ndlp->save_flags & NLP_WAIT_FOR_LOGO) { + /* Wake up lpfc_vport_delete if waiting...*/ + if (ndlp->logo_waitq) + wake_up(ndlp->logo_waitq); + spin_lock_irq(&ndlp->lock); + ndlp->nlp_flag &= ~(NLP_ISSUE_LOGO | NLP_LOGO_SND); + ndlp->save_flags &= ~NLP_WAIT_FOR_LOGO; + spin_unlock_irq(&ndlp->lock); + } + /* Safe to release resources now. */ lpfc_els_free_iocb(phba, cmdiocb); lpfc_nlp_put(ndlp); - vport->unreg_vpi_cmpl = VPORT_ERROR; } /** diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 5e54ec503f18..816fc406135b 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -3934,7 +3934,6 @@ lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) vport->vpi_state &= ~LPFC_VPI_REGISTERED; vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; spin_unlock_irq(shost->host_lock); - vport->unreg_vpi_cmpl = VPORT_OK; mempool_free(pmb, phba->mbox_mem_pool); lpfc_cleanup_vports_rrqs(vport, NULL); /* @@ -3964,7 +3963,6 @@ lpfc_mbx_unreg_vpi(struct lpfc_vport *vport) lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, "1800 Could not issue unreg_vpi\n"); mempool_free(mbox, phba->mbox_mem_pool); - vport->unreg_vpi_cmpl = VPORT_ERROR; return rc; } return 0; diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index da9a1f72d938..d694d0cff5a5 100644 --- a/drivers/scsi/lpfc/lpfc_vport.c +++ b/drivers/scsi/lpfc/lpfc_vport.c @@ -485,23 +485,68 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) return rc; } +static int +lpfc_send_npiv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) +{ + int rc; + struct lpfc_hba *phba = vport->phba; + + DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waitq); + + spin_lock_irq(&ndlp->lock); + if (!(ndlp->save_flags & NLP_WAIT_FOR_LOGO) && + !ndlp->logo_waitq) { + ndlp->logo_waitq = &waitq; + ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; + ndlp->nlp_flag |= NLP_ISSUE_LOGO; + ndlp->save_flags |= NLP_WAIT_FOR_LOGO; + } + spin_unlock_irq(&ndlp->lock); + rc = lpfc_issue_els_npiv_logo(vport, ndlp); + if (!rc) { + wait_event_timeout(waitq, + (!(ndlp->save_flags & NLP_WAIT_FOR_LOGO)), + msecs_to_jiffies(phba->fc_ratov * 2000)); + + if (!(ndlp->save_flags & NLP_WAIT_FOR_LOGO)) + goto logo_cmpl; + /* LOGO wait failed. Correct status. */ + rc = -EINTR; + } else { + rc = -EIO; + } + + /* Error - clean up node flags. */ + spin_lock_irq(&ndlp->lock); + ndlp->nlp_flag &= ~NLP_ISSUE_LOGO; + ndlp->save_flags &= ~NLP_WAIT_FOR_LOGO; + spin_unlock_irq(&ndlp->lock); + + logo_cmpl: + lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT, + "1824 Issue LOGO completes with status %d\n", + rc); + spin_lock_irq(&ndlp->lock); + ndlp->logo_waitq = NULL; + spin_unlock_irq(&ndlp->lock); + return rc; +} + static int disable_vport(struct fc_vport *fc_vport) { struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; struct lpfc_hba *phba = vport->phba; struct lpfc_nodelist *ndlp = NULL, *next_ndlp = NULL; - long timeout; struct Scsi_Host *shost = lpfc_shost_from_vport(vport); + /* Can't disable during an outstanding delete. */ + if (vport->load_flag & FC_UNLOADING) + return 0; + ndlp = lpfc_findnode_did(vport, Fabric_DID); - if (ndlp && phba->link_state >= LPFC_LINK_UP) { - vport->unreg_vpi_cmpl = VPORT_INVAL; - timeout = msecs_to_jiffies(phba->fc_ratov * 2000); - if (!lpfc_issue_els_npiv_logo(vport, ndlp)) - while (vport->unreg_vpi_cmpl == VPORT_INVAL && timeout) - timeout = schedule_timeout(timeout); - } + if (ndlp && phba->link_state >= LPFC_LINK_UP) + (void)lpfc_send_npiv_logo(vport, ndlp); lpfc_sli_host_down(vport); @@ -600,7 +645,7 @@ lpfc_vport_delete(struct fc_vport *fc_vport) struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; - long timeout; + int rc; if (vport->port_type == LPFC_PHYSICAL_PORT) { lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, @@ -665,15 +710,14 @@ lpfc_vport_delete(struct fc_vport *fc_vport) phba->fc_topology != LPFC_TOPOLOGY_LOOP) { if (vport->cfg_enable_da_id) { /* Send DA_ID and wait for a completion. */ - timeout = msecs_to_jiffies(phba->fc_ratov * 2000); - if (!lpfc_ns_cmd(vport, SLI_CTNS_DA_ID, 0, 0)) - while (vport->ct_flags && timeout) - timeout = schedule_timeout(timeout); - else + rc = lpfc_ns_cmd(vport, SLI_CTNS_DA_ID, 0, 0); + if (rc) { lpfc_printf_log(vport->phba, KERN_WARNING, LOG_VPORT, "1829 CT command failed to " - "delete objects on fabric\n"); + "delete objects on fabric, " + "rc %d\n", rc); + } } /* @@ -688,11 +732,10 @@ lpfc_vport_delete(struct fc_vport *fc_vport) ndlp = lpfc_findnode_did(vport, Fabric_DID); if (!ndlp) goto skip_logo; - vport->unreg_vpi_cmpl = VPORT_INVAL; - timeout = msecs_to_jiffies(phba->fc_ratov * 2000); - if (!lpfc_issue_els_npiv_logo(vport, ndlp)) - while (vport->unreg_vpi_cmpl == VPORT_INVAL && timeout) - timeout = schedule_timeout(timeout); + + rc = lpfc_send_npiv_logo(vport, ndlp); + if (rc) + goto skip_logo; } if (!(phba->pport->load_flag & FC_UNLOADING)) From patchwork Tue Feb 8 14:20:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Lane X-Patchwork-Id: 1589879 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=JziemJs/; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JtQCV6j0Fz9sFs for ; Wed, 9 Feb 2022 01:20:38 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nHRM4-0000Vq-FC; Tue, 08 Feb 2022 14:20:28 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nHRLw-0000RO-TF for kernel-team@lists.ubuntu.com; Tue, 08 Feb 2022 14:20:20 +0000 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 953AD4003D for ; Tue, 8 Feb 2022 14:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1644330020; bh=5Ud2sPDvDraruZaMBQRwHxe5TtCnnr8AiP5b2Q/IQiI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JziemJs/fdubBZVkYu5MCWB/oCuSXB8D2bJ1j21g/51DrhLskUeXAHBYTM0Ix0ksj c8KFmm6swBZuK4DU+U0v+qDyvQVTqrQdzsSOhTPM64sifly//+6644oxNjqSuKhVYI SqnVybibx2P7Ok9vbQFVd6Ao8577UWHs+2AlRZJtX6vYNNO1R3I6xcfohq2hnotSXw 09xvgWNr8aNt+58B3VJfqf1zg2oBovOUULgu+sA9msBJ1wTA4vspGOifilQ4b6PDfM jqOAqaJfV6cHWt0t3NddCKV/sgquSOq64wk7wp58hsZo5uHHv7xAotuAxBow6fetM3 sI8rtXG1UNueA== Received: by mail-qv1-f69.google.com with SMTP id iv13-20020ad45ced000000b004248c87cc4cso11061721qvb.10 for ; Tue, 08 Feb 2022 06:20:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5Ud2sPDvDraruZaMBQRwHxe5TtCnnr8AiP5b2Q/IQiI=; b=yS/AjngYPQDSWZ2Sng5tfCNFhZPqj4fo+iCscbjb2XkUlaXKfCcvyAGTVlx/03VySx 6NlR9WaIpgwJFRA3V/X4a6DkwCKpMkEWZt8XwB3f4PHFri6SxMmWh5vQWEFPh3Gpq9eG joz1t6d0QyESVJdW/YLcWPKl5vKm/6mKNXPZ7WvywM+YD6HndeRRop38Jvw25aS2H7+7 PDYMKbSMaHcM0hU6eau3himV9cZSOqzvV3vNPYbFyhi1UsHXWCpQxZE2GtGmNDOhUORg 1b/UXfxt96xSqYoQku0mnlDdJLRNpVkO9shoY74SAxzARPPZJFbpXZ0J++EdvWkWWce+ faaw== X-Gm-Message-State: AOAM533aLON0iuqNkSNnqlKC21cy+6C0jbtNJK33CswN1fMhr2gLlpAY 32HIsH+LPSFH7xmaOYmtb9TvYVRs0F018HjEuTHSpN3U40Y0YQfOiR0XHoD+YWYxcGyNx57XkKD 7f0DFFBKkwUn4OxKXa2WZcHNv67pDJYU4FKW7iTZvnw== X-Received: by 2002:a05:620a:1a99:: with SMTP id bl25mr2724993qkb.137.1644330019329; Tue, 08 Feb 2022 06:20:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJymnTrYx7nvAKJwfae+0aANPFD8B4oXw/JdVuSIKcdDvAGQ3Hxl5EW6qszu1zFKCbMKoKHDXg== X-Received: by 2002:a05:620a:1a99:: with SMTP id bl25mr2724961qkb.137.1644330018890; Tue, 08 Feb 2022 06:20:18 -0800 (PST) Received: from localhost.localdomain ([71.217.161.186]) by smtp.gmail.com with ESMTPSA id b16sm6712977qtk.84.2022.02.08.06.20.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:20:18 -0800 (PST) From: Jeff Lane To: kernel-team@lists.ubuntu.com Subject: [J][PATCH 3/6] scsi: lpfc: Adjust CMF total bytes and rxmonitor Date: Tue, 8 Feb 2022 09:20:11 -0500 Message-Id: <20220208142014.3782820-4-jeffrey.lane@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208142014.3782820-1-jeffrey.lane@canonical.com> References: <20220208142014.3782820-1-jeffrey.lane@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: James Smart BugLink: https://bugs.launchpad.net/bugs/1956982 Calculate any extra bytes needed to account for timer accuracy. If we are less than LPFC_CMF_INTERVAL, then calculate the adjustment needed for total to reflect a full LPFC_CMF_INTERVAL. Add additional info to rxmonitor, and adjust some log formatting. Link: https://lore.kernel.org/r/20211204002644.116455-7-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen (cherry picked from commit a6269f837045acb02904f31f05acde847ec8f8a7) Signed-off-by: Jeff Lane --- drivers/scsi/lpfc/lpfc.h | 1 + drivers/scsi/lpfc/lpfc_debugfs.c | 14 ++++++++------ drivers/scsi/lpfc/lpfc_debugfs.h | 2 +- drivers/scsi/lpfc/lpfc_init.c | 20 ++++++++++++-------- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index da5a69a2b78f..4c7bc0a5fcf7 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1601,6 +1601,7 @@ struct lpfc_hba { #define LPFC_MAX_RXMONITOR_ENTRY 800 #define LPFC_MAX_RXMONITOR_DUMP 32 struct rxtable_entry { + uint64_t cmf_bytes; /* Total no of read bytes for CMF_SYNC_WQE */ uint64_t total_bytes; /* Total no of read bytes requested */ uint64_t rcv_bytes; /* Total no of read bytes completed */ uint64_t avg_io_size; diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index 08b2e85dcd7d..a11a038e2a85 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -5561,22 +5561,24 @@ lpfc_rx_monitor_read(struct file *file, char __user *buf, size_t nbytes, start = tail; len += scnprintf(buffer + len, MAX_DEBUGFS_RX_TABLE_SIZE - len, - " MaxBPI\t Total Data Cmd Total Data Cmpl " - " Latency(us) Avg IO Size\tMax IO Size IO cnt " - "Info BWutil(ms)\n"); + " MaxBPI Tot_Data_CMF Tot_Data_Cmd " + "Tot_Data_Cmpl Lat(us) Avg_IO Max_IO " + "Bsy IO_cnt Info BWutil(ms)\n"); get_table: for (i = start; i < last; i++) { entry = &phba->rxtable[i]; len += scnprintf(buffer + len, MAX_DEBUGFS_RX_TABLE_SIZE - len, - "%3d:%12lld %12lld\t%12lld\t" - "%8lldus\t%8lld\t%10lld " - "%8d %2d %2d(%2d)\n", + "%3d:%12lld %12lld %12lld %12lld " + "%7lldus %8lld %7lld " + "%2d %4d %2d %2d(%2d)\n", i, entry->max_bytes_per_interval, + entry->cmf_bytes, entry->total_bytes, entry->rcv_bytes, entry->avg_io_latency, entry->avg_io_size, entry->max_read_cnt, + entry->cmf_busy, entry->io_cnt, entry->cmf_info, entry->timer_utilization, diff --git a/drivers/scsi/lpfc/lpfc_debugfs.h b/drivers/scsi/lpfc/lpfc_debugfs.h index a5bf71b34972..6dd361c1fd31 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.h +++ b/drivers/scsi/lpfc/lpfc_debugfs.h @@ -282,7 +282,7 @@ struct lpfc_idiag { void *ptr_private; }; -#define MAX_DEBUGFS_RX_TABLE_SIZE (100 * LPFC_MAX_RXMONITOR_ENTRY) +#define MAX_DEBUGFS_RX_TABLE_SIZE (128 * LPFC_MAX_RXMONITOR_ENTRY) struct lpfc_rx_monitor_debug { char *i_private; char *buffer; diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index e782e5b6aa0b..bbcf5d446cb1 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -5926,7 +5926,7 @@ lpfc_cmf_timer(struct hrtimer *timer) uint32_t io_cnt; uint32_t head, tail; uint32_t busy, max_read; - uint64_t total, rcv, lat, mbpi, extra; + uint64_t total, rcv, lat, mbpi, extra, cnt; int timer_interval = LPFC_CMF_INTERVAL; uint32_t ms; struct lpfc_cgn_stat *cgs; @@ -5997,20 +5997,23 @@ lpfc_cmf_timer(struct hrtimer *timer) /* Calculate any extra bytes needed to account for the * timer accuracy. If we are less than LPFC_CMF_INTERVAL - * add an extra 3% slop factor, equal to LPFC_CMF_INTERVAL - * add an extra 2%. The goal is to equalize total with a - * time > LPFC_CMF_INTERVAL or <= LPFC_CMF_INTERVAL + 1 + * calculate the adjustment needed for total to reflect + * a full LPFC_CMF_INTERVAL. */ - if (ms == LPFC_CMF_INTERVAL) - extra = div_u64(total, 50); - else if (ms < LPFC_CMF_INTERVAL) - extra = div_u64(total, 33); + if (ms && ms < LPFC_CMF_INTERVAL) { + cnt = div_u64(total, ms); /* bytes per ms */ + cnt *= LPFC_CMF_INTERVAL; /* what total should be */ + if (cnt > mbpi) + cnt = mbpi; + extra = cnt - total; + } lpfc_issue_cmf_sync_wqe(phba, LPFC_CMF_INTERVAL, total + extra); } else { /* For Monitor mode or link down we want mbpi * to be the full link speed */ mbpi = phba->cmf_link_byte_count; + extra = 0; } phba->cmf_timer_cnt++; @@ -6041,6 +6044,7 @@ lpfc_cmf_timer(struct hrtimer *timer) LPFC_RXMONITOR_TABLE_IN_USE); entry = &phba->rxtable[head]; entry->total_bytes = total; + entry->cmf_bytes = total + extra; entry->rcv_bytes = rcv; entry->cmf_busy = busy; entry->cmf_info = phba->cmf_active_info; From patchwork Tue Feb 8 14:20:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Lane X-Patchwork-Id: 1589874 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=TGHuDnON; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JtQCS3Nv4z9sFn for ; Wed, 9 Feb 2022 01:20:35 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nHRM1-0000SX-4V; Tue, 08 Feb 2022 14:20:25 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nHRLx-0000RV-7x for kernel-team@lists.ubuntu.com; Tue, 08 Feb 2022 14:20:21 +0000 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 1E6753F17B for ; Tue, 8 Feb 2022 14:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1644330021; bh=fA+j9lMZWHbU67HU51troBOg1a8DA5FFRF6C4d5K1eY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TGHuDnON7f3SvASJfv1RyKD8dUhw+CNEmROWXpWBpPMJDRJvcXd9ob3vZz01GeCnK R6EDQbRZ8Q2YprWf7qwpnD3xzfG+C5agyL7mTf5QFdNw87fxYYwzvG56ZO+IZlCfW/ J1lmgNDoQNsN4G3dJOExzEdu6BFS/BMGUPLsFVWehS7m4/ilaH7R3MbxJL5obsstZw 9hvmveyr0xyVGJXYYm48IvGc9oA24clTLKK+5yHEDQSdFRy4PJKlFoWvGzxPGOhZ5a ZANNeBVIiJAME/Z46SwSc9Rx5P5orVIMQVuvP8OmmqHi58/Aoswp/IlWswjflaNpUQ Q+HBAcUFytiUQ== Received: by mail-qv1-f71.google.com with SMTP id 8-20020a0562140d0800b00422bb534680so11042332qvh.7 for ; Tue, 08 Feb 2022 06:20:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fA+j9lMZWHbU67HU51troBOg1a8DA5FFRF6C4d5K1eY=; b=C36FPiqUP4aqdT0QLtPJz9Lj7gYp33m2jRPZt5FpFpkJsKi6HS1OLrDI3YBGeguHnu gJ2O1q7KqGvgIPrpCHPnYo1NNhGo0oZMHAcxFbXoWmjXHFWvJnuZncVN8z5rCBx467L0 Uw7iaNk4reAbNcP2Gfz90xxLTD/cGir1u7k7l6PRWwZqa91XyhC8WDtB3toHO7DQsJjU JcLWJDDNApXoE4mSIP8EzKPriF3Rz7eXE7YxkMsotPPPB+X6iNlTM4tqdb063aBE+ZBy q2cEDoJr9A4MVf1qkBylVDTPQ+m1SR82wlwYpxmKR7H0eZdvzd52EIcMMNpGPygfwQgB HHBQ== X-Gm-Message-State: AOAM531cSurMPbbVPxbFgAGYvZNLrcW7CGgcjmMX2RLjy9C8z1RDxPU2 uGxx278BFWDTk6yFmH0933N0BQuwpvvVYSNWmAHxar3s02atx6ZADdNEqZP9RPaOkc5svHhRSq+ zZKUCEUmzjHDitQSG32J/XMj2jZ7K1XKXabthKT8SrA== X-Received: by 2002:a05:6214:4011:: with SMTP id kd17mr3119262qvb.45.1644330019994; Tue, 08 Feb 2022 06:20:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWtlNhSQSLdx0SFLlqTvZBjqZXXxE1pKKKN3VJi5Hc70xpC3hA4R0yExSx1MoYtOZ10Xz4JA== X-Received: by 2002:a05:6214:4011:: with SMTP id kd17mr3119231qvb.45.1644330019589; Tue, 08 Feb 2022 06:20:19 -0800 (PST) Received: from localhost.localdomain ([71.217.161.186]) by smtp.gmail.com with ESMTPSA id b16sm6712977qtk.84.2022.02.08.06.20.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:20:19 -0800 (PST) From: Jeff Lane To: kernel-team@lists.ubuntu.com Subject: [J][PATCH 4/6] scsi: lpfc: Cap CMF read bytes to MBPI Date: Tue, 8 Feb 2022 09:20:12 -0500 Message-Id: <20220208142014.3782820-5-jeffrey.lane@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208142014.3782820-1-jeffrey.lane@canonical.com> References: <20220208142014.3782820-1-jeffrey.lane@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: James Smart BugLink: https://bugs.launchpad.net/bugs/1956982 Ensure read bytes data does not go over MBPI for CMF timer intervals that are purposely shortened. Link: https://lore.kernel.org/r/20211204002644.116455-8-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen (cherry picked from commit 05116ef9c4b444f7fdbb56f9e13c2ec941726639) Signed-off-by: Jeff Lane --- drivers/scsi/lpfc/lpfc.h | 2 +- drivers/scsi/lpfc/lpfc_init.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 4c7bc0a5fcf7..f1c87a2d0af2 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1027,7 +1027,7 @@ struct lpfc_hba { */ #define HBA_PCI_ERR 0x80000 /* The PCI slot is offline */ #define HBA_FLOGI_ISSUED 0x100000 /* FLOGI was issued */ -#define HBA_CGN_RSVD1 0x200000 /* Reserved CGN flag */ +#define HBA_SHORT_CMF 0x200000 /* shorter CMF timer routine */ #define HBA_CGN_DAY_WRAP 0x400000 /* HBA Congestion info day wraps */ #define HBA_DEFER_FLOGI 0x800000 /* Defer FLOGI till read_sparm cmpl */ #define HBA_SETUP 0x1000000 /* Signifies HBA setup is completed */ diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index bbcf5d446cb1..171a3783ced2 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -6003,8 +6003,13 @@ lpfc_cmf_timer(struct hrtimer *timer) if (ms && ms < LPFC_CMF_INTERVAL) { cnt = div_u64(total, ms); /* bytes per ms */ cnt *= LPFC_CMF_INTERVAL; /* what total should be */ - if (cnt > mbpi) + + /* If the timeout is scheduled to be shorter, + * this value may skew the data, so cap it at mbpi. + */ + if ((phba->hba_flag & HBA_SHORT_CMF) && cnt > mbpi) cnt = mbpi; + extra = cnt - total; } lpfc_issue_cmf_sync_wqe(phba, LPFC_CMF_INTERVAL, total + extra); @@ -6087,6 +6092,8 @@ lpfc_cmf_timer(struct hrtimer *timer) /* Each minute save Fabric and Driver congestion information */ lpfc_cgn_save_evt_cnt(phba); + phba->hba_flag &= ~HBA_SHORT_CMF; + /* Since we need to call lpfc_cgn_save_evt_cnt every minute, on the * minute, adjust our next timer interval, if needed, to ensure a * 1 minute granularity when we get the next timer interrupt. @@ -6097,6 +6104,8 @@ lpfc_cmf_timer(struct hrtimer *timer) jiffies); if (timer_interval <= 0) timer_interval = LPFC_CMF_INTERVAL; + else + phba->hba_flag |= HBA_SHORT_CMF; /* If we adjust timer_interval, max_bytes_per_interval * needs to be adjusted as well. From patchwork Tue Feb 8 14:20:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Lane X-Patchwork-Id: 1589876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=NEdfUFuf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JtQCS6W8kz9sFt for ; Wed, 9 Feb 2022 01:20:36 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nHRM1-0000Si-CQ; Tue, 08 Feb 2022 14:20:25 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nHRLy-0000Rc-5X for kernel-team@lists.ubuntu.com; Tue, 08 Feb 2022 14:20:22 +0000 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id F16EB3F19C for ; Tue, 8 Feb 2022 14:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1644330021; bh=0hl8i7MbozyKJOX+MmjEp1FANC9t5uPvMfvF8cjI0YU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NEdfUFuf1bpASlerkrVbHSsnwSJPyyH9h11EU16tsZvMK4tFzjvG6L4EcB1rKILtg qQ6hxg/mzB7aCuoEzMFTbRMBo5/Yimk4Jp73Xo16c+RvoYTNEOve2tm3t/y6hIGBHn 3FziMsKb6sLEj7JknSMXulZomlJZeRnfIW/k0hc2oV6mrMDKOngtcVacNxuysev4k9 ppQC8XsAkVmgQhDL/yCe1YBrJLnRPEbgj+sighEC+pnJ0DtZnlmMAHyfZDmFBuFwlZ c21w3e5LM53U0y9k9BDTXnikaLrM5sOw+O1xQr6cyD2jogQSjIqtSNlxEpphK6Iz0D xb2ps1X27IKVw== Received: by mail-qv1-f71.google.com with SMTP id w14-20020a0cfc4e000000b0042c1ac91249so2253008qvp.4 for ; Tue, 08 Feb 2022 06:20:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0hl8i7MbozyKJOX+MmjEp1FANC9t5uPvMfvF8cjI0YU=; b=23AQ5ergMEScPuaJu8JZ39ReknfSVb/efm/9HNTTTjhbv8d75mIYB5zNGNGrg487gU E1HGnxumSUW7Mq4sisaE4MOL2+ZFoooyvHvFc9VX8XWXoSp+rKLgK4z8G+qWtacSbcyh /9h5z40EIn+jMANuE/rFvJUje+DmfapkentFYrS8Xo+wRYAe0cdC5kc+SIfoMgmakm9E b4QjEfh4XgH7hix/SBnH/QUK/Dsa68Wb07jC2RfuDmvwaj+2LOg1lcf/Gg+zf1HuTZw5 CNq1RGYXaXBLx/Gk0I8Me9ezq30oyfpIyat2Ux5+cA8kn7IkgeQX+jNyRH2pjCou2ObJ moLQ== X-Gm-Message-State: AOAM530UA4tEXOLlwXGR426o8YT9elNvvy8alav+KnkTtfzpkqJQ7cpl hnPfbNyV+QGhT9YdRjfM7K5AraWrrjClo9jReaoA2zlZKQIALkg8qisQemiVf7vfNo44I/4C6wF LArcQaSPG4hjl5MDemu2VdGPSGWtXidkvWwkaMdyI+g== X-Received: by 2002:ad4:5de4:: with SMTP id jn4mr3173763qvb.23.1644330020771; Tue, 08 Feb 2022 06:20:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRF2Hwp4sPiALOov5qouwyJXqnKOayqhmyVC4LOj3x+XyZa4wHvCHOAsq3qebNcTr6El2cmQ== X-Received: by 2002:ad4:5de4:: with SMTP id jn4mr3173741qvb.23.1644330020382; Tue, 08 Feb 2022 06:20:20 -0800 (PST) Received: from localhost.localdomain ([71.217.161.186]) by smtp.gmail.com with ESMTPSA id b16sm6712977qtk.84.2022.02.08.06.20.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:20:20 -0800 (PST) From: Jeff Lane To: kernel-team@lists.ubuntu.com Subject: [J][PATCH 5/6] scsi: lpfc: Add additional debugfs support for CMF Date: Tue, 8 Feb 2022 09:20:13 -0500 Message-Id: <20220208142014.3782820-6-jeffrey.lane@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208142014.3782820-1-jeffrey.lane@canonical.com> References: <20220208142014.3782820-1-jeffrey.lane@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: James Smart BugLink: https://bugs.launchpad.net/bugs/1956982 Dump raw CMF parameter information in debugfs cgn_buffer. Link: https://lore.kernel.org/r/20211204002644.116455-9-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen (cherry picked from commit 6014a2468f0e49194f612b1f09f99eacee0a409a) Signed-off-by: Jeff Lane --- drivers/scsi/lpfc/lpfc_debugfs.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index a11a038e2a85..30fac2f6fb06 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -5484,7 +5484,7 @@ lpfc_cgn_buffer_read(struct file *file, char __user *buf, size_t nbytes, if (len > (LPFC_CGN_BUF_SIZE - LPFC_DEBUG_OUT_LINE_SZ)) { len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, "Truncated . . .\n"); - break; + goto out; } len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, "%03x: %08x %08x %08x %08x " @@ -5495,6 +5495,17 @@ lpfc_cgn_buffer_read(struct file *file, char __user *buf, size_t nbytes, cnt += 32; ptr += 8; } + if (len > (LPFC_CGN_BUF_SIZE - LPFC_DEBUG_OUT_LINE_SZ)) { + len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, + "Truncated . . .\n"); + goto out; + } + len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, + "Parameter Data\n"); + ptr = (uint32_t *)&phba->cgn_p; + len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, + "%08x %08x %08x %08x\n", + *ptr, *(ptr + 1), *(ptr + 2), *(ptr + 3)); out: return simple_read_from_buffer(buf, nbytes, ppos, buffer, len); } From patchwork Tue Feb 8 14:20:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Lane X-Patchwork-Id: 1589880 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=LPQpqqDX; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JtQCW3fxXz9sFt for ; Wed, 9 Feb 2022 01:20:39 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nHRM4-0000WX-O7; Tue, 08 Feb 2022 14:20:28 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nHRLz-0000Rj-S4 for kernel-team@lists.ubuntu.com; Tue, 08 Feb 2022 14:20:23 +0000 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id CA3484003D for ; Tue, 8 Feb 2022 14:20:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1644330022; bh=Bovri2P1p3dQuxomkNSyJu5fWICGo+dQVrrJNFzrySk=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LPQpqqDX8VTY+PfSCLIoBVyJxUw34KiL7en8MKix1VakVXQKAyLMHQdKRRLvdT4cr l5Fz8P6IKx4hNYqT9EpohOMgVQ49q4e/nzJ1f0lr3KDtJ8vsE/6onknZ8O2wAYNVTb rk+Zg07Kuji5k6nmn5ZVg15JXVP/gzByVMmolnsdBVmafjUEOTJ2ViDKOfXHTw9l6+ 61DmHn3/ptOty5kFHEE0AwvEu0KA1HqNC2g4wtv7VwLtJ2j1IznoykwgrJvxIdHxr/ EMfb2G1MNoFSMFrQhVQwkF0ZAvDjIZRX3z7W3TyIF2u7t4MU+y0Mt3o2lls6WUixTJ 2Rrvi/DnoRHgA== Received: by mail-qk1-f198.google.com with SMTP id g3-20020a05620a108300b0047e16fc0d6cso11036854qkk.3 for ; Tue, 08 Feb 2022 06:20:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bovri2P1p3dQuxomkNSyJu5fWICGo+dQVrrJNFzrySk=; b=dINU3Y9Fyg1fsKltpQNjOaNhNrFQusg1kayHpcVev7L73XmMCzMloIKvj+PKSEWCzt jBm1P9nbhiktCA8OHNgdhu0ql8udt+rGYmccoePUzgHoch3UinIVkZ4hHRyZRDcDY3lT B1b/9AYHp9LN3DT9Zh64iJXIQqzJDkvky0LZyTfD9vRS4wPyDmyb8vBGNTyOJUT4vJdR UYhRgvKhx08ZKEvcBSk9Nj28RMXCFmzV6t3NaqgNZ4FhIbwel9u8T/rGSyrv7eP+fDgl UsaY1+P5MIZILzr1TLi3MPuBSzh7RIqUJHv9lzz83dw4OHQmLOMo4oLcbZmKcoYLMrX+ phrA== X-Gm-Message-State: AOAM533ZqrS/nhY9vZDQyNSGGVE2IbdtMURU0JbaeXaZnk9n36QaTs9u 6uwSZxAx2vyr67wl8aZCneVrgkYTY89V3pT4XNMzAWG8CxCZdlifZb6QEkfAjCvCBrl9StLSOqE hMY1ya/jIgQkVdSkbMqXf/WDCeZ2/OKGNIhhWuu59UA== X-Received: by 2002:a05:620a:4614:: with SMTP id br20mr2670682qkb.676.1644330021655; Tue, 08 Feb 2022 06:20:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLez9MsZzuwaVbg/e/hovRLYpixOWep2ukTwZOhRppMlD6PT+17X5xLpGkZRYeRgQ4cjAqlA== X-Received: by 2002:a05:620a:4614:: with SMTP id br20mr2670663qkb.676.1644330021252; Tue, 08 Feb 2022 06:20:21 -0800 (PST) Received: from localhost.localdomain ([71.217.161.186]) by smtp.gmail.com with ESMTPSA id b16sm6712977qtk.84.2022.02.08.06.20.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:20:20 -0800 (PST) From: Jeff Lane To: kernel-team@lists.ubuntu.com Subject: [J][PATCH 6/6] scsi: lpfc: Update lpfc version to 14.0.0.4 Date: Tue, 8 Feb 2022 09:20:14 -0500 Message-Id: <20220208142014.3782820-7-jeffrey.lane@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208142014.3782820-1-jeffrey.lane@canonical.com> References: <20220208142014.3782820-1-jeffrey.lane@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: James Smart BugLink: https://bugs.launchpad.net/bugs/1956982 Update lpfc version to 14.0.0.4. Link: https://lore.kernel.org/r/20211204002644.116455-10-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen (cherry picked from commit 4437503bfbec2f02b41b2492520fe627715889a7) Signed-off-by: Jeff Lane --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index 5a4d3b24fbce..2e9348a6897c 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h @@ -20,7 +20,7 @@ * included with this package. * *******************************************************************/ -#define LPFC_DRIVER_VERSION "14.0.0.3" +#define LPFC_DRIVER_VERSION "14.0.0.4" #define LPFC_DRIVER_NAME "lpfc" /* Used for SLI 2/3 */