From patchwork Wed Dec 6 18:46:10 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: 174702 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4308769vqy; Wed, 6 Dec 2023 10:47:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFiGCtTJKWvi/tzjoBvtJpOKj4NsI3UqOV2EbY3sLeuFjIhmdCy/AvVxEc9h+V/g8GO8sPR X-Received: by 2002:a17:902:d505:b0:1d0:7d9a:3bc3 with SMTP id b5-20020a170902d50500b001d07d9a3bc3mr1060846plg.79.1701888472189; Wed, 06 Dec 2023 10:47:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701888472; cv=none; d=google.com; s=arc-20160816; b=RB5/tXqkgOriPHdaLMvHdFYYPtHxRyA29ZoD5vhBYZHj4THOLuMnEyYyg1nGWywXiu /G/y8nKaGv9AQ+f2QIjmUcnk67+XixdKlkGwuZRUeD8eyODL0x6wvmCWkdWrAeHzcp19 E2aRo6GluIxTs8eqdFQZ59DqEVrhGD6ljnPYYuoU1pXb1Gcuh0HxLTP9gvg3EXPJaVo/ F0SotGtnxCzUoav3J8Z8+Lnf5To7mcdClt1Y27/7UnjFpSwkVVvsx/lvqu3yA61Ejg2W m+4IzoBgK4iASuwRrHq5uIP0fnNFz2ZhnhOHQrk2bSygXAvgPVAYjv5NICtf/Vp2drC2 gtNQ== 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=ov+22JfMWX71JUrjb9pbSfvsIvqm6DfNrkyUATv3g3I=; fh=cjiSjcSDv/XIT1wsutvtplR3SRaqRNwT1M35P++mOs8=; b=aJBNRfmll0MH02Si4VD6RhnSe+gRql49Y+68yLeRLQldABcbNsln8kTci5D7RIbtId l9fF9Gl1ARZ6P/GkdRPZcsdpckfJIVOyFJrFt9tooamIFjQFZTDbyEOkWZB5YC4VGUNg in1gNcG+k6vD7cje9s40Kvtetd7cU9BfgRcm42j8kRn7c37qt23R0RZx7k7hJo5fBwsy 0PIP0ZB7mfTwvR3fuOMHdnezAu+zTnh2nNP0Qh4lHDi+EWdcD3fboFX5wtNVI+6VkCjO K40mu2S4QY1SPl+j/HJjFyEm4YM2bQPDvtpwocv1fHB2ipcwpSq0D7seIdLbX36d5872 Ov8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b="W5/3ZO8k"; 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 x16-20020a170902ec9000b001ce5ba27888si215235plg.211.2023.12.06.10.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 10:47:52 -0800 (PST) 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="W5/3ZO8k"; 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 6740D80E8565; Wed, 6 Dec 2023 10:47:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379227AbjLFSrX (ORCPT + 99 others); Wed, 6 Dec 2023 13:47:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379214AbjLFSrI (ORCPT ); Wed, 6 Dec 2023 13:47:08 -0500 Received: from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABB231720; Wed, 6 Dec 2023 10:46:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2379; q=dns/txt; s=iport; t=1701888420; x=1703098020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aqgGUKGQBVUTfW7p4uxQ1YKLQ3kFd6K4NBe7f3cePAw=; b=W5/3ZO8kNSvsGHSvRP3FUGyPfw0OCcGAJyTxBbNavhKSVWEIXPWnR/A1 yZLK3hfl93x/GXmcUmZy1Ls4KRnDWgd8bWyoVBReCji372X6AtddYtjbd 9SMTEiJ9U0TeiktcgDVgSlFQoSZrEdjxOV6EulZ4HsPg0QCZPfmUnmxd6 8=; X-CSE-ConnectionGUID: wcJqkZT2S+OtECZk0+AXxQ== X-CSE-MsgGUID: WK3/Jk28S8eXbwLcutsI2A== X-IronPort-AV: E=Sophos;i="6.04,256,1695686400"; d="scan'208";a="155948888" Received: from alln-core-4.cisco.com ([173.36.13.137]) by rcdn-iport-2.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2023 18:46:58 +0000 Received: from localhost.cisco.com ([10.193.101.253]) (authenticated bits=0) by alln-core-4.cisco.com (8.15.2/8.15.2) with ESMTPSA id 3B6IkHD4010013 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Dec 2023 18:46:57 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 , Hannes Reinecke Subject: [PATCH v5 08/13] scsi: fnic: Define stats to track multiqueue (MQ) IOs Date: Wed, 6 Dec 2023 10:46:10 -0800 Message-Id: <20231206184615.878755-9-kartilak@cisco.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231206184615.878755-1-kartilak@cisco.com> References: <20231206184615.878755-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: alln-core-4.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,T_SCC_BODY_TEXT_LINE, 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]); Wed, 06 Dec 2023 10:47:49 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784559406833628653 X-GMAIL-MSGID: 1784559406833628653 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 Reviewed-by: Hannes Reinecke 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));