Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1231563rdb; Fri, 20 Oct 2023 12:07:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE66jBBaJKowHt3jOTS88eDeB/zKQc3AmBPY+K4h1AZ6oK/HOv31SEZXxYg7m8H9qGWpur8 X-Received: by 2002:a17:90b:4b87:b0:27d:5562:7e13 with SMTP id lr7-20020a17090b4b8700b0027d55627e13mr2577606pjb.39.1697828865591; Fri, 20 Oct 2023 12:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697828865; cv=none; d=google.com; s=arc-20160816; b=OtaZXk1yMUlOT4n2/jv2Gv+ziRcCExg8OQtm/Qaaek7xMuFf0WyVGPQv/NAJ7+hCX4 nys48aXfVM1GPv/ZLhz111HsggUw4OJoR7JtVbBzgytOoah9K6TJMuyq5xCqiI0MG3Nd Gqu5GnMD5jLOydPdU21919e/MNwiYWXTXPD3dpfWQ/l4KrocGQPZUh3+0dzQQ99OAmlS 7b7zMnDbaUdThxNXfDZDXpKeGJ8MT/f9xusHG3jhv43WI655xLEtVRYTpcYdoUmP/3cK qDzHLrwawxaJaxQFYWFtSuD6/ucY/pJ+cpDQf8/MSgpr9F+8a6r1mfGww/9a2FH0Pu7c ZPhA== 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=a+FsOlHpiQzODMnk4wyizFOZ1l6nEMpaiTXB7aVlvVrv1dIyZJGKOFtT5yfnjsyQf0 Zi5d71kJArjnEXIC2B4QHahbWNr1+baIx9P/FyTyqDPXmWA2GdgynUIa/bfHYX2qZS6t bZl0DPGbEuJYw8dL3vpJyg3iuMwJkzClKGrL3Ten4nCz9QS9JVgVwXrww/OpCq1De0ul UMoycoo2S7v+fvKm4ApMz8ICEE3OdG2dzydQGU3Gv5gnQqPT28FAQdyHcjMO+SP3D/jI Il6GW4Q4zEkaqXzje9J0PraSe5BY+ylu8S+05dMh7QTDIdJEJiNe7TxV27U9Lb8Cb2bu 5hfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=WE7WbTRA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id ie10-20020a17090b400a00b0027d3c6f8ab2si2347290pjb.66.2023.10.20.12.07.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 12:07:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=WE7WbTRA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 9447C83F699B; Fri, 20 Oct 2023 12:07:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231354AbjJTTHd (ORCPT + 99 others); Fri, 20 Oct 2023 15:07:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230371AbjJTTHT (ORCPT ); Fri, 20 Oct 2023 15:07:19 -0400 Received: from rcdn-iport-7.cisco.com (rcdn-iport-7.cisco.com [173.37.86.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C74C10E7; Fri, 20 Oct 2023 12:07:15 -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=1697828835; x=1699038435; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fv30yt0LjIxxDkJmPu1aq2CxwjmyWduwzcIDXyk48UI=; b=WE7WbTRApBnG3u2KC99W6ZnMJfasi1zo0z0GgqBN1y3v0xOjFyndnpXF +F+1HAVksHvZR0Gj2Gxg7mWVZW35mfLM4ub8bNGKlmkvwdv6Cs4a2gHmg +o6/9C2+s3p5gOs2wfyvmC3aLfW5chQEhb318HHIOhmxtJ7I5+dkjTSRH U=; X-CSE-ConnectionGUID: /f4vCI4+SCy2t33xxkI+0A== X-CSE-MsgGUID: Gj2Be+N3Qfa5FTHTijoMvA== X-IronPort-AV: E=Sophos;i="6.03,239,1694736000"; d="scan'208";a="126421357" Received: from rcdn-core-11.cisco.com ([173.37.93.147]) by rcdn-iport-7.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2023 19:07:15 +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 39KJ6XPK026372 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 20 Oct 2023 19:07:14 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 08/13] scsi: fnic: Define stats to track multiqueue (MQ) IOs Date: Fri, 20 Oct 2023 12:06:24 -0700 Message-Id: <20231020190629.338623-9-kartilak@cisco.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231020190629.338623-1-kartilak@cisco.com> References: <20231020190629.338623-1-kartilak@cisco.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 12:07:42 -0700 (PDT) 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 --- 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)); -- 2.31.1