From: Mohamed Khalfella <mkhalfella@purestorage.com>
To: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Keith Busch <kbusch@kernel.org>
Cc: Hannes Reinecke <hare@suse.de>, Daniel Wagner <wagi@kernel.org>,
John Meneghini <jmeneghi@redhat.com>,
randyj@purestorage.com, adailey@purestorage.com,
jrani@purestorage.com, linux-nvme@lists.infradead.org,
linux-kernel@vger.kernel.org, mkhalfella@purestorage.com
Subject: [RFC PATCH v1 1/7] nvme-core: Read CQT wait from identify controller response
Date: Mon, 24 Mar 2025 10:48:54 -0700 [thread overview]
Message-ID: <20250324174909.3919131-2-mkhalfella@purestorage.com> (raw)
In-Reply-To: <20250324174909.3919131-1-mkhalfella@purestorage.com>
From: Jyoti Rani <jrani@purestorage.com>
CQT wait tells us how much time in milliseconds nvme controller needs to
quiesce pending nvme commands after learning loss of connectivity. Read
it from identify controller response and store it in struct nvme_ctrl in
cqt field. ctrl->cqt will be used later on to calculate the total time
inflight requests need to be held before they can be safely retried.
Signed-off-by: Jyoti Rani <jrani@purestorage.com>
---
drivers/nvme/host/core.c | 1 +
drivers/nvme/host/nvme.h | 1 +
include/linux/nvme.h | 4 +++-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 8359d0aa0e44..f4b3c6a42e90 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3364,6 +3364,7 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl)
ctrl->oaes = le32_to_cpu(id->oaes);
ctrl->wctemp = le16_to_cpu(id->wctemp);
ctrl->cctemp = le16_to_cpu(id->cctemp);
+ ctrl->cqt = le16_to_cpu(id->cqt);
atomic_set(&ctrl->abort_limit, id->acl + 1);
ctrl->vwc = id->vwc;
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 7be92d07430e..7563332b5b7b 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -344,6 +344,7 @@ struct nvme_ctrl {
u32 oaes;
u32 aen_result;
u32 ctratt;
+ u16 cqt;
unsigned int shutdown_timeout;
unsigned int kato;
bool subsystem;
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 2dc05b1c3283..7a94c01f0f06 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -361,7 +361,9 @@ struct nvme_id_ctrl {
__u8 anacap;
__le32 anagrpmax;
__le32 nanagrpid;
- __u8 rsvd352[160];
+ __u8 rsvd352[34];
+ __le16 cqt;
+ __u8 rsvd388[124];
__u8 sqes;
__u8 cqes;
__le16 maxcmd;
--
2.48.1
next prev parent reply other threads:[~2025-03-24 17:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 17:48 [RFC PATCH v1 0/7] nvme-tcp: Implement TP4129 (KATO Corrections and Clarifications) Mohamed Khalfella
2025-03-24 17:48 ` Mohamed Khalfella [this message]
2025-03-24 17:48 ` [RFC PATCH v1 2/7] nvmef: Add nvmef_req_hold_timeout_ms() to calculate kato request hold time Mohamed Khalfella
2025-03-24 17:48 ` [RFC PATCH v1 3/7] nvme-tcp: Move freeing tagset out of nvme_tcp_teardown_io_queues() Mohamed Khalfella
2025-03-24 17:48 ` [RFC PATCH v1 4/7] nvme-tcp: Move freeing admin tagset out of nvme_tcp_teardown_admin_queue() Mohamed Khalfella
2025-03-24 17:48 ` [RFC PATCH v1 5/7] nvme-tcp: Split nvme_tcp_teardown_io_queues() into two functions Mohamed Khalfella
2025-03-24 17:48 ` [RFC PATCH v1 6/7] nvme-core: Add support for holding inflight requests Mohamed Khalfella
2025-03-24 17:49 ` [RFC PATCH v1 7/7] nvme-tcp: Do not immediately cancel inflight requests during recovery Mohamed Khalfella
2025-11-13 20:04 ` [RFC PATCH v1 0/7] nvme-tcp: Implement TP4129 (KATO Corrections and Clarifications) Stuart Hayes
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=20250324174909.3919131-2-mkhalfella@purestorage.com \
--to=mkhalfella@purestorage.com \
--cc=adailey@purestorage.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jmeneghi@redhat.com \
--cc=jrani@purestorage.com \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=randyj@purestorage.com \
--cc=sagi@grimberg.me \
--cc=wagi@kernel.org \
/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
all inboxes | Powered by JetHome®