From: mhkelley58@gmail.com
To: kbusch@kernel.org, axboe@kernel.dk, sagi@grimberg.me,
James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, kys@microsoft.com,
haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
robin.murphy@arm.com, hch@lst.de, m.szyprowski@samsung.com,
petr@tesarici.cz, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
linux-scsi@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-coco@lists.linux.dev
Subject: [RFC 6/7] nvme: Move BLK_MQ_F_BLOCKING indicator to struct nvme_ctrl
Date: Thu, 22 Aug 2024 11:37:17 -0700 [thread overview]
Message-ID: <20240822183718.1234-7-mhklinux@outlook.com> (raw)
In-Reply-To: <20240822183718.1234-1-mhklinux@outlook.com>
From: Michael Kelley <mhklinux@outlook.com>
The NVMe setting that controls the BLK_MQ_F_BLOCKING flag on the
request queue is currently a flag in struct nvme_ctrl_ops, where
it is not writable. A new use case needs this flag to be writable
based on a determination made during the NVMe device probe function.
Move this setting to struct nvme_ctrl, and update the only user to
set it in the new location.
No functional change.
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
---
drivers/nvme/host/core.c | 4 ++--
drivers/nvme/host/nvme.h | 2 +-
drivers/nvme/host/tcp.c | 3 ++-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 33fa01c599ad..f1ce325471f1 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4495,7 +4495,7 @@ int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
set->reserved_tags = 2;
set->numa_node = ctrl->numa_node;
set->flags = BLK_MQ_F_NO_SCHED;
- if (ctrl->ops->flags & NVME_F_BLOCKING)
+ if (ctrl->blocking)
set->flags |= BLK_MQ_F_BLOCKING;
set->cmd_size = cmd_size;
set->driver_data = ctrl;
@@ -4565,7 +4565,7 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
set->reserved_tags = 1;
set->numa_node = ctrl->numa_node;
set->flags = BLK_MQ_F_SHOULD_MERGE;
- if (ctrl->ops->flags & NVME_F_BLOCKING)
+ if (ctrl->blocking)
set->flags |= BLK_MQ_F_BLOCKING;
set->cmd_size = cmd_size,
set->driver_data = ctrl;
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index ae5314d32943..28709f166cab 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -338,6 +338,7 @@ struct nvme_ctrl {
unsigned int shutdown_timeout;
unsigned int kato;
bool subsystem;
+ bool blocking;
unsigned long quirks;
struct nvme_id_power_state psd[32];
struct nvme_effects_log *effects;
@@ -546,7 +547,6 @@ struct nvme_ctrl_ops {
unsigned int flags;
#define NVME_F_FABRICS (1 << 0)
#define NVME_F_METADATA_SUPPORTED (1 << 1)
-#define NVME_F_BLOCKING (1 << 2)
const struct attribute_group **dev_attr_groups;
int (*reg_read32)(struct nvme_ctrl *ctrl, u32 off, u32 *val);
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 9ea6be0b0392..6b9fdf7dc1ac 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2658,7 +2658,7 @@ static const struct blk_mq_ops nvme_tcp_admin_mq_ops = {
static const struct nvme_ctrl_ops nvme_tcp_ctrl_ops = {
.name = "tcp",
.module = THIS_MODULE,
- .flags = NVME_F_FABRICS | NVME_F_BLOCKING,
+ .flags = NVME_F_FABRICS,
.reg_read32 = nvmf_reg_read32,
.reg_read64 = nvmf_reg_read64,
.reg_write32 = nvmf_reg_write32,
@@ -2762,6 +2762,7 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev,
if (ret)
goto out_kfree_queues;
+ ctrl->ctrl.blocking = true;
return ctrl;
out_kfree_queues:
kfree(ctrl->queues);
--
2.25.1
next prev parent reply other threads:[~2024-08-22 18:37 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 18:37 [RFC 0/7] Introduce swiotlb throttling mhkelley58
2024-08-22 18:37 ` [RFC 1/7] swiotlb: " mhkelley58
2024-08-23 7:41 ` Petr Tesařík
2024-08-23 20:41 ` Michael Kelley
2024-08-27 15:55 ` Petr Tesařík
2024-08-27 17:30 ` Michael Kelley
2024-08-28 5:15 ` Petr Tesařík
2024-08-28 6:14 ` Michael Kelley
2024-08-22 18:37 ` [RFC 2/7] dma: Handle swiotlb throttling for SGLs mhkelley58
2024-08-23 8:02 ` Petr Tesařík
2024-08-23 20:42 ` Michael Kelley
2024-08-24 19:56 ` Petr Tesařík
2024-08-22 18:37 ` [RFC 3/7] dma: Add function for drivers to know if allowing blocking is useful mhkelley58
2024-08-23 8:07 ` Petr Tesařík
2024-08-22 18:37 ` [RFC 4/7] scsi_lib_dma: Add _attrs variant of scsi_dma_map() mhkelley58
2024-08-23 8:08 ` Petr Tesařík
2024-08-22 18:37 ` [RFC 5/7] scsi: storvsc: Enable swiotlb throttling mhkelley58
2024-08-23 8:19 ` Petr Tesařík
2024-08-23 20:42 ` Michael Kelley
2024-08-22 18:37 ` mhkelley58 [this message]
2024-08-23 8:22 ` [RFC 6/7] nvme: Move BLK_MQ_F_BLOCKING indicator to struct nvme_ctrl Petr Tesařík
2024-08-22 18:37 ` [RFC 7/7] nvme: Enable swiotlb throttling for NVMe PCI devices mhkelley58
2024-08-23 8:26 ` Petr Tesařík
2024-08-22 19:29 ` [RFC 0/7] Introduce swiotlb throttling Bart Van Assche
2024-08-23 2:20 ` Michael Kelley
2024-08-23 5:46 ` Petr Tesařík
2024-08-24 8:05 ` hch
2024-08-23 6:44 ` Petr Tesařík
2024-08-23 20:40 ` Michael Kelley
2024-08-24 20:05 ` Petr Tesařík
2024-08-26 16:24 ` Michael Kelley
2024-08-26 19:28 ` Petr Tesařík
2024-08-27 0:26 ` Michael Kelley
2024-08-27 8:00 ` Petr Tesařík
2024-08-24 8:16 ` Christoph Hellwig
2024-08-26 15:27 ` Michael Kelley
2024-08-27 7:14 ` Christoph Hellwig
2024-08-28 12:02 ` Robin Murphy
2024-08-28 13:03 ` Petr Tesařík
2024-08-28 16:30 ` Michael Kelley
2024-08-28 16:41 ` Petr Tesařík
2024-08-28 19:50 ` Robin Murphy
2024-08-30 3:58 ` Michael Kelley
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=20240822183718.1234-7-mhklinux@outlook.com \
--to=mhkelley58@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=axboe@kernel.dk \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=kbusch@kernel.org \
--cc=kys@microsoft.com \
--cc=linux-coco@lists.linux.dev \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=martin.petersen@oracle.com \
--cc=mhklinux@outlook.com \
--cc=petr@tesarici.cz \
--cc=robin.murphy@arm.com \
--cc=sagi@grimberg.me \
--cc=wei.liu@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;
as well as URLs for NNTP newsgroup(s).