public inbox for [email protected]
 help / color / mirror / Atom feed
From: Keith Busch <[email protected]>
To: <[email protected]>, <[email protected]>, <[email protected]>,
	<[email protected]>, <[email protected]>,
	<[email protected]>
Cc: <[email protected]>, <[email protected]>,
	<[email protected]>, <[email protected]>,
	Keith Busch <[email protected]>
Subject: [PATCHv12 10/12] nvme.h: add FDP definitions
Date: Fri, 6 Dec 2024 14:17:59 -0800	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

From: Christoph Hellwig <[email protected]>

Add the config feature result, config log page, and management receive
commands needed for FDP.

Partially based on a patch from Kanchan Joshi <[email protected]>.

Signed-off-by: Christoph Hellwig <[email protected]>
[kbusch: renamed some fields to match spec]
Signed-off-by: Keith Busch <[email protected]>
---
 include/linux/nvme.h | 77 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 13377dde4527b..7680078fa67fd 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -275,6 +275,7 @@ enum nvme_ctrl_attr {
 	NVME_CTRL_ATTR_HID_128_BIT	= (1 << 0),
 	NVME_CTRL_ATTR_TBKAS		= (1 << 6),
 	NVME_CTRL_ATTR_ELBAS		= (1 << 15),
+	NVME_CTRL_ATTR_FDPS		= (1 << 19),
 };
 
 struct nvme_id_ctrl {
@@ -661,6 +662,44 @@ struct nvme_rotational_media_log {
 	__u8	rsvd24[488];
 };
 
+struct nvme_fdp_config {
+	__u8			flags;
+#define FDPCFG_FDPE	(1U << 0)
+	__u8			fdpcidx;
+	__le16			reserved;
+};
+
+struct nvme_fdp_ruh_desc {
+	__u8			ruht;
+	__u8			reserved[3];
+};
+
+struct nvme_fdp_config_desc {
+	__le16			dsze;
+	__u8			fdpa;
+	__u8			vss;
+	__le32			nrg;
+	__le16			nruh;
+	__le16			maxpids;
+	__le32			nns;
+	__le64			runs;
+	__le32			erutl;
+	__u8			rsvd28[36];
+	struct nvme_fdp_ruh_desc ruhs[];
+};
+
+struct nvme_fdp_config_log {
+	__le16			numfdpc;
+	__u8			ver;
+	__u8			rsvd3;
+	__le32			sze;
+	__u8			rsvd8[8];
+	/*
+	 * This is followed by variable number of nvme_fdp_config_desc
+	 * structures, but sparse doesn't like nested variable sized arrays.
+	 */
+};
+
 struct nvme_smart_log {
 	__u8			critical_warning;
 	__u8			temperature[2];
@@ -887,6 +926,7 @@ enum nvme_opcode {
 	nvme_cmd_resv_register	= 0x0d,
 	nvme_cmd_resv_report	= 0x0e,
 	nvme_cmd_resv_acquire	= 0x11,
+	nvme_cmd_io_mgmt_recv	= 0x12,
 	nvme_cmd_resv_release	= 0x15,
 	nvme_cmd_zone_mgmt_send	= 0x79,
 	nvme_cmd_zone_mgmt_recv	= 0x7a,
@@ -908,6 +948,7 @@ enum nvme_opcode {
 		nvme_opcode_name(nvme_cmd_resv_register),	\
 		nvme_opcode_name(nvme_cmd_resv_report),		\
 		nvme_opcode_name(nvme_cmd_resv_acquire),	\
+		nvme_opcode_name(nvme_cmd_io_mgmt_recv),	\
 		nvme_opcode_name(nvme_cmd_resv_release),	\
 		nvme_opcode_name(nvme_cmd_zone_mgmt_send),	\
 		nvme_opcode_name(nvme_cmd_zone_mgmt_recv),	\
@@ -1059,6 +1100,7 @@ enum {
 	NVME_RW_PRINFO_PRCHK_GUARD	= 1 << 12,
 	NVME_RW_PRINFO_PRACT		= 1 << 13,
 	NVME_RW_DTYPE_STREAMS		= 1 << 4,
+	NVME_RW_DTYPE_DPLCMT		= 2 << 4,
 	NVME_WZ_DEAC			= 1 << 9,
 };
 
@@ -1146,6 +1188,38 @@ struct nvme_zone_mgmt_recv_cmd {
 	__le32			cdw14[2];
 };
 
+struct nvme_io_mgmt_recv_cmd {
+	__u8			opcode;
+	__u8			flags;
+	__u16			command_id;
+	__le32			nsid;
+	__le64			rsvd2[2];
+	union nvme_data_ptr	dptr;
+	__u8			mo;
+	__u8			rsvd11;
+	__u16			mos;
+	__le32			numd;
+	__le32			cdw12[4];
+};
+
+enum {
+	NVME_IO_MGMT_RECV_MO_RUHS	= 1,
+};
+
+struct nvme_fdp_ruh_status_desc {
+	__le16			pid;
+	__le16			ruhid;
+	__le32			earutr;
+	__le64			ruamw;
+	__u8			reserved[16];
+};
+
+struct nvme_fdp_ruh_status {
+	__u8			rsvd0[14];
+	__le16			nruhsd;
+	struct nvme_fdp_ruh_status_desc ruhsd[];
+};
+
 enum {
 	NVME_ZRA_ZONE_REPORT		= 0,
 	NVME_ZRASF_ZONE_REPORT_ALL	= 0,
@@ -1281,6 +1355,7 @@ enum {
 	NVME_FEAT_PLM_WINDOW	= 0x14,
 	NVME_FEAT_HOST_BEHAVIOR	= 0x16,
 	NVME_FEAT_SANITIZE	= 0x17,
+	NVME_FEAT_FDP		= 0x1d,
 	NVME_FEAT_SW_PROGRESS	= 0x80,
 	NVME_FEAT_HOST_ID	= 0x81,
 	NVME_FEAT_RESV_MASK	= 0x82,
@@ -1301,6 +1376,7 @@ enum {
 	NVME_LOG_ANA		= 0x0c,
 	NVME_LOG_FEATURES	= 0x12,
 	NVME_LOG_RMI		= 0x16,
+	NVME_LOG_FDP_CONFIGS	= 0x20,
 	NVME_LOG_DISC		= 0x70,
 	NVME_LOG_RESERVATION	= 0x80,
 	NVME_FWACT_REPL		= (0 << 3),
@@ -1888,6 +1964,7 @@ struct nvme_command {
 		struct nvmf_auth_receive_command auth_receive;
 		struct nvme_dbbuf dbbuf;
 		struct nvme_directive_cmd directive;
+		struct nvme_io_mgmt_recv_cmd imr;
 	};
 };
 
-- 
2.43.5


  parent reply	other threads:[~2024-12-06 22:36 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06 22:17 [PATCHv12 00/12] block write streams with nvme fdp Keith Busch
2024-12-06 22:17 ` [PATCHv12 01/12] fs: add write stream information to statx Keith Busch
2024-12-09  8:25   ` Hannes Reinecke
     [not found]   ` <CGME20241209115219epcas5p4cfc217e25d977cd87025a4284ba0436c@epcas5p4.samsung.com>
2024-12-09 11:44     ` Nitesh Shetty
2024-12-06 22:17 ` [PATCHv12 02/12] fs: add a write stream field to the kiocb Keith Busch
2024-12-09  8:25   ` Hannes Reinecke
2024-12-09 12:47   ` [PATCHv12 01/12] fs: add write stream information to statx Christian Brauner
     [not found]   ` <CGME20241210073225epcas5p4b2ed325714e6d17fae9e3e45b8e963f6@epcas5p4.samsung.com>
2024-12-10  7:24     ` [PATCHv12 02/12] fs: add a write stream field to the kiocb Nitesh Shetty
2024-12-06 22:17 ` [PATCHv12 03/12] block: add a bi_write_stream field Keith Busch
2024-12-09  8:26   ` Hannes Reinecke
     [not found]   ` <CGME20241210074213epcas5p22330d197c3e7058e9c2226f28fdb1475@epcas5p2.samsung.com>
2024-12-10  7:34     ` Nitesh Shetty
2024-12-06 22:17 ` [PATCHv12 04/12] block: introduce max_write_streams queue limit Keith Busch
2024-12-09  8:27   ` Hannes Reinecke
     [not found]   ` <CGME20241210074628epcas5p3e36c7615cf2a5160d7fe169774fd30db@epcas5p3.samsung.com>
2024-12-10  7:38     ` Nitesh Shetty
2024-12-06 22:17 ` [PATCHv12 05/12] block: introduce a write_stream_granularity " Keith Busch
2024-12-09  8:29   ` Hannes Reinecke
     [not found]   ` <CGME20241210075259epcas5p23bbb79cdb18ddbfad337d764d4fe75da@epcas5p2.samsung.com>
2024-12-10  7:45     ` Nitesh Shetty
2024-12-06 22:17 ` [PATCHv12 06/12] block: expose write streams for block device nodes Keith Busch
2024-12-09  8:30   ` Hannes Reinecke
     [not found]   ` <CGME20241209110649epcas5p41df7db0f7ea58f250da647106d25134b@epcas5p4.samsung.com>
2024-12-09 10:58     ` Nitesh Shetty
2024-12-06 22:17 ` [PATCHv12 07/12] io_uring: enable per-io write streams Keith Busch
2024-12-09  8:31   ` Hannes Reinecke
2024-12-06 22:17 ` [PATCHv12 08/12] nvme: add a nvme_get_log_lsi helper Keith Busch
2024-12-09  8:31   ` Hannes Reinecke
     [not found]   ` <CGME20241210121958epcas5p27d14abfca66757a2c42ec71895b008b1@epcas5p2.samsung.com>
2024-12-10 12:12     ` Nitesh Shetty
2024-12-06 22:17 ` [PATCHv12 09/12] nvme: pass a void pointer to nvme_get/set_features for the result Keith Busch
2024-12-09  8:32   ` Hannes Reinecke
     [not found]   ` <CGME20241210122137epcas5p2e373baa1c99b78341928cc7bf0fe3bdf@epcas5p2.samsung.com>
2024-12-10 12:13     ` Nitesh Shetty
2024-12-06 22:17 ` Keith Busch [this message]
2024-12-09  8:33   ` [PATCHv12 10/12] nvme.h: add FDP definitions Hannes Reinecke
     [not found]   ` <CGME20241210122702epcas5p4fe3ed43ad714c6b467a35d16135d07c5@epcas5p4.samsung.com>
2024-12-10 12:19     ` Nitesh Shetty
2024-12-06 22:18 ` [PATCHv12 11/12] nvme: register fdp parameters with the block layer Keith Busch
2024-12-09  4:05   ` kernel test robot
2024-12-09 12:44     ` Christoph Hellwig
2024-12-09  8:34   ` Hannes Reinecke
2024-12-09 13:18   ` Christoph Hellwig
2024-12-09 16:29     ` Keith Busch
2024-12-10  8:45   ` Dan Carpenter
2024-12-10 15:23     ` Keith Busch
2024-12-06 22:18 ` [PATCHv12 12/12] nvme: use fdp streams if write stream is provided Keith Busch
2024-12-09  8:34   ` Hannes Reinecke
     [not found]   ` <CGME20241210073523epcas5p149482220b87ff3926fb8864ff1660e0c@epcas5p1.samsung.com>
2024-12-10  7:27     ` Nitesh Shetty
2024-12-09 12:55 ` [PATCHv12 00/12] block write streams with nvme fdp Christoph Hellwig
2024-12-09 16:07   ` Keith Busch
2024-12-10  1:49     ` Martin K. Petersen
2024-12-10  7:19     ` 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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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