From patchwork Fri Oct 20 19:06:24 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: 156280 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp1268930vqb; Fri, 20 Oct 2023 12:07:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFp7avGr4lsgQQvvn6MzkJfuZjFW7pnFSj4zbAFoI+7lhr25NrlXsuOvXwcc+txakI/b3f/ X-Received: by 2002:a17:903:22cd:b0:1ca:8169:e84b with SMTP id y13-20020a17090322cd00b001ca8169e84bmr3448688plg.14.1697828875079; Fri, 20 Oct 2023 12:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697828875; cv=none; d=google.com; s=arc-20160816; b=d9Y/Y3AWBALj8kMg+18hR0F0tG47Hd+hUjW8qtfp4oALSDg95Ol1mIY96hld/11hE2 a5dZHPIKD54TauH8Lp4efK/AycSpHKPI3J0UlZellrjM62iRfeqQqEhXmtAKrDMPPcLG BYHEYmsFk9afuJZIDiZAe/IutEVJ/fVNucBeS/mCtlyvsGdlpwU2gNF/Xr9bnB3kuscR HpqBF+wWWXerTRXsKpxEu1xQFW+abePQskIsch/aYtRPtfnJYpqL/zsFom8PDQFYtzif wzh5COZ/ftUCddn+F4+ceVcvOPmLG5DgKKhTbj7Qe0iQTNo4VwuwmS78sehgRYx5tD49 s1pQ== 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 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id x3-20020a170902ea8300b001c9d22299e2si2421915plb.437.2023.10.20.12.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 12:07:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; 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 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id E7C218075591; Fri, 20 Oct 2023 12:07:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231383AbjJTTHd (ORCPT + 26 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 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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 20 Oct 2023 12:07:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780302610387303923 X-GMAIL-MSGID: 1780302610387303923 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));