From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MIME_NO_TEXT,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCA83C2D0E4 for ; Sun, 15 Nov 2020 19:27:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8499222384 for ; Sun, 15 Nov 2020 19:27:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="FypTPky/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727857AbgKOT0z (ORCPT ); Sun, 15 Nov 2020 14:26:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727781AbgKOT0y (ORCPT ); Sun, 15 Nov 2020 14:26:54 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 329F0C0613CF for ; Sun, 15 Nov 2020 11:26:54 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id 131so806632pfb.9 for ; Sun, 15 Nov 2020 11:26:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=LbEzhfMqerOPCE9MWjzXOnHWBdhnf16rmleBMKP8jdc=; b=FypTPky/9sldeDHBiTEJvXuLlwyDSbaJLF6NDZTnl+HiJCLEYme5cckYFqqICfl4c4 oD/B4WA/eyHthD8LLZ3YtMgRYCq2hIGWqzfA11CygtQ3XL1Kva/P6tFtSqxxkEpUwP0K uXtMyGcKo8M4TYsodbPW6Ky6tvgOGUimNKB6I= 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:mime-version; bh=LbEzhfMqerOPCE9MWjzXOnHWBdhnf16rmleBMKP8jdc=; b=Q5+cJ47Wua3EYubfJOrsdBxev7fchQWGPxnqG3Qt71yISvjiOWqstJB5uif8dmx+Bl 7w5zcR1aWwLcgFYDBLm7oJikU3nCiB1XGeOQSM1LA8AI/NUEAMoxDBicao8BpEc0G1h6 +YzCZY9+8ken5lItsIMPGnqme4Fwc+fZ5jrTGUwT084D0y7zYsUMYr2LbsMWt5pscxq5 fsydTAKOh/gDSD3O9GcuuT6x3jeOapiG1QrF3Ydlk5HyADAbU6GYw2iVIT59uAh5dLvJ 8+SaRFR8FR/WiZDe9q+8Bq1wWwV9/I2hEDDpIIyyJqt1QQaX7xgTBv4O/S1C8WHlK712 c3CA== X-Gm-Message-State: AOAM532E8ZaGrtsBMhU6v8RdHUzQCkdlyhtD92dbTzh2ITplLe9nn9qF ryJ+SdqOY6G0STM11vDkgYxc+AL35TZGm9/2PQEh9dm16Jf4V/G6XYkNrF76Ev9I3/dAoZ2jp0D fNyzQDcsb+X/remPcGJmag+cdXLhrlLhB2LhQ4alnQmEZQ3IA556S1htIX4rHlpujQWBCDMAkDQ 3vaVc= X-Google-Smtp-Source: ABdhPJwyHDqucTmc+UPue6crEsCcACbG7oveCwCT8Lmlx9Whda+foYFa/RGAxgbfWi+BG5EJ1rKALw== X-Received: by 2002:a17:90a:5c82:: with SMTP id r2mr12186078pji.69.1605468412993; Sun, 15 Nov 2020 11:26:52 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id v126sm15864604pfb.137.2020.11.15.11.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2020 11:26:51 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart Subject: [PATCH 00/17] lpfc: Update lpfc to revision 12.8.0.6 Date: Sun, 15 Nov 2020 11:26:29 -0800 Message-Id: <20201115192646.12977-1-james.smart@broadcom.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000007d441f05b42a3eed" Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org --0000000000007d441f05b42a3eed Content-Transfer-Encoding: 8bit Update lpfc to revision 12.8.0.6 This patch set contains several sets of recoding and refactoring. A close look was taken at the driver to identify what was causing continual small state machine errors as well other repeatitive issues. Code review showed several things and this is the first set of changes to address the deficiencies. This set of changes addresses the following items: Remote Port (node/ndlp) handling in the discovery engine: It was rather clear that the implementation of refcounting on the remote port node was improper. A refcount going to zero didn't simply release the node. Instead other logic kicked into play. This then caused other code to be placed within the discovery engine to for node removal, ... if it was actually removed. What happened in many cases was the node structure continued to exist beyond the existence of the remote port. It was stored in a node list that could then be matched by re-discovery events. And it also caused multiple structures to exist on the node list for the same device. So this area has been significantly reworked to go back to a standard ref counting scheme, which of course meant that the base model for when and how to take references had to be re-addressed in the different code flows. And of course, once one thing starts working right, new issues were seen. This brought out inconsistencies on when the node is "freed" around transport devloss callbacks which led to stale pointer accesses which had to be addressed. Another example was NPIV, where it brought out a different handling for nodes on an NPIV vport vs the same nodes on a standard physical port. So this was corrected as well. While working on the above, it was rather clear that global host locks were taken for node-specific structure changes and the locking was too coarse. Discovery code was reworked to support a node-level lock. Native SLI-4 WQE use: The other area that was rather ugly was sli-4 handling. Discovery and SCSI io paths were implemented as iocb's, which is a SLI-3 construct. The code then, when on SLI-4 hardware, converted to SLI-4 WQEs to then talk to the hardware. However, the nvme path, which is only supported on SLI-4, was only implemnted with WQEs. What it meant was: there were very subtle bugs creeping in as SLI-4 data structures didn't fully overlay on the SLI-3 structures; there was a lot of duplication of code in different areas; and with the duplication came differences and confusion. This patch set reorganizes the IO paths, which includes abort paths, into a formal division between SLI-3 and SLI-4. The basic style is a common routine is called by a code path, which identifies the hw type, and then vectors into SLI-type specific routines which deal specifically with iocbs or WQEs. With different command types also comes different completion handlers. Although these changes look like a lot of change it is mostly a large refactoring. Old common layers that performed iocb-specific work was moved to SLI-3-specific routines, and routines were created for SLI-4. For SLI-4, a lot of code came from the nvme routines. The end result is the common routines, with SLI-4 being natively supported for ELS and SCSI & NVME initiator io paths. The patches were cut against Martin's 5.11/scsi-queue tree James Smart (17): lpfc: Rework remote port ref counting and node freeing lpfc: Rework locations of ndlp reference taking lpfc: Fix removal of scsi transport device get and put on dev structure lpfc: Fix refcounting around scsi and nvme transport apis lpfc: Rework remote port lock handling lpfc: Remove ndlp when a PLOGI/ADISC/PRLI/REG_RPI ultimately fails lpfc: Unsolicited ELS leaves node in incorrect state while dropping it lpfc: Fix NPIV discovery and Fabric Node detection lpfc: Fix NPIV Fabric Node reference counting lpfc: Refactor wqe structure definitions for common use lpfc: Enable common wqe_template support for both scsi and nvme lpfc: Enable common send_io interface for SCSI and NVME lpfc: convert scsi path to use common io submission path lpfc: convert scsi io completions to sli-3 and sli-4 handlers lpfc: Convert abort handling to sli-3 and sli-4 handlers lpfc: Update lpfc version to 12.8.0.6 lpfc: Update changed file copyrights for 2020 drivers/scsi/lpfc/lpfc.h | 9 +- drivers/scsi/lpfc/lpfc_attr.c | 19 +- drivers/scsi/lpfc/lpfc_bsg.c | 79 +- drivers/scsi/lpfc/lpfc_crtn.h | 18 +- drivers/scsi/lpfc/lpfc_ct.c | 81 +- drivers/scsi/lpfc/lpfc_debugfs.c | 8 +- drivers/scsi/lpfc/lpfc_disc.h | 45 +- drivers/scsi/lpfc/lpfc_els.c | 1285 +++++++++++++++------------- drivers/scsi/lpfc/lpfc_hbadisc.c | 754 +++++----------- drivers/scsi/lpfc/lpfc_hw4.h | 12 +- drivers/scsi/lpfc/lpfc_init.c | 121 ++- drivers/scsi/lpfc/lpfc_nportdisc.c | 215 ++--- drivers/scsi/lpfc/lpfc_nvme.c | 326 ++----- drivers/scsi/lpfc/lpfc_nvme.h | 4 +- drivers/scsi/lpfc/lpfc_nvmet.c | 60 +- drivers/scsi/lpfc/lpfc_scsi.c | 1133 ++++++++++++++++++------ drivers/scsi/lpfc/lpfc_sli.c | 659 +++++++++----- drivers/scsi/lpfc/lpfc_sli.h | 7 +- drivers/scsi/lpfc/lpfc_version.h | 4 +- drivers/scsi/lpfc/lpfc_vport.c | 128 +-- 20 files changed, 2719 insertions(+), 2248 deletions(-) -- 2.26.2 --0000000000007d441f05b42a3eed Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQPwYJKoZIhvcNAQcCoIIQMDCCECwCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg2UMIIE6DCCA9CgAwIBAgIOSBtqCRO9gCTKXSLwFPMwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UE CxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMT Ckdsb2JhbFNpZ24wHhcNMTYwNjE1MDAwMDAwWhcNMjQwNjE1MDAwMDAwWjBdMQswCQYDVQQGEwJC RTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTEzMDEGA1UEAxMqR2xvYmFsU2lnbiBQZXJzb25h bFNpZ24gMiBDQSAtIFNIQTI1NiAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA tpZok2X9LAHsYqMNVL+Ly6RDkaKar7GD8rVtb9nw6t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