From: Andreas Hindborg <nmi@metaspace.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
Hans Holmberg <Hans.Holmberg@wdc.com>,
Andreas Hindborg <a.hindborg@samsung.com>,
linux-block@vger.kernel.org (open list:BLOCK LAYER),
linux-kernel@vger.kernel.org (open list),
Johannes Thumshirn <jth@kernel.org>,
Damien Le Moal <dlemoal@kernel.org>,
Matias Bjorling <Matias.Bjorling@wdc.com>,
Christoph Hellwig <hch@infradead.org>,
Minwoo Im <minwoo.im.dev@gmail.com>,
gost.dev@samsung.com, Aravind Ramesh <Aravind.Ramesh@wdc.com>
Subject: [PATCH v7 1/3] ublk: add opcode offsets for DRV_IN/DRV_OUT
Date: Mon, 10 Jul 2023 08:46:04 +0200 [thread overview]
Message-ID: <20230710064607.155155-2-nmi@metaspace.dk> (raw)
In-Reply-To: <20230710064607.155155-1-nmi@metaspace.dk>
From: Andreas Hindborg <a.hindborg@samsung.com>
Ublk zoned storage support relies on DRV_IN handling for zone report.
Prepare for this change by adding offsets for the DRV_IN/DRV_OUT commands.
Suggested-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Andreas Hindborg <a.hindborg@samsung.com>
---
include/uapi/linux/ublk_cmd.h | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/include/uapi/linux/ublk_cmd.h b/include/uapi/linux/ublk_cmd.h
index 4b8558db90e1..521a0d2fbc06 100644
--- a/include/uapi/linux/ublk_cmd.h
+++ b/include/uapi/linux/ublk_cmd.h
@@ -229,12 +229,23 @@ struct ublksrv_ctrl_dev_info {
__u64 reserved2;
};
-#define UBLK_IO_OP_READ 0
+#define UBLK_IO_OP_READ 0
#define UBLK_IO_OP_WRITE 1
#define UBLK_IO_OP_FLUSH 2
-#define UBLK_IO_OP_DISCARD 3
-#define UBLK_IO_OP_WRITE_SAME 4
-#define UBLK_IO_OP_WRITE_ZEROES 5
+#define UBLK_IO_OP_DISCARD 3
+#define UBLK_IO_OP_WRITE_SAME 4
+#define UBLK_IO_OP_WRITE_ZEROES 5
+/*
+ * Ublk passthrough operation code ranges, and each passthrough operation
+ * provides generic interface between ublk kernel driver and ublk userspace, and
+ * this interface is usually used for handling generic block layer request, such
+ * as command of zoned report zones. Passthrough operation is only needed iff
+ * ublk kernel driver has to be involved for handling this operation.
+ */
+#define __UBLK_IO_OP_DRV_IN_START 32
+#define __UBLK_IO_OP_DRV_IN_END 96
+#define __UBLK_IO_OP_DRV_OUT_START __UBLK_IO_OP_DRV_IN_END
+#define __UBLK_IO_OP_DRV_OUT_END 160
#define UBLK_IO_F_FAILFAST_DEV (1U << 8)
#define UBLK_IO_F_FAILFAST_TRANSPORT (1U << 9)
--
2.41.0
next prev parent reply other threads:[~2023-07-10 6:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 6:46 [PATCH v7 0/3] ublk: enable zoned storage support Andreas Hindborg
2023-07-10 6:46 ` Andreas Hindborg [this message]
2023-07-10 6:54 ` [PATCH v7 1/3] ublk: add opcode offsets for DRV_IN/DRV_OUT Christoph Hellwig
2023-07-10 6:46 ` [PATCH v7 2/3] ublk: add helper to check if device supports user copy Andreas Hindborg
2023-07-10 6:46 ` [PATCH v7 3/3] ublk: enable zoned storage support Andreas Hindborg
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=20230710064607.155155-2-nmi@metaspace.dk \
--to=nmi@metaspace.dk \
--cc=Aravind.Ramesh@wdc.com \
--cc=Hans.Holmberg@wdc.com \
--cc=Matias.Bjorling@wdc.com \
--cc=a.hindborg@samsung.com \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=gost.dev@samsung.com \
--cc=hch@infradead.org \
--cc=jth@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=minwoo.im.dev@gmail.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
all inboxes | Powered by JetHome®