From patchwork Wed Nov 16 01:19:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 625396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 241B4C4332F for ; Wed, 16 Nov 2022 01:10:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231642AbiKPBKz (ORCPT ); Tue, 15 Nov 2022 20:10:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbiKPBKy (ORCPT ); Tue, 15 Nov 2022 20:10:54 -0500 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 066AC317F9 for ; Tue, 15 Nov 2022 17:10:54 -0800 (PST) Received: by mail-qk1-x733.google.com with SMTP id i9so10734473qki.10 for ; Tue, 15 Nov 2022 17:10:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dXQuLH03XzUYi6+WgpNrxfrW2ANmPdXWWQXUz58Src0=; b=pbVRgtdVlmQ6+ZnkkUeA+h62H1wicgMLv8OTs3EJoRp67w9M+muDcdp8mDdOKnajt+ BqG6UgRuoJnlfx9O3jvojS/9mNz9WbSxsiBWe0TMkOOt7bO+Lu9Ktqw2HF+7d09oRqGe SJqsyrgFdKdCacc3dimrWDsUiBn2u1lmu46uEwDwCEgHOcN+pzt+ns+ttFoMa4edwjjp r6aJcIUPuR8Y6BakuqgaG27pNahfFuNK1ss8RjzsMkkOP79IpVZ/zHXpswD7Wh+xVr5f 6ZGOoh1LDM+nX2XqIn9hJTZZWLclYt82H1w6JT6F32FwypHYlQDR5ulyAkBGkdfQjKM/ bY2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dXQuLH03XzUYi6+WgpNrxfrW2ANmPdXWWQXUz58Src0=; b=dY5RjGf4gc+YINU0T2L5Mnf4cnJYugujzBOodQXq1ZF2dEl9ymmY3/Xp0wxYxj054v sCUpmrEbHAtUybHX+bCOq0YjN/L5AzZ5pNk+e93Hpp2BMhKDR2F/W5FGq7dHUssztKnZ JwXW/lAoWkKk5XTTfBaUnSgPsTiyK6ZxoNv4zFyFuWVLH6L8GNCLzdlttKDHNbMxxKr3 3Cy4f98BXbfomua3dwhc/4rFIkizcXspZW19kgM8u0FUADGe+XIsUewFhY4YTiJjW6Ev 3WCZl3bxUsTQkvJ3Wrfp+NLxVm0NraANFcnJ1WTroB8XwKU8sQaSkrq5k+fldDelgDhl BVIQ== X-Gm-Message-State: ANoB5pkiw/VbQyBDC8XPMvDxXUDOBTDbuPAgwpJyhGK6VYI3SeBMTOlw sP8BIGjnC3q8t9I99WGmTi2nmzdNBYw= X-Google-Smtp-Source: AA0mqf7FbN6pScMCm957Qf2nw28A7eE+bi0vvsgprfvbIGoGGCu6wg1i3Eg2siX0HE6+mlpjoSZTjQ== X-Received: by 2002:a05:620a:1375:b0:6fa:ab2b:b78d with SMTP id d21-20020a05620a137500b006faab2bb78dmr17157557qkl.388.1668561053008; Tue, 15 Nov 2022 17:10:53 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id y12-20020ac8128c000000b00399b73d06f0sm7901966qti.38.2022.11.15.17.10.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Nov 2022 17:10:52 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, Justin Tee , Justin Tee Subject: [PATCH 1/6] lpfc: Fix WQ|CQ|EQ resource check Date: Tue, 15 Nov 2022 17:19:16 -0800 Message-Id: <20221116011921.105995-2-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221116011921.105995-1-justintee8345@gmail.com> References: <20221116011921.105995-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Adapter configurations with limited EQ resources may fail to initialize. Firmware resources are queried in lpfc_sli4_read_config(). The driver parameters cfg_irq_chann and cfg_hdw_queue are adjusted from defaults if constrained by firmware resources. The minimum resource check includes a special allocation for queues such as ELS, MBOX, NVME LS. However the additional reservation was also incorrectly applied to EQ resources. Reordered WQ|CQ|EQ resource checks to apply the special allocation adjustment to WQ and CQ resources only. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_init.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index b49c39569386..a6e32ecd4151 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -10092,17 +10092,15 @@ lpfc_sli4_read_config(struct lpfc_hba *phba) qmin = phba->sli4_hba.max_cfg_param.max_wq; if (phba->sli4_hba.max_cfg_param.max_cq < qmin) qmin = phba->sli4_hba.max_cfg_param.max_cq; - if (phba->sli4_hba.max_cfg_param.max_eq < qmin) - qmin = phba->sli4_hba.max_cfg_param.max_eq; /* - * Whats left after this can go toward NVME / FCP. - * The minus 4 accounts for ELS, NVME LS, MBOX - * plus one extra. When configured for - * NVMET, FCP io channel WQs are not created. + * Reserve 4 (ELS, NVME LS, MBOX, plus one extra) and + * the remainder can be used for NVME / FCP. */ qmin -= 4; + if (phba->sli4_hba.max_cfg_param.max_eq < qmin) + qmin = phba->sli4_hba.max_cfg_param.max_eq; - /* Check to see if there is enough for NVME */ + /* Check to see if there is enough for default cfg */ if ((phba->cfg_irq_chann > qmin) || (phba->cfg_hdw_queue > qmin)) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, From patchwork Wed Nov 16 01:19:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 625395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5E06C433FE for ; Wed, 16 Nov 2022 01:11:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231669AbiKPBLG (ORCPT ); Tue, 15 Nov 2022 20:11:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231638AbiKPBLB (ORCPT ); Tue, 15 Nov 2022 20:11:01 -0500 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31D143137B for ; Tue, 15 Nov 2022 17:11:00 -0800 (PST) Received: by mail-qt1-x82c.google.com with SMTP id cg5so9867077qtb.12 for ; Tue, 15 Nov 2022 17:11:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5IP2zZ0ikXwU/6tqJtqLv3xaAmM7FUpKnU+9266pdAo=; b=YWP+vArPap1tXdk/HQyhrjl2Oj1p/JbS1A+TMufYpIXg4ZikMgHtG/kxcC9+qxwXpO 56ix0CgLCuaQOTSnmmMfEWomEIqw+OyBOz7wQCt5oJHYuJOphi0EDpUer2qwCIGaPEDm hUFrXpS5jk5ERFnezw4841c5tocJaH5XrkNZFPuCJUyKC5BWCrjwoThzXXElRdK9EGRZ WXaFVjHYaGIk+4xg5AisfHq02xeY6sqgZMwXJtQi23ueCzXEEXyCf64gzsfsJovjHn1B Dbdf5GZ8CaOphhGjIyIaWZW8AbpkHETwMiahaOk15mf1s+kfz8rla1IZ5r8rHKfQdsvM CBIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5IP2zZ0ikXwU/6tqJtqLv3xaAmM7FUpKnU+9266pdAo=; b=6XYkQiTvTw6zS51iQyfEfP7sc6iCoP5lJ4UdM16teasiOpL3WTzuIheJIgOdSLJXrj QL0dQi+Z3t4JrmD1TFV8yfMSf4na88GHBblauDHDEjzzJOLnR/m8xjfCJCrphJrHwWaY ZSXNzuT0E+lULkL1LLir5/e+71mvNcuo0ApurUog/TOGB0NVYGZhS2o0nlQ6TZwtIFCy WKx2DIUa//F13BeP2Y1hbJ6mZu0lvh6OFuIS/1LYb+4JduGhJojsz86qUQc6L3yOaUjl tJHntE+JAMEh6fNT/cmI78I50f9/B7hJpsZhZGjKHn2ou74Btr0j/4TRJ0sr/yr8+qxh jLog== X-Gm-Message-State: ANoB5plToPbYms8cBIPZs1bsoAeQAw6UKb/vpiuJum7BEcxc9nkgCeFk +KQtw9mkRd8WeQUcokm9qJaebskWoIQ= X-Google-Smtp-Source: AA0mqf5tHFDthV6rGCIgUdWY+KmUNAC1DD8FjsptVU4lDwdlhJXvJe/iiyYrdcV9JdYSBfKR4LNonw== X-Received: by 2002:a05:622a:248c:b0:3a5:6005:7db6 with SMTP id cn12-20020a05622a248c00b003a560057db6mr19066934qtb.131.1668561059267; Tue, 15 Nov 2022 17:10:59 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id y12-20020ac8128c000000b00399b73d06f0sm7901966qti.38.2022.11.15.17.10.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Nov 2022 17:10:59 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, Justin Tee , Justin Tee Subject: [PATCH 3/6] lpfc: Fix MI capability display in cmf_info sysfs attribute Date: Tue, 15 Nov 2022 17:19:18 -0800 Message-Id: <20221116011921.105995-4-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221116011921.105995-1-justintee8345@gmail.com> References: <20221116011921.105995-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The dynamic mi_ver value holds the currently configured MI setting. mi_ver was being displayed as part of the cmf_info sysfs attribute, when the output string meant to display MI capabilities instead. Add a mi_cap member in the lpfc_pc_sli4_params structure that will store MI capabilities during initialization so that cmf_info prints out capabilities instead of current configuration. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_attr.c | 2 +- drivers/scsi/lpfc/lpfc_init.c | 3 +++ drivers/scsi/lpfc/lpfc_sli4.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 030ad1d59cbd..77e1b2911cb4 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -134,7 +134,7 @@ lpfc_cmf_info_show(struct device *dev, struct device_attribute *attr, scnprintf(tmp, sizeof(tmp), "Congestion Mgmt Info: E2Eattr %d Ver %d " "CMF %d cnt %d\n", - phba->sli4_hba.pc_sli4_params.mi_ver, + phba->sli4_hba.pc_sli4_params.mi_cap, cp ? cp->cgn_info_version : 0, phba->sli4_hba.pc_sli4_params.cmf, phba->cmf_timer_cnt); diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index a6e32ecd4151..a119c06742b8 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -699,6 +699,8 @@ lpfc_sli4_refresh_params(struct lpfc_hba *phba) return rc; } mbx_sli4_parameters = &mqe->un.get_sli4_parameters.sli4_parameters; + phba->sli4_hba.pc_sli4_params.mi_cap = + bf_get(cfg_mi_ver, mbx_sli4_parameters); /* Are we forcing MI off via module parameter? */ if (phba->cfg_enable_mi) @@ -13839,6 +13841,7 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) mbx_sli4_parameters); phba->sli4_hba.extents_in_use = bf_get(cfg_ext, mbx_sli4_parameters); phba->sli4_hba.rpi_hdrs_in_use = bf_get(cfg_hdrr, mbx_sli4_parameters); + sli4_params->mi_cap = bf_get(cfg_mi_ver, mbx_sli4_parameters); /* Check for Extended Pre-Registered SGL support */ phba->cfg_xpsgl = bf_get(cfg_xpsgl, mbx_sli4_parameters); diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h index cbb1aa1cf025..f927c2a25d54 100644 --- a/drivers/scsi/lpfc/lpfc_sli4.h +++ b/drivers/scsi/lpfc/lpfc_sli4.h @@ -556,6 +556,7 @@ struct lpfc_pc_sli4_params { #define LPFC_MIB3_SUPPORT 3 uint16_t mi_value; #define LPFC_DFLT_MIB_VAL 2 + uint8_t mi_cap; uint8_t mib_bde_cnt; uint8_t cmf; uint8_t cqv; From patchwork Wed Nov 16 01:19:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 625394 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16BA2C43219 for ; Wed, 16 Nov 2022 01:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231697AbiKPBLI (ORCPT ); Tue, 15 Nov 2022 20:11:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231675AbiKPBLG (ORCPT ); Tue, 15 Nov 2022 20:11:06 -0500 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2BE63137B for ; Tue, 15 Nov 2022 17:11:05 -0800 (PST) Received: by mail-qt1-x82a.google.com with SMTP id s4so9880930qtx.6 for ; Tue, 15 Nov 2022 17:11:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=er0G09q8o36NMshGDrN680PITs1a8FejDsuIUwfURZs=; b=Y8JXH2xqMHccMowtJwQ+SbdjOay86OxX8Cn4stZFl74VEPDWzLerNAYFtPDj8aBp1o iif06LhPkkzZyt7jwY44kkqOroqFGLY+bkZK/8qir2+uww/DbD0Mg6V7Yta/zzLi0E93 ssX638yg/ZWr1SVV2HeGf+XXnS8kwM49wTYwTI+5jA9gPaM9nyxkmTRsgOyZYEPHjLMg +n0Aoa7j/n2/W0z7CFE72WsThhGGoY6A8w+OiA5rLwtwI9DFYiHEtaMkLWn4PVUOo2pH bq2dgVqxLz2rwfJaXR5+jfF+dJH1R+vT7Mj3QrjE+uBG/EqvWrKE/B1KyNtkvAyneB84 YCdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=er0G09q8o36NMshGDrN680PITs1a8FejDsuIUwfURZs=; b=3KI7g4rKUh5OgS3pF3yP+xG2WOsp/HnOKvK30hap+3ztuFfseIUAr3TQ9iVdcU5IfH W4GqhzGOj41K2zMiTY48OnQka1uTiioOxtbH0UPnARoE5/V/VxMvcBJ4WZYUyyF1aGLY /lBD2d2mXD8WkNkHQSyNvN70FRAoL7nG/zzzVZF/CtzW+oABZKX9Tuoqffer+zehL38E bo0vqGD6yrWZmvN+ngaH954rTofbamppDB0qwvzB9StDr1zwQymUVd8pjVVg8h8JZlTI TlsGJGAIvUpHLmTJQMPfObAxh22hwsHuf1iFS/ahIfH6izRGqCwZ4RTA02X4Sr0KbvZ2 yL8g== X-Gm-Message-State: ANoB5pn0F5xITKpnPvOBabJGtw7P4GD2PiC5rbfkBjfyLylMOF+QGIGO lGKJTSmnrqWFlWO3scDv9RYhShNdKho= X-Google-Smtp-Source: AA0mqf6Kxx2/ORn938DKGrI/lBZU5+vT7rvWjM9jzDs/kVsFI4idTA/fLVWs62ifP2ApXI4guE4DWw== X-Received: by 2002:a05:622a:15c3:b0:3a5:9672:a26e with SMTP id d3-20020a05622a15c300b003a59672a26emr19219904qty.587.1668561065037; Tue, 15 Nov 2022 17:11:05 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id y12-20020ac8128c000000b00399b73d06f0sm7901966qti.38.2022.11.15.17.11.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Nov 2022 17:11:04 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, Justin Tee , Justin Tee Subject: [PATCH 5/6] lpfc: Change default lpfc_suppress_rsp mode to off Date: Tue, 15 Nov 2022 17:19:20 -0800 Message-Id: <20221116011921.105995-6-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221116011921.105995-1-justintee8345@gmail.com> References: <20221116011921.105995-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The suppress response feature is non-standard and causes difficulties when troubleshooting with analyzer wiretraces. At this time, diagnostic capabilities triumphs slight performance enhancements provided by this feature. Thus, turn it off by default. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_attr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 77e1b2911cb4..bf80b462f3a5 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -3828,13 +3828,13 @@ lpfc_vport_param_store(devloss_tmo) static DEVICE_ATTR_RW(lpfc_devloss_tmo); /* - * lpfc_suppress_rsp: Enable suppress rsp feature is firmware supports it - * lpfc_suppress_rsp = 0 Disable - * lpfc_suppress_rsp = 1 Enable (default) + * lpfc_suppress_rsp: Enable suppress rsp feature if firmware supports it + * lpfc_suppress_rsp = 0 Disable (default) + * lpfc_suppress_rsp = 1 Enable * */ -LPFC_ATTR_R(suppress_rsp, 1, 0, 1, - "Enable suppress rsp feature is firmware supports it"); +LPFC_ATTR_R(suppress_rsp, 0, 0, 1, + "Enable suppress rsp feature if firmware supports it"); /* * lpfc_nvmet_mrq: Specify number of RQ pairs for processing NVMET cmds