From patchwork Fri Oct 27 18:02:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Karan Tilak Kumar (kartilak)" X-Patchwork-Id: 159063 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp790372vqb; Fri, 27 Oct 2023 11:06:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEssE7LR6DjXpXolHZP9fyQDst9t+VJAeuhz7cinjIKzP2xtaMcqBWemy4jdziVnVTLOVT/ X-Received: by 2002:a67:e98a:0:b0:457:cd1d:b877 with SMTP id b10-20020a67e98a000000b00457cd1db877mr3386938vso.4.1698429983192; Fri, 27 Oct 2023 11:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698429983; cv=none; d=google.com; s=arc-20160816; b=VmbBhFIWjQSdqY8khU2Lr2jSCt1HSGmcfRGP+hD5grQ4fJtwCXajgcz7utn3sMoUAB P6DM3rzSK++bEDJijGOClMJwaG17/Urrp26rtczQncJdMy1tu5UG7sfu+7IBQ6poPwg7 N5B71G2YFYW7LYvTnjxzFraILJ8qmM09+/SN74UgHrYtoWLw7x2xngOxSQGCb3vloGJu jkXZolzGeQ0u4j5gLv4aivB55g4z9yuyBi06STBBNdpoJB05dKZUq0uKeyMlp5pxKpvP +GIg4tpULxlVdTMDPC8twBWOAKUh+oIu+0bSiVPVKapONi7Nep50tsXZuz/zUKn9v2Oi TwNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0yjLvvKXBZHsJyUFG23IjYy1c15kgaXtqiI5qd2qKxA=; fh=bKSAdOD9sjDLFpuVEw2QY/iOhn17PgYAzgX/PkCBS1w=; b=Xl6RZYY9Ba4LLHFA9W7inMRoWXub0/U67cXJzZ1JIFMgoPbscGwhOHohxU7iWF/ADz KHthEbdkC7eM0e90KCztrrsRHTBnmREa66G5YNopWcE1pCiDpp+03rdxNTUCR8QzLEMa d/pd3rSOErLHBgCNS3oSuLEIB3K6kMKoZdShrmeAl6maI1G/hsTHykUOxnOHdeiWYu4S QbCQoV7wp4k+NXyNvA6khsvMTOQwIp8xXPiQVTDN+o1+ogeZkwEwXazJX+ZEFzbzdxue 6J6ldUvPNvnJxU2eYGhF7nM2ziWD0GydjClbIfbO822QqVGERTD+8z/EKlO4q0rCwoiF DKfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=epuXc5rG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id q101-20020a9f37ee000000b00794c860026dsi385623uaq.108.2023.10.27.11.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 11:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=epuXc5rG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id C67D3808A921; Fri, 27 Oct 2023 11:05:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346376AbjJ0SEJ (ORCPT + 25 others); Fri, 27 Oct 2023 14:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346348AbjJ0SDp (ORCPT ); Fri, 27 Oct 2023 14:03:45 -0400 Received: from alln-iport-1.cisco.com (alln-iport-1.cisco.com [173.37.142.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF86AD58; Fri, 27 Oct 2023 11:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2334; q=dns/txt; s=iport; t=1698429820; x=1699639420; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fv30yt0LjIxxDkJmPu1aq2CxwjmyWduwzcIDXyk48UI=; b=epuXc5rGGY6VpBq/fLMfEXLPjQzUkoOxrV0vsKJ8Cxdqp7Mq2eErx9A3 MIxR97dCCrxI5N3AtkFgQ5Jq7mOjB10R7lYQgdC6PPZ+YYaq8Azji5dxv 7TCBTeqn13IlWtB+7ubFoMiHRyQfLhxezZH1+KDIpsXJeOGsSt6p4AE8G s=; X-CSE-ConnectionGUID: YrIGzErHRnOg5+M6czViqg== X-CSE-MsgGUID: bJWbrL8lRmKkR3wn5EKNyg== X-IronPort-AV: E=Sophos;i="6.03,256,1694736000"; d="scan'208";a="187094485" Received: from rcdn-core-11.cisco.com ([173.37.93.147]) by alln-iport-1.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 18:03:40 +0000 Received: from localhost.cisco.com ([10.193.101.253]) (authenticated bits=0) by rcdn-core-11.cisco.com (8.15.2/8.15.2) with ESMTPSA id 39RI39Ok029226 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 27 Oct 2023 18:03:39 GMT From: Karan Tilak Kumar To: sebaddel@cisco.com Cc: arulponn@cisco.com, djhawar@cisco.com, gcboffa@cisco.com, mkai2@cisco.com, satishkh@cisco.com, jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Karan Tilak Kumar Subject: [PATCH v2 08/13] scsi: fnic: Define stats to track multiqueue (MQ) IOs Date: Fri, 27 Oct 2023 11:02:57 -0700 Message-Id: <20231027180302.418676-9-kartilak@cisco.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231027180302.418676-1-kartilak@cisco.com> References: <20231027180302.418676-1-kartilak@cisco.com> MIME-Version: 1.0 X-Authenticated-User: kartilak@cisco.com X-Outbound-SMTP-Client: 10.193.101.253, [10.193.101.253] X-Outbound-Node: rcdn-core-11.cisco.com X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 27 Oct 2023 11:05:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780932918087147668 X-GMAIL-MSGID: 1780932918087147668 Define an array to track IOs for the different queues, print the IO stats in fnic get stats data. Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Signed-off-by: Karan Tilak Kumar Reviewed-by: Hannes Reinecke --- drivers/scsi/fnic/fnic_stats.h | 2 ++ drivers/scsi/fnic/fnic_trace.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/scsi/fnic/fnic_stats.h b/drivers/scsi/fnic/fnic_stats.h index 07d1556e3c32..9d7f98c452dd 100644 --- a/drivers/scsi/fnic/fnic_stats.h +++ b/drivers/scsi/fnic/fnic_stats.h @@ -2,6 +2,7 @@ /* Copyright 2013 Cisco Systems, Inc. All rights reserved. */ #ifndef _FNIC_STATS_H_ #define _FNIC_STATS_H_ +#define FNIC_MQ_MAX_QUEUES 64 struct stats_timestamps { struct timespec64 last_reset_time; @@ -26,6 +27,7 @@ struct io_path_stats { atomic64_t io_btw_10000_to_30000_msec; atomic64_t io_greater_than_30000_msec; atomic64_t current_max_io_time; + atomic64_t ios[FNIC_MQ_MAX_QUEUES]; }; struct abort_stats { diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c index be0d7c57b242..aaa4ea02fb7c 100644 --- a/drivers/scsi/fnic/fnic_trace.c +++ b/drivers/scsi/fnic/fnic_trace.c @@ -204,6 +204,7 @@ int fnic_get_stats_data(struct stats_debug_info *debug, int len = 0; int buf_size = debug->buf_size; struct timespec64 val1, val2; + int i = 0; ktime_get_real_ts64(&val1); len = scnprintf(debug->debug_buffer + len, buf_size - len, @@ -266,6 +267,16 @@ int fnic_get_stats_data(struct stats_debug_info *debug, (u64)atomic64_read(&stats->io_stats.io_btw_10000_to_30000_msec), (u64)atomic64_read(&stats->io_stats.io_greater_than_30000_msec)); + len += scnprintf(debug->debug_buffer + len, buf_size - len, + "------------------------------------------\n" + "\t\tIO Queues and cumulative IOs\n" + "------------------------------------------\n"); + + for (i = 0; i < FNIC_MQ_MAX_QUEUES; i++) { + len += scnprintf(debug->debug_buffer + len, buf_size - len, + "Q:%d -> %lld\n", i, (u64)atomic64_read(&stats->io_stats.ios[i])); + } + len += scnprintf(debug->debug_buffer + len, buf_size - len, "\nCurrent Max IO time : %lld\n", (u64)atomic64_read(&stats->io_stats.current_max_io_time));