From patchwork Thu Aug 5 10:19:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 492575 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 D73EDC4338F for ; Thu, 5 Aug 2021 10:20:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B46036052B for ; Thu, 5 Aug 2021 10:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240105AbhHEKVL (ORCPT ); Thu, 5 Aug 2021 06:21:11 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:44158 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240232AbhHEKVK (ORCPT ); Thu, 5 Aug 2021 06:21:10 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175AElYS017619 for ; Thu, 5 Aug 2021 03:20:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=aBmj55iU8haxxp3FaFm0UcBrHWQdAt8ZTMrOoWkxqmw=; b=OG31slsequd7gV2Pu7VPhHWZco/PZdtrif/CLfMumq0qpvd+EKuLdYhd4ME6HIixrwBL gNaRzHUCYq4gtZyxz/Uzm39TQqClM3HmXi5DRybAcDZzx3fiS4hA3e5chuId2dQuvORS gBgj8jAN9cROxyaL3S0/qsxVw+KYWP05kRMv/8Tr3hSiJDg47VhZhizNYFUD0CadanGE at4YJZB3hEL37RZqZEsz75N4j6LPqqIa0uNhP4R+ZBj3vxQpL6kQ5w6DWB1ZFbgfN9co wqbb4WIr7/4C9O8Xo2WpJM8hX1qEuhaBe5faqOdKqiWYXwmwPHje+aBvLf7Nb2d9aqkI sQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 3a8ata0hwf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 05 Aug 2021 03:20:56 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 5 Aug 2021 03:20:53 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 5 Aug 2021 03:20:53 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 45DCA3F7061; Thu, 5 Aug 2021 03:20:54 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id 175AKsYk020230; Thu, 5 Aug 2021 03:20:54 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 175AKsGd020221; Thu, 5 Aug 2021 03:20:54 -0700 From: Nilesh Javali To: CC: , Subject: [PATCH 01/14] qla2xxx: Add host attribute to trigger MPI hang Date: Thu, 5 Aug 2021 03:19:52 -0700 Message-ID: <20210805102005.20183-2-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210805102005.20183-1-njavali@marvell.com> References: <20210805102005.20183-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: R6Gf5Xzyfcz9lQd8_SQIa3DARYAIgwsq X-Proofpoint-GUID: R6Gf5Xzyfcz9lQd8_SQIa3DARYAIgwsq X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-05_03:2021-08-05,2021-08-05 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Arun Easi Add a mechanism to trigger MPI pause for debugging purpose. Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Reviewed-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 22191e9a04a0..4a0a5b4e688d 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1887,6 +1887,30 @@ qla2x00_port_speed_show(struct device *dev, struct device_attribute *attr, return scnprintf(buf, PAGE_SIZE, "%s\n", spd[ha->link_data_rate]); } +static ssize_t +qla2x00_mpi_pause_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + int rval = 0; + + if (sscanf(buf, "%d", &rval) != 1) + return -EINVAL; + + ql_log(ql_log_warn, vha, 0x7089, "Pausing MPI...\n"); + + rval = qla83xx_wr_reg(vha, 0x002012d4, 0x30000001); + + if (rval != QLA_SUCCESS) { + ql_log(ql_log_warn, vha, 0x708a, "Unable to pause MPI.\n"); + count = 0; + } + + return count; +} + +static DEVICE_ATTR(mpi_pause, S_IWUSR, NULL, qla2x00_mpi_pause_store); + /* ----- */ static ssize_t @@ -2482,6 +2506,7 @@ struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_fw_attr, &dev_attr_dport_diagnostics, &dev_attr_edif_doorbell, + &dev_attr_mpi_pause, NULL, /* reserve for qlini_mode */ NULL, /* reserve for ql2xiniexchg */ NULL, /* reserve for ql2xexchoffld */ From patchwork Thu Aug 5 10:19:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 492574 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 72A0AC4338F for ; Thu, 5 Aug 2021 10:21:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D742610A2 for ; Thu, 5 Aug 2021 10:21:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240080AbhHEKWB (ORCPT ); Thu, 5 Aug 2021 06:22:01 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:38356 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240017AbhHEKV7 (ORCPT ); Thu, 5 Aug 2021 06:21:59 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175AExKZ017664 for ; Thu, 5 Aug 2021 03:21:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=lBo126y/sQec6b+Jky0zjtKllzIhkIM8/ZWDZsgEDuY=; b=IjH4dpMsop4BZz+Ki9t5cT1ycHEaviSeJVzqCKKo2qaS43f1TXi5IEafb1gitMyr/3wR 2ILLV3MpM17rqSlgocYWnNttZLB1WCQ98JIvELLNyUfxdjR90PH0MN8Vwv1ZVGe4zrqv dZeAxRIKY7zIItL2REZ5dpzSQyKEhS+LxCkrLq3OZrtQdVUgZdWPgld6IOJmEJz0gCGN Gzp5PShTsZXEpkiUxfvxDvamJOi9MyuBxypzws+y1IEyz1A085b2f/J9z0Q8QM1fN3Ht XsLQFKrkvVXeOxfBQuz6ysqg/12scrW3M+w8AiL73Y4ReWLpDZ/CBbS6B+8aNVMykUgk +A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 3a8ata0j0c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 05 Aug 2021 03:21:44 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 5 Aug 2021 03:21:42 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 5 Aug 2021 03:21:42 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 889093F7061; Thu, 5 Aug 2021 03:21:42 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id 175ALgdT020246; Thu, 5 Aug 2021 03:21:42 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 175ALgKD020237; Thu, 5 Aug 2021 03:21:42 -0700 From: Nilesh Javali To: CC: , Subject: [PATCH 03/14] qla2xxx: adjust request/response queue size for 28xx Date: Thu, 5 Aug 2021 03:19:54 -0700 Message-ID: <20210805102005.20183-4-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210805102005.20183-1-njavali@marvell.com> References: <20210805102005.20183-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: Kam0MBI7QlyM_v36Y2GOjhf-hR90YWOl X-Proofpoint-GUID: Kam0MBI7QlyM_v36Y2GOjhf-hR90YWOl X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-05_03:2021-08-05,2021-08-05 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Quinn Tran adjust request/respond queue size for 28xx to match 27xx adapter. Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali --- drivers/scsi/qla2xxx/qla_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 53e9eea031bd..921bd4d127f4 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3065,8 +3065,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->portnum = PCI_FUNC(ha->pdev->devfn); ha->max_fibre_devices = MAX_FIBRE_DEVICES_2400; ha->mbx_count = MAILBOX_REGISTER_COUNT; - req_length = REQUEST_ENTRY_CNT_24XX; - rsp_length = RESPONSE_ENTRY_CNT_2300; + req_length = REQUEST_ENTRY_CNT_83XX; + rsp_length = RESPONSE_ENTRY_CNT_83XX; ha->tgt.atio_q_length = ATIO_ENTRY_CNT_24XX; ha->max_loop_id = SNS_LAST_LOOP_ID_2300; ha->init_cb_size = sizeof(struct mid_init_cb_81xx); From patchwork Thu Aug 5 10:19:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 492573 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 0A74DC4338F for ; Thu, 5 Aug 2021 10:22:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E22CE61108 for ; Thu, 5 Aug 2021 10:22:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240172AbhHEKWq (ORCPT ); Thu, 5 Aug 2021 06:22:46 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:31082 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240142AbhHEKWq (ORCPT ); Thu, 5 Aug 2021 06:22:46 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175ABaZm008161 for ; Thu, 5 Aug 2021 03:22:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=jUCzT34gOG+PFREBAmSMfKDz9ZBWtDgJeVTDELgMPBA=; b=Lkuc12UjjS65vveNyPN3LYm2SERulQsLdE0ocYwNxRlQzoiqmbzAy7rfXXLcFq2AVsAF Tz7YVRHOOu7WupKucKy+Cpjiq9PoiLcBbyd5PcGDwY72ur49gFv4NQcpoHlKo9IVooKG PDOc1QUEQUBJMltTQIkjLIMR2TVMYl07nd9G92tOCqJ/7f6bkO5wW2kCs35mU6s0lQGW Rzx7vIkxA1/M8tmVyTNbREmURoCZThkVsi5zRMKh0RCsIcu/BD3IP8VuW1GvqaQqqqJM APsIWy9nVWWtHYkjI7l2YkqjXcdM2AW5lKCS09HLMN6dZNSrHV5Zqdd9cq08IdX7R/je jQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3a8bkb8drn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 05 Aug 2021 03:22:32 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 5 Aug 2021 03:22:30 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 5 Aug 2021 03:22:30 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id D237B3F705F; Thu, 5 Aug 2021 03:22:30 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id 175AMUmT020254; Thu, 5 Aug 2021 03:22:30 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 175AMUWs020253; Thu, 5 Aug 2021 03:22:30 -0700 From: Nilesh Javali To: CC: , Subject: [PATCH 05/14] qla2xxx: Show OS name and version in FDMI-1 Date: Thu, 5 Aug 2021 03:19:56 -0700 Message-ID: <20210805102005.20183-6-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210805102005.20183-1-njavali@marvell.com> References: <20210805102005.20183-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: 5ptf7zYUAtV49RgSmk6WoQYhVaMg5A8i X-Proofpoint-ORIG-GUID: 5ptf7zYUAtV49RgSmk6WoQYhVaMg5A8i X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-05_03:2021-08-05,2021-08-05 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Arun Easi To be consistent with other OS drivers, register OS name and version in FDMI-1 fabric registration. Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Reviewed-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 2 +- drivers/scsi/qla2xxx/qla_gs.c | 4 ++-- drivers/scsi/qla2xxx/qla_os.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index af0e8be0eb9b..c081bf1c7578 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2790,7 +2790,7 @@ static const char * const port_dstate_str[] = { /* * FDMI HBA attribute types. */ -#define FDMI1_HBA_ATTR_COUNT 9 +#define FDMI1_HBA_ATTR_COUNT 10 #define FDMI2_HBA_ATTR_COUNT 17 #define FDMI_HBA_NODE_NAME 0x1 diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index b0b15fac5f3b..c37478f1b538 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -1730,8 +1730,6 @@ qla2x00_hba_attributes(scsi_qla_host_t *vha, void *entries, size += alen; ql_dbg(ql_dbg_disc, vha, 0x20a8, "FIRMWARE VERSION = %s.\n", eiter->a.fw_version); - if (callopt == CALLOPT_FDMI1) - goto done; /* OS Name and Version */ eiter = entries + size; eiter->type = cpu_to_be16(FDMI_HBA_OS_NAME_AND_VERSION); @@ -1754,6 +1752,8 @@ qla2x00_hba_attributes(scsi_qla_host_t *vha, void *entries, size += alen; ql_dbg(ql_dbg_disc, vha, 0x20a9, "OS VERSION = %s.\n", eiter->a.os_version); + if (callopt == CALLOPT_FDMI1) + goto done; /* MAX CT Payload Length */ eiter = entries + size; eiter->type = cpu_to_be16(FDMI_HBA_MAXIMUM_CT_PAYLOAD_LENGTH); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 61ae8cbba670..a1ccd9f32a98 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -7991,7 +7991,7 @@ qla2x00_module_init(void) BUILD_BUG_ON(sizeof(struct cmd_type_7_fx00) != 64); BUILD_BUG_ON(sizeof(struct cmd_type_crc_2) != 64); BUILD_BUG_ON(sizeof(struct ct_entry_24xx) != 64); - BUILD_BUG_ON(sizeof(struct ct_fdmi1_hba_attributes) != 2344); + BUILD_BUG_ON(sizeof(struct ct_fdmi1_hba_attributes) != 2604); BUILD_BUG_ON(sizeof(struct ct_fdmi2_hba_attributes) != 4424); BUILD_BUG_ON(sizeof(struct ct_fdmi2_port_attributes) != 4164); BUILD_BUG_ON(sizeof(struct ct_fdmi_hba_attr) != 260); From patchwork Thu Aug 5 10:19:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 492572 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 28454C4338F for ; Thu, 5 Aug 2021 10:23:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DFFC6112D for ; Thu, 5 Aug 2021 10:23:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240050AbhHEKXj (ORCPT ); Thu, 5 Aug 2021 06:23:39 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:16622 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240172AbhHEKXe (ORCPT ); Thu, 5 Aug 2021 06:23:34 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175ABad7008164 for ; Thu, 5 Aug 2021 03:23:20 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=oZYtUNEanl0Uf0YkNBtDty8IU+t6nyV0RmPG0LBTS0I=; b=Mqo51A/59aKHHm5mYozX2k33Dq+o/bl7TW3XvV3temWCZjYAjrTs65h2cDG/oq7ib7dO n2xCzPyFuZF17Ku4NmWH0KFxLGtosv5nmo4J1JzA0Y4f7tGkZMdWkdDNJ1oJiIlJjNm7 tc3hJh760vNbKzHKHHn43ajJeMoMrH19VAsyCdOmfa3q0h5eCYv7A0e1htc1Oqj8JHfI uctfjS+TgYMsjXzI/9EsARgf+S4INUN6xDWDW43wgbzSCmmRjJuJwWmDSRxG+iF3xEKs Qcj0nUSj3pMpBa7sjCSsONbCdPyX4r9l7PV+HaJ81YidISIIcnuq+cXrNnMieFTy6JzC 7w== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3a8bkb8dv5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 05 Aug 2021 03:23:20 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 5 Aug 2021 03:23:19 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 5 Aug 2021 03:23:18 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 105753F705D; Thu, 5 Aug 2021 03:23:19 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id 175ANIGF020270; Thu, 5 Aug 2021 03:23:18 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 175ANIIa020269; Thu, 5 Aug 2021 03:23:18 -0700 From: Nilesh Javali To: CC: , Subject: [PATCH 07/14] qla2xxx: fix port type info Date: Thu, 5 Aug 2021 03:19:58 -0700 Message-ID: <20210805102005.20183-8-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210805102005.20183-1-njavali@marvell.com> References: <20210805102005.20183-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: l3mp766KMbDOyPlshM-vXiR4C59lRvj9 X-Proofpoint-ORIG-GUID: l3mp766KMbDOyPlshM-vXiR4C59lRvj9 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-05_03:2021-08-05,2021-08-05 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Quinn Tran Over time, fcport->port_type became flag field. The flags within this field were not defined properly. This caused external tools to read wrong info. Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Reviewed-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c081bf1c7578..60702d066ed9 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2428,11 +2428,9 @@ struct mbx_24xx_entry { */ typedef enum { FCT_UNKNOWN, - FCT_RSCN, - FCT_SWITCH, - FCT_BROADCAST, - FCT_INITIATOR, - FCT_TARGET, + FCT_BROADCAST = 0x01, + FCT_INITIATOR = 0x02, + FCT_TARGET = 0x04, FCT_NVME_INITIATOR = 0x10, FCT_NVME_TARGET = 0x20, FCT_NVME_DISCOVERY = 0x40, From patchwork Thu Aug 5 10:20:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 492571 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 585FDC4338F for ; Thu, 5 Aug 2021 10:24:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B52C61108 for ; Thu, 5 Aug 2021 10:24:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240203AbhHEKYY (ORCPT ); Thu, 5 Aug 2021 06:24:24 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:13864 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240138AbhHEKYY (ORCPT ); Thu, 5 Aug 2021 06:24:24 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175AEUBj017497 for ; Thu, 5 Aug 2021 03:24:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=1oIyNIzOd1Q8QcszZYgWvd4zVfutXAOlT/2vWCJCAag=; b=A+J3Pz5pQR96q3i0gRtLeNUlvQkJSuNOJEOEkU+sZnEs5CxSLg1ayvsrpf3gU4TMmAVd MGtSanqAL0JOh8i2EQxk4uPh7DPYCjrCvFeY4ZdfcmUm1lk3reZzFyzpjbehqtsBWhd5 v6A1kxsR70IMVRfnnPi7wemOxGz+V8t0s17cs4sa2R5Q8oSIbCXHsGQVe6RKFPlYGKVM UNA0Xn6FVSHwUAsjbsr9AAjZVz4sMETM0NApqTXJ+LsyH8vjtp/+JqPB0ONfqQ3CCR8p pfnMFbUemzGrBuLTsyqL3fsgIVI8mRibE/XHfNNOEmJ3+Mf0gfl6FGZmoQxK68oIH0kn aA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 3a8ata0j6r-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 05 Aug 2021 03:24:09 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 5 Aug 2021 03:24:07 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 5 Aug 2021 03:24:07 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 620EB3F705F; Thu, 5 Aug 2021 03:24:07 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id 175AO7FS020286; Thu, 5 Aug 2021 03:24:07 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 175AO7rS020285; Thu, 5 Aug 2021 03:24:07 -0700 From: Nilesh Javali To: CC: , Subject: [PATCH 09/14] qla2xxx: fix npiv create erroneous error Date: Thu, 5 Aug 2021 03:20:00 -0700 Message-ID: <20210805102005.20183-10-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210805102005.20183-1-njavali@marvell.com> References: <20210805102005.20183-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 7OTxZblHsZriQPeTXT_aIe7TnpdM8FQG X-Proofpoint-GUID: 7OTxZblHsZriQPeTXT_aIe7TnpdM8FQG X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-05_03:2021-08-05,2021-08-05 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Quinn Tran When user create multiple NPIVs, the switch capabilities field is checked before a vport is allowed to create. This field is being toggled if a switch scan is in progress. This creates erroneous reject of vport create. Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Reviewed-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index c427ef7e7c72..266e9e06a6f2 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4623,11 +4623,11 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) /* initialize */ ha->min_external_loopid = SNS_FIRST_LOOP_ID; ha->operating_mode = LOOP; - ha->switch_cap = 0; switch (topo) { case 0: ql_dbg(ql_dbg_disc, vha, 0x200b, "HBA in NL topology.\n"); + ha->switch_cap = 0; ha->current_topology = ISP_CFG_NL; strcpy(connect_type, "(Loop)"); break; @@ -4641,6 +4641,7 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) case 2: ql_dbg(ql_dbg_disc, vha, 0x200d, "HBA in N P2P topology.\n"); + ha->switch_cap = 0; ha->operating_mode = P2P; ha->current_topology = ISP_CFG_N; strcpy(connect_type, "(N_Port-to-N_Port)"); @@ -4657,6 +4658,7 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) default: ql_dbg(ql_dbg_disc, vha, 0x200f, "HBA in unknown topology %x, using NL.\n", topo); + ha->switch_cap = 0; ha->current_topology = ISP_CFG_NL; strcpy(connect_type, "(Loop)"); break; From patchwork Thu Aug 5 10:20:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 492570 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 7C7C2C4338F for ; Thu, 5 Aug 2021 10:24:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 675CF610A2 for ; Thu, 5 Aug 2021 10:24:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240238AbhHEKZL (ORCPT ); Thu, 5 Aug 2021 06:25:11 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:39104 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239963AbhHEKZK (ORCPT ); Thu, 5 Aug 2021 06:25:10 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175AC5fK010038 for ; Thu, 5 Aug 2021 03:24:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=eGPrUtfiK+0IFjEz+CLrOplnKzsrsa5/e2IkZ2lajUk=; b=NbFsWDMWQr6pyVK89T6c+JiELcj+3/cMRbgIDrP3Vpeyg1y9puyS6dh870tzZNBbfuFd IWMX3DCJ8MVmn69lqvFr9vGDbsxqhKV5aX3LxybS9JFGU/DKheodfCLhsCjRsm7UQp9s p69p7kKqiCvskvVv6aa0Q+isy9AeE392pSxwbSY1+xtJpTu7bKSMQaJQNCTR6NE9Ux8v GRIJoBWPqagTMivcopidxvEUnOJBcGt/XlqFA7T4yTBgqm8lYmiUYnD/iLK/DTT+2Mf4 mksDb8f2EIkRc/wkU22ALdhRWMNhNpSLZwtT3YPKPPK92W9Ppsm5qpT7xmNwa//hVOgh aw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3a8bkb8e01-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 05 Aug 2021 03:24:56 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 5 Aug 2021 03:24:55 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 5 Aug 2021 03:24:55 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 93FBF3F705D; Thu, 5 Aug 2021 03:24:55 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id 175AOtVl020303; Thu, 5 Aug 2021 03:24:55 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 175AOtwJ020302; Thu, 5 Aug 2021 03:24:55 -0700 From: Nilesh Javali To: CC: , Subject: [PATCH 11/14] qla2xxx: Changes to support kdump kernel Date: Thu, 5 Aug 2021 03:20:02 -0700 Message-ID: <20210805102005.20183-12-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210805102005.20183-1-njavali@marvell.com> References: <20210805102005.20183-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: pvRpp0rzc-mxekakXPhuNhxQTYIzkdh1 X-Proofpoint-ORIG-GUID: pvRpp0rzc-mxekakXPhuNhxQTYIzkdh1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-05_03:2021-08-05,2021-08-05 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Saurav Kashyap Don't allocate fw dump for kexec kernel. Allocate single Q for kexec kernel. Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali --- drivers/scsi/qla2xxx/qla_os.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index df42849e7ccc..d899f814c1ae 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -2839,6 +2840,11 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) return ret; } + if (is_kdump_kernel()) { + ql2xmqsupport = 0; + ql2xallocfwdump = 0; + } + /* This may fail but that's ok */ pci_enable_pcie_error_reporting(pdev); From patchwork Thu Aug 5 10:20:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 492569 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 086E0C4338F for ; Thu, 5 Aug 2021 10:25:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D684760724 for ; Thu, 5 Aug 2021 10:25:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240222AbhHEK0A (ORCPT ); Thu, 5 Aug 2021 06:26:00 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:64048 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239963AbhHEKZ7 (ORCPT ); Thu, 5 Aug 2021 06:25:59 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175ABadN008164 for ; Thu, 5 Aug 2021 03:25:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=cpvFQbARKmiwIhcfgyi064+VQab89b/0ltSwCr0fePo=; b=hCBbFOJSQzkBUZ4Fo2RxbV5Gg9KOkq/2LpgIeaAkdJPGMDfCP0ZbKqwX4cdmeNCW+l5e iYpCWn7mDLrzQ5MPOCXV8LU7VRQQsObKSaW/eaaJ5UyOb2XN13uZj7U19TVI9aavplD1 SFgC6/k0/nmf1eUwSLVivU/cLRfw73CT+NsBdYNS6PrpeW4XRmgJ6UQ3oSmRmLvPWy0B iQ37hDt/SbeeHApoYTPhQrQGkguayBvHbTKBFTL4c5/AjI6nEpMdFJV89QBn3xP7R6Zu JoG+UpfzWLgVXQezOxugoDFxVVdeA3egg6KqNqwrvxFzW0sFudkapaawBQEeOhhomXFD Gg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3a8bkb8e26-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 05 Aug 2021 03:25:45 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 5 Aug 2021 03:25:43 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 5 Aug 2021 03:25:43 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id DBBE13F705D; Thu, 5 Aug 2021 03:25:43 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id 175APhKs020319; Thu, 5 Aug 2021 03:25:43 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 175APhQo020310; Thu, 5 Aug 2021 03:25:43 -0700 From: Nilesh Javali To: CC: , Subject: [PATCH 13/14] qla2xxx: Sync queue idx with queue_pair_map idx Date: Thu, 5 Aug 2021 03:20:04 -0700 Message-ID: <20210805102005.20183-14-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210805102005.20183-1-njavali@marvell.com> References: <20210805102005.20183-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: 1N7sPG1Uedy6wV4RzbMLbUQeUqAvCYXM X-Proofpoint-ORIG-GUID: 1N7sPG1Uedy6wV4RzbMLbUQeUqAvCYXM X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-05_03:2021-08-05,2021-08-05 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Saurav Kashyap The first invocation of function find_first_zero_bit will return 0 and queue_id gets set to 0. An index of queue_pair_map also get sets to 0. qpair_id = find_first_zero_bit(ha->qpair_qid_map, ha->max_qpairs); set_bit(qpair_id, ha->qpair_qid_map); ha->queue_pair_map[qpair_id] = qpair; In the alloc_queue callback driver checks the map, if queue is already allocated. ha->queue_pair_map[qidx] This works fine as long as max_qpairs is greater than nvme_max_hw_queues(8). Since the size of the queue_pair_map is equal to max_qpair. In case, nr_cpus is less than 8, max_qpairs values goes less than 8, this creates wrong value returns as qpair. [ 1572.353669] qla2xxx [0000:24:00.3]-2121:6: Returning existing qpair of 4e00000000000000 for idx=2 [ 1572.354458] general protection fault: 0000 [#1] SMP PTI [ 1572.354461] CPU: 1 PID: 44 Comm: kworker/1:1H Kdump: loaded Tainted: G IOE --------- - - 4.18.0-304.el8.x86_64 #1 [ 1572.354462] Hardware name: HP ProLiant DL380p Gen8, BIOS P70 03/01/2013 [ 1572.354467] Workqueue: kblockd blk_mq_run_work_fn [ 1572.354485] RIP: 0010:qla_nvme_post_cmd+0x92/0x760 [qla2xxx] [ 1572.354486] Code: 84 24 5c 01 00 00 00 00 b8 0a 74 1e 66 83 79 48 00 0f 85 a8 03 00 00 48 8b 44 24 08 48 89 ee 4c 89 e7 8b 50 24 e8 5e 8e 00 00 41 ff 47 04 0f ae f0 41 f6 47 24 04 74 19 f0 41 ff 4f 04 b8 f0 [ 1572.354487] RSP: 0018:ffff9c81c645fc90 EFLAGS: 00010246 [ 1572.354489] RAX: 0000000000000001 RBX: ffff8ea3e5070138 RCX: 0000000000000001 [ 1572.354490] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff8ea4c866b800 [ 1572.354491] RBP: ffff8ea4c866b800 R08: 0000000000005010 R09: ffff8ea4c866b800 [ 1572.354492] R10: 0000000000000001 R11: 000000069d1ca3ff R12: ffff8ea4bc460000 [ 1572.354493] R13: ffff8ea3e50702b0 R14: ffff8ea4c4c16a58 R15: 4e00000000000000 [ 1572.354494] FS: 0000000000000000(0000) GS:ffff8ea4dfd00000(0000) knlGS:0000000000000000 [ 1572.354495] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1572.354496] CR2: 000055884504fa58 CR3: 00000005a1410001 CR4: 00000000000606e0 [ 1572.354497] Call Trace: [ 1572.354503] ? check_preempt_curr+0x62/0x90 [ 1572.354506] ? dma_direct_map_sg+0x72/0x1f0 [ 1572.354509] ? nvme_fc_start_fcp_op.part.32+0x175/0x460 [nvme_fc] [ 1572.354511] ? blk_mq_dispatch_rq_list+0x11c/0x730 [ 1572.354515] ? __switch_to_asm+0x35/0x70 [ 1572.354516] ? __switch_to_asm+0x41/0x70 [ 1572.354518] ? __switch_to_asm+0x35/0x70 [ 1572.354519] ? __switch_to_asm+0x41/0x70 [ 1572.354521] ? __switch_to_asm+0x35/0x70 [ 1572.354522] ? __switch_to_asm+0x41/0x70 [ 1572.354523] ? __switch_to_asm+0x35/0x70 [ 1572.354525] ? entry_SYSCALL_64_after_hwframe+0xb9/0xca [ 1572.354527] ? __switch_to_asm+0x41/0x70 [ 1572.354529] ? __blk_mq_sched_dispatch_requests+0xc6/0x170 [ 1572.354531] ? blk_mq_sched_dispatch_requests+0x30/0x60 [ 1572.354532] ? __blk_mq_run_hw_queue+0x51/0xd0 [ 1572.354535] ? process_one_work+0x1a7/0x360 [ 1572.354537] ? create_worker+0x1a0/0x1a0 [ 1572.354538] ? worker_thread+0x30/0x390 [ 1572.354540] ? create_worker+0x1a0/0x1a0 [ 1572.354541] ? kthread+0x116/0x130 [ 1572.354543] ? kthread_flush_work_fn+0x10/0x10 [ 1572.354545] ? ret_from_fork+0x35/0x40 Fix is to use index 0 for admin and first IO queue. Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Reviewed-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_nvme.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 94e350ef3028..04b766b8a471 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -91,8 +91,9 @@ static int qla_nvme_alloc_queue(struct nvme_fc_local_port *lport, struct qla_hw_data *ha; struct qla_qpair *qpair; - if (!qidx) - qidx++; + /* Map admin queue and 1st IO queue to index 0 */ + if (qidx) + qidx--; vha = (struct scsi_qla_host *)lport->private; ha = vha->hw;