From patchwork Wed Mar 1 00:15:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satish Kharat X-Patchwork-Id: 9597229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2EC7760414 for ; Wed, 1 Mar 2017 00:30:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 206842833C for ; Wed, 1 Mar 2017 00:30:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 153B7283E8; Wed, 1 Mar 2017 00:30:11 +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=-14.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL 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 878522833C for ; Wed, 1 Mar 2017 00:30:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751675AbdCAAaE (ORCPT ); Tue, 28 Feb 2017 19:30:04 -0500 Received: from alln-iport-5.cisco.com ([173.37.142.92]:24425 "EHLO alln-iport-5.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751646AbdCAAaC (ORCPT ); Tue, 28 Feb 2017 19:30:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2560; q=dns/txt; s=iport; t=1488328202; x=1489537802; h=from:to:cc:subject:date:message-id; bh=jf5IqXEhmcH42O0JptyHeEs60IuA1GbITM20c8UGynU=; b=MyfRFLWdx2pZMd9JPeAbKN1YVjLOF8Ocjdu7HWdLazr4Rg9G3SYoZUn8 8gJMgytHTfWq0xOBiP9tFgXhGFyDcZMGse/i7RQr70Ps29OISFugdQm1Z C2rbk346br40j+1j0gxYAO/+hgzp/0uT2WzRnSsyw4QL97vcgznIvdAIt o=; X-IronPort-AV: E=Sophos;i="5.35,222,1484006400"; d="scan'208";a="389912667" Received: from rcdn-core-11.cisco.com ([173.37.93.147]) by alln-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2017 00:15:46 +0000 Received: from satishkh.cisco.com ([10.157.132.70]) by rcdn-core-11.cisco.com (8.14.5/8.14.5) with ESMTP id v210Fji0026782; Wed, 1 Mar 2017 00:15:46 GMT From: Satish Kharat To: linux-scsi@vger.kernel.org Cc: satishkh@cisco.com, sebaddel@cisco.com Subject: [PATCH 1/1] fnic: Adding Check Condition counter to misc fnicstats Date: Tue, 28 Feb 2017 16:15:44 -0800 Message-Id: <1488327344-8817-1-git-send-email-satishkh@cisco.com> X-Mailer: git-send-email 2.5.5 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 Just a simple counter of number of check conditions encountered on that host. Signed-off-by: Satish Kharat Signed-off-by: Sesidhar Baddela --- drivers/scsi/fnic/fnic_scsi.c | 3 +++ drivers/scsi/fnic/fnic_stats.h | 1 + drivers/scsi/fnic/fnic_trace.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 2544a37..d3b32da 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -919,6 +919,9 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic, if (icmnd_cmpl->flags & FCPIO_ICMND_CMPL_RESID_UNDER) xfer_len -= icmnd_cmpl->residual; + if (icmnd_cmpl->scsi_status == SAM_STAT_CHECK_CONDITION) + atomic64_inc(&fnic_stats->misc_stats.check_condition); + if (icmnd_cmpl->scsi_status == SAM_STAT_TASK_SET_FULL) atomic64_inc(&fnic_stats->misc_stats.queue_fulls); break; diff --git a/drivers/scsi/fnic/fnic_stats.h b/drivers/scsi/fnic/fnic_stats.h index 540cceb8..69acdac 100644 --- a/drivers/scsi/fnic/fnic_stats.h +++ b/drivers/scsi/fnic/fnic_stats.h @@ -88,6 +88,7 @@ struct misc_stats { atomic64_t devrst_cpwq_alloc_failures; atomic64_t io_cpwq_alloc_failures; atomic64_t no_icmnd_itmf_cmpls; + atomic64_t check_condition; atomic64_t queue_fulls; atomic64_t rport_not_ready; atomic64_t frame_errors; diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c index 5a5fa01..ec20b3e 100644 --- a/drivers/scsi/fnic/fnic_trace.c +++ b/drivers/scsi/fnic/fnic_trace.c @@ -357,6 +357,7 @@ int fnic_get_stats_data(struct stats_debug_info *debug, "Number of Copy WQ Alloc Failures for Device Reset: %lld\n" "Number of Copy WQ Alloc Failures for IOs: %lld\n" "Number of no icmnd itmf Completions: %lld\n" + "Number of Check Conditions encountered: %lld\n" "Number of QUEUE Fulls: %lld\n" "Number of rport not ready: %lld\n" "Number of receive frame errors: %lld\n", @@ -377,6 +378,7 @@ int fnic_get_stats_data(struct stats_debug_info *debug, &stats->misc_stats.devrst_cpwq_alloc_failures), (u64)atomic64_read(&stats->misc_stats.io_cpwq_alloc_failures), (u64)atomic64_read(&stats->misc_stats.no_icmnd_itmf_cmpls), + (u64)atomic64_read(&stats->misc_stats.check_condition), (u64)atomic64_read(&stats->misc_stats.queue_fulls), (u64)atomic64_read(&stats->misc_stats.rport_not_ready), (u64)atomic64_read(&stats->misc_stats.frame_errors));