From: Ranjan Kumar <ranjan.kumar@broadcom.com>
To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com
Cc: sathya.prakash@broadcom.com, chandrakanth.patil@broadcom.com,
Ranjan Kumar <ranjan.kumar@broadcom.com>
Subject: [PATCH v1 2/3] mpi3mr: Add queue-full tracking for operational request queues
Date: Fri, 20 Mar 2026 14:33:25 +0530 [thread overview]
Message-ID: <20260320090326.47544-3-ranjan.kumar@broadcom.com> (raw)
In-Reply-To: <20260320090326.47544-1-ranjan.kumar@broadcom.com>
Track queue-full conditions on operational request queues in the driver.
Record the last host tag returned to the SCSI mid-layer
and count I/Os affected by queue-full conditions.
Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
---
drivers/scsi/mpi3mr/mpi3mr.h | 12 ++++++++++++
drivers/scsi/mpi3mr/mpi3mr_fw.c | 16 ++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/drivers/scsi/mpi3mr/mpi3mr.h b/drivers/scsi/mpi3mr/mpi3mr.h
index da141c185eef..631a48f7425d 100644
--- a/drivers/scsi/mpi3mr/mpi3mr.h
+++ b/drivers/scsi/mpi3mr/mpi3mr.h
@@ -429,6 +429,14 @@ struct segments {
* @q_segments: Segment descriptor pointer
* @q_segment_list: Segment list base virtual address
* @q_segment_list_dma: Segment list base DMA address
+ * @last_full_host_tag: Hosttag of last IO returned to SML
+ * due to queue full
+ * @qfull_io_count: Number of IOs returned back to SML
+ * due to queue full
+ * @qfull_instances: Total queue full occurrences.One occurrence
+ * starts with queue full detection and ends
+ * with queue full breaks.
+ *
*/
struct op_req_qinfo {
u16 ci;
@@ -442,6 +450,10 @@ struct op_req_qinfo {
struct segments *q_segments;
void *q_segment_list;
dma_addr_t q_segment_list_dma;
+ u16 last_full_host_tag;
+ u64 qfull_io_count;
+ u32 qfull_instances;
+
};
/**
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index 58360666fb78..da0d475db01e 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -2362,6 +2362,9 @@ static int mpi3mr_create_op_req_q(struct mpi3mr_ioc *mrioc, u16 idx,
op_req_q->ci = 0;
op_req_q->pi = 0;
op_req_q->reply_qid = reply_qid;
+ op_req_q->last_full_host_tag = MPI3MR_HOSTTAG_INVALID;
+ op_req_q->qfull_io_count = 0;
+ op_req_q->qfull_instances = 0;
spin_lock_init(&op_req_q->q_lock);
if (!op_req_q->q_segments) {
@@ -2549,6 +2552,8 @@ int mpi3mr_op_request_post(struct mpi3mr_ioc *mrioc,
u16 req_sz = mrioc->facts.op_req_sz;
struct segments *segments = op_req_q->q_segments;
struct op_reply_qinfo *op_reply_q = NULL;
+ struct mpi3_scsi_io_request *scsiio_req =
+ (struct mpi3_scsi_io_request *)req;
reply_qidx = op_req_q->reply_qid - 1;
op_reply_q = mrioc->op_reply_qinfo + reply_qidx;
@@ -2566,11 +2571,21 @@ int mpi3mr_op_request_post(struct mpi3mr_ioc *mrioc,
mpi3mr_process_op_reply_q(mrioc, mrioc->intr_info[midx].op_reply_q);
if (mpi3mr_check_req_qfull(op_req_q)) {
+
+ if (op_req_q->last_full_host_tag ==
+ MPI3MR_HOSTTAG_INVALID)
+ op_req_q->qfull_instances++;
+
+ op_req_q->last_full_host_tag = scsiio_req->host_tag;
+ op_req_q->qfull_io_count++;
retval = -EAGAIN;
goto out;
}
}
+ if (op_req_q->last_full_host_tag != MPI3MR_HOSTTAG_INVALID)
+ op_req_q->last_full_host_tag = MPI3MR_HOSTTAG_INVALID;
+
if (mrioc->reset_in_progress) {
ioc_err(mrioc, "OpReqQ submit reset in progress\n");
retval = -EAGAIN;
@@ -4829,6 +4844,7 @@ void mpi3mr_memset_buffers(struct mpi3mr_ioc *mrioc)
mrioc->req_qinfo[i].qid = 0;
mrioc->req_qinfo[i].reply_qid = 0;
spin_lock_init(&mrioc->req_qinfo[i].q_lock);
+ mrioc->req_qinfo[i].last_full_host_tag = 0;
mpi3mr_memset_op_req_q_buffers(mrioc, i);
}
}
--
2.47.3
next prev parent reply other threads:[~2026-03-20 9:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 9:03 [PATCH v1 0/3] mpi3mr: Enhancements for mpi3mr Ranjan Kumar
2026-03-20 9:03 ` [PATCH v1 1/3] mpi3mr: Reset controller on invalid I/O completion Ranjan Kumar
2026-03-20 9:03 ` Ranjan Kumar [this message]
2026-03-20 9:03 ` [PATCH v1 3/3] mpi3mr: Add retry mechanism for IOC shutdown with timeout reset Ranjan Kumar
2026-03-27 21:11 ` [PATCH v1 0/3] mpi3mr: Enhancements for mpi3mr Martin K. Petersen
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=20260320090326.47544-3-ranjan.kumar@broadcom.com \
--to=ranjan.kumar@broadcom.com \
--cc=chandrakanth.patil@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sathya.prakash@broadcom.com \
/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