From patchwork Mon Apr 22 05:44:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saurav Kashyap X-Patchwork-Id: 10910663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C0AC161F for ; Mon, 22 Apr 2019 05:45:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DDB127FA5 for ; Mon, 22 Apr 2019 05:45:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80BE92847B; Mon, 22 Apr 2019 05:45:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C2BF27FA5 for ; Mon, 22 Apr 2019 05:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbfDVFpP (ORCPT ); Mon, 22 Apr 2019 01:45:15 -0400 Received: from mail-eopbgr680088.outbound.protection.outlook.com ([40.107.68.88]:64837 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726443AbfDVFpP (ORCPT ); Mon, 22 Apr 2019 01:45:15 -0400 Received: from SN4PR0701CA0019.namprd07.prod.outlook.com (2603:10b6:803:28::29) by CY1PR07MB2166.namprd07.prod.outlook.com (2a01:111:e400:59d7::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.12; Mon, 22 Apr 2019 05:45:13 +0000 Received: from DM3NAM05FT021.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::207) by SN4PR0701CA0019.outlook.office365.com (2603:10b6:803:28::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1813.12 via Frontend Transport; Mon, 22 Apr 2019 05:45:13 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by DM3NAM05FT021.mail.protection.outlook.com (10.152.98.130) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1792.7 via Frontend Transport; Mon, 22 Apr 2019 05:45:13 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Sun, 21 Apr 2019 22:45:08 -0700 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 x3M5j8Pl003267; Sun, 21 Apr 2019 22:45:08 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x3M5j8WZ003266; Sun, 21 Apr 2019 22:45:08 -0700 From: Saurav Kashyap To: CC: , Subject: [PATCH 02/12] qedf: Add driver state to 'driver_stats' debugfs node. Date: Sun, 21 Apr 2019 22:44:51 -0700 Message-ID: <20190422054501.3224-3-skashyap@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190422054501.3224-1-skashyap@marvell.com> References: <20190422054501.3224-1-skashyap@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 132003855134522174;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(39860400002)(396003)(346002)(376002)(2980300002)(1110001)(339900001)(189003)(199004)(51416003)(47776003)(14444005)(2906002)(36906005)(68736007)(4326008)(8936002)(53936002)(50226002)(81166006)(8676002)(6862004)(305945005)(2351001)(81156014)(316002)(36756003)(105606002)(42186006)(69596002)(16586007)(80596001)(498600001)(97736004)(54906003)(126002)(486006)(50466002)(6666004)(48376002)(85426001)(356004)(26005)(87636003)(76176011)(1076003)(5660300002)(26826003)(336012)(2616005)(86362001)(476003)(446003)(11346002)(76130400001)(70586007)(70206006);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2166;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cbc93996-e7bb-443d-2d0e-08d6c6e5b0bd X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600141)(711020)(4605104)(2017052603328);SRVR:CY1PR07MB2166; X-MS-TrafficTypeDiagnostic: CY1PR07MB2166: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 00159D1518 X-Microsoft-Antispam-Message-Info: Csqosn1OJiYSUQ8mcfgMEcpipVITm4NyyndiIRLQJkbYDCndJNRAfmA2pQ0HLSXqIdzQ2fXmNv7ga8uvVbwQtvzNCfYr4bEe/UscgZ7bMC19ASqSmnTXjyaOBBOvdXAMxQtvbWidJqEUZgja8lHhyc/Rd79KvQlHW1AvQEr3ToF3CIfYEB7J/lUn2KqZoEQopj2siXxK2QKn3fjVAYxGEyhU8YBK/bT9KVFaUFtgir2NTNs9NX39DnBnHnw0/O6CHDWnvMXSyiNWgu9OqX0g2WAA7Ip5isYxGh+hQ7qpXCkrJFCFvmaviFZhb6yAZdVUXCUCI66POFqXPqVlbpMr4Qh7e242dxtzC4e6Uci/a74RpUHOTYPPxbQFPy+j5Z7BnQtZ7/v3/wSl3g0Zxqs4vg7fhRgp4K6HNKC4P3XLclU= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2019 05:45:13.1009 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbc93996-e7bb-443d-2d0e-08d6c6e5b0bd X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2166 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chad Dupuis - Add debugs node for driver stats. Signed-off-by: Chad Dupuis Signed-off-by: Saurav Kashyap --- drivers/scsi/qedf/qedf_debugfs.c | 55 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qedf/qedf_debugfs.c b/drivers/scsi/qedf/qedf_debugfs.c index 6ae78dd..2353892 100644 --- a/drivers/scsi/qedf/qedf_debugfs.c +++ b/drivers/scsi/qedf/qedf_debugfs.c @@ -293,6 +293,33 @@ return single_open(file, qedf_io_trace_show, qedf); } +/* Based on fip_state enum from libfcoe.h */ +static char *fip_state_names[] = { + "FIP_ST_DISABLED", + "FIP_ST_LINK_WAIT", + "FIP_ST_AUTO", + "FIP_ST_NON_FIP", + "FIP_ST_ENABLED", + "FIP_ST_VNMP_START", + "FIP_ST_VNMP_PROBE1", + "FIP_ST_VNMP_PROBE2", + "FIP_ST_VNMP_CLAIM", + "FIP_ST_VNMP_UP", +}; + +/* Based on fc_rport_state enum from libfc.h */ +static char *fc_rport_state_names[] = { + "RPORT_ST_INIT", + "RPORT_ST_FLOGI", + "RPORT_ST_PLOGI_WAIT", + "RPORT_ST_PLOGI", + "RPORT_ST_PRLI", + "RPORT_ST_RTV", + "RPORT_ST_READY", + "RPORT_ST_ADISC", + "RPORT_ST_DELETE", +}; + static int qedf_driver_stats_show(struct seq_file *s, void *unused) { @@ -300,6 +327,25 @@ struct qedf_rport *fcport; struct fc_rport_priv *rdata; + seq_printf(s, "Host WWNN/WWPN: %016llx/%016llx\n", + qedf->wwnn, qedf->wwpn); + seq_printf(s, "Host NPortID: %06x\n", qedf->lport->port_id); + seq_printf(s, "Link State: %s\n", atomic_read(&qedf->link_state) ? + "Up" : "Down"); + seq_printf(s, "Logical Link State: %s\n", qedf->lport->link_up ? + "Up" : "Down"); + seq_printf(s, "FIP state: %s\n", fip_state_names[qedf->ctlr.state]); + seq_printf(s, "FIP VLAN ID: %d\n", qedf->vlan_id & 0xfff); + seq_printf(s, "FIP 802.1Q Priority: %d\n", qedf->prio); + if (qedf->ctlr.sel_fcf) { + seq_printf(s, "FCF WWPN: %016llx\n", + qedf->ctlr.sel_fcf->switch_name); + seq_printf(s, "FCF MAC: %pM\n", qedf->ctlr.sel_fcf->fcf_mac); + } else { + seq_puts(s, "FCF not selected\n"); + } + + seq_puts(s, "\nSGE stats:\n\n"); seq_printf(s, "cmg_mgr free io_reqs: %d\n", atomic_read(&qedf->cmd_mgr->free_list_cnt)); seq_printf(s, "slow SGEs: %d\n", qedf->slow_sge_ios); @@ -312,9 +358,12 @@ rdata = fcport->rdata; if (rdata == NULL) continue; - seq_printf(s, "%06x: free_sqes: %d, num_active_ios: %d\n", - rdata->ids.port_id, atomic_read(&fcport->free_sqes), - atomic_read(&fcport->num_active_ios)); + seq_printf(s, "%016llx/%016llx/%06x: state=%s, free_sqes=%d, num_active_ios=%d\n", + rdata->rport->node_name, rdata->rport->port_name, + rdata->ids.port_id, + fc_rport_state_names[rdata->rp_state], + atomic_read(&fcport->free_sqes), + atomic_read(&fcport->num_active_ios)); } rcu_read_unlock();