From: Hannes Reinecke <hare@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>, Keith Busch <kbusch@kernel.org>,
linux-nvme@lists.infradead.org, Hannes Reinecke <hare@kernel.org>
Subject: [PATCH] nvmet: make 'tsas' attribute idempotent for RDMA
Date: Fri, 14 Jun 2024 12:44:45 +0200 [thread overview]
Message-ID: <20240614104445.105041-1-hare@kernel.org> (raw)
The RDMA transport defines values for TSAS, but it cannot be changed.
To avoid errors during reconfiguration allow to write the current
value.
Fixes: 3f123494db72 ("nvmet: make TCP sectype settable via configfs")
Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
drivers/nvme/target/configfs.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index e60224356048..7dce276464a6 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -424,6 +424,17 @@ static ssize_t nvmet_addr_tsas_store(struct config_item *item,
if (nvmet_is_port_enabled(port, __func__))
return -EACCES;
+ if (port->disc_addr.trtype == NVMF_TRTYPE_RDMA) {
+ for (i = 0; i < ARRAY_SIZE(nvmet_addr_tsas_rdma); i++) {
+ u8 qptype;
+
+ if (sysfs_streq(page, nvmet_addr_tsas_rdma[i].name)) {
+ qptype = nvmet_addr_tsas_rdma[i].type;
+ if (qptype == port->disc_addr.tsas.rdma.qptype)
+ return count;
+ }
+ }
+ }
if (port->disc_addr.trtype != NVMF_TRTYPE_TCP)
return -EINVAL;
--
2.35.3
next reply other threads:[~2024-06-14 10:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 10:44 Hannes Reinecke [this message]
2024-06-14 16:49 ` [PATCH] nvmet: make 'tsas' attribute idempotent for RDMA Christoph Hellwig
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=20240614104445.105041-1-hare@kernel.org \
--to=hare@kernel.org \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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).