Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Karan Tilak Kumar" <kartilak@cisco.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v6 11/13] scsi: fnic: Track NVMe transport statistics
Date: Fri, 24 Jul 2026 18:31:02 +0000	[thread overview]
Message-ID: <20260724183102.79DF31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260724174811.5118-12-kartilak@cisco.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Wait queue timeout and NVMe response metrics are declared and read, but never populated.
--

--- Patch [11]: [PATCH v6 11/13] scsi: fnic: Track NVMe transport statistics ---
commit 9923585e497ab09ae056c5f083aec96413fc2a32
Author: Karan Tilak Kumar <kartilak@cisco.com>

scsi: fnic: Track NVMe transport statistics

This commit adds counters for NVMe requests, responses, LS handling, aborts,
and wait-queue activity. It also updates NVMe I/O, completion, LS response,
LS abort, and abort paths to maintain the new counters.

Closes: https://lore.kernel.org/oe-kbuild-all/202605280619.pmobiDWp-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202605280519.Jd4fmgAZ-lkp@intel.com/

> diff --git a/drivers/scsi/fnic/fnic_nvme.c b/drivers/scsi/fnic/fnic_nvme.c
> --- a/drivers/scsi/fnic/fnic_nvme.c
> +++ b/drivers/scsi/fnic/fnic_nvme.c

[ ... ]

> @@ -1755,6 +1912,15 @@ void nvfnic_fcpio_abort(struct nvme_fc_local_port *lport,
>  		FNIC_NVME_DBG(KERN_INFO, fnic,
>  			      "cmd tag freed or not issued:0x%x sn:0x%08x\n",
>  			      io_req->tag, be32_to_cpu(cmd_iu->csn));
> +		num_ios_waitq =
> +		    atomic64_read(&fnic_stats->io_stats.nvme_num_ios_in_waitq);
> +		waitq_2sec =
> +		    atomic64_read(&fnic_stats->io_stats.nvme_ios_in_waitq_3000_msec);
> +		waitq_max_time =
> +		    atomic64_read(&fnic_stats->io_stats.nvme_ios_in_waitq_max_time);
> +		FNIC_NVME_DBG(KERN_INFO, fnic,
> +			      "waitq:%ld waitq_2sec:%ld max_wait:%ld\n",
> +			      num_ios_waitq, waitq_2sec, waitq_max_time);
>  		spin_unlock_irqrestore(&fnic->fnic_lock, flags);
>  		return;
>  	}

[ ... ]

> @@ -1855,6 +2038,7 @@ void nvfnic_nvme_iodone_work(struct work_struct *work)
>  	llnode = llist_del_all(&fnic->nvme_io_event_llist);
>  	llist_for_each_entry_safe(io_req, tmp, llnode, nvfnic_io_cmpl) {
>  		atomic_dec(&fnic->nvme_io_event_queued);
> +		atomic64_dec(&fnic->fnic_stats.io_stats.nvme_num_ios_in_waitq);
>  		io_req->fcp_req->done(io_req->fcp_req);
>  	}
>  }

[Severity: Medium]
Are we missing the logic to calculate and populate the wait queue duration 
metrics?

The nvme_ios_in_waitq_3000_msec and nvme_ios_in_waitq_max_time counters are 
read and logged in nvfnic_fcpio_abort(), but it appears they are never 
populated anywhere in the code. Should they be updated here in 
nvfnic_nvme_iodone_work() using io_req->waitq_start_time when processing 
the completion?

> diff --git a/drivers/scsi/fnic/fnic_stats.h b/drivers/scsi/fnic/fnic_stats.h
> --- a/drivers/scsi/fnic/fnic_stats.h
> +++ b/drivers/scsi/fnic/fnic_stats.h

[ ... ]

> @@ -29,6 +29,15 @@ struct io_path_stats {
>  	atomic64_t io_greater_than_30000_msec;
>  	atomic64_t current_max_io_time;
>  	atomic64_t ios[FNIC_MQ_MAX_QUEUES];
> +
> +	atomic64_t nvme_io_reqs_rcvd;
> +	atomic64_t nvme_ios_queued_for_rsp;
> +	atomic64_t nvme_io_rsps_unqueued;
> +	atomic64_t nvme_io_rsps_sending;
> +	atomic64_t nvme_io_rsps_sent;
> +	atomic64_t nvme_num_ios_in_waitq;
> +	atomic64_t nvme_ios_in_waitq_3000_msec;
> +	atomic64_t nvme_ios_in_waitq_max_time;
>  };

[Severity: Medium]
In addition to the wait queue metrics mentioned above, does this code also 
leave nvme_io_rsps_unqueued and nvme_io_rsps_sending completely unpopulated? 
They appear to be declared here but are never updated or read in the modified 
code.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260724174811.5118-1-kartilak@cisco.com?part=11

  reply	other threads:[~2026-07-24 18:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 17:47 [PATCH v6 00/13] Introduce functionality for NVMe initiator Karan Tilak Kumar
2026-07-24 17:47 ` [PATCH v6 01/13] scsi: fnic: Make debug logging protocol independent Karan Tilak Kumar
2026-07-24 18:16   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 02/13] scsi: fnic: Use fnic_num for non-SCSI identifiers Karan Tilak Kumar
2026-07-24 18:09   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 03/13] scsi: fnic: Decode firmware role configuration Karan Tilak Kumar
2026-07-24 18:07   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 04/13] scsi: fnic: Advertise NVMe initiator service parameters Karan Tilak Kumar
2026-07-24 18:05   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 05/13] scsi: fnic: Add FDLS role handling for NVMe initiators Karan Tilak Kumar
2026-07-24 18:54   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 06/13] scsi: fnic: Add the NVMe/FC transport path Karan Tilak Kumar
2026-07-24 18:20   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 07/13] scsi: fnic: Route completions and resets by initiator role Karan Tilak Kumar
2026-07-24 18:26   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 08/13] scsi: fnic: Handle NVMe LS frames in FDLS Karan Tilak Kumar
2026-07-24 18:17   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 09/13] scsi: fnic: Send NVMe LS requests through FDLS Karan Tilak Kumar
2026-07-24 18:16   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 10/13] scsi: fnic: Abort timed-out NVMe LS requests Karan Tilak Kumar
2026-07-24 18:26   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 11/13] scsi: fnic: Track NVMe transport statistics Karan Tilak Kumar
2026-07-24 18:31   ` sashiko-bot [this message]
2026-07-24 17:48 ` [PATCH v6 12/13] scsi: fnic: Expose NVMe transport state in debugfs Karan Tilak Kumar
2026-07-24 18:25   ` sashiko-bot
2026-07-24 17:48 ` [PATCH v6 13/13] scsi: fnic: Bump up version number Karan Tilak Kumar
2026-07-24 18:18   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260724183102.79DF31F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kartilak@cisco.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox