All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>,
	Daejun Park <daejun7.park@samsung.com>,
	Kanchan Joshi <joshi.k@samsung.com>,
	Bart Van Assche <bvanassche@acm.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>
Subject: [PATCH v4 07/15] scsi_proto: Add structures and constants related to I/O groups and streams
Date: Tue, 14 Nov 2023 13:41:02 -0800	[thread overview]
Message-ID: <20231114214132.1486867-8-bvanassche@acm.org> (raw)
In-Reply-To: <20231114214132.1486867-1-bvanassche@acm.org>

Prepare for adding code that will query the I/O advice hints group
descriptors and for adding code that will retrieve the stream status.

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 include/scsi/scsi_proto.h | 75 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h
index 07d65c1f59db..9ee4983c23b4 100644
--- a/include/scsi/scsi_proto.h
+++ b/include/scsi/scsi_proto.h
@@ -10,6 +10,7 @@
 #ifndef _SCSI_PROTO_H_
 #define _SCSI_PROTO_H_
 
+#include <linux/build_bug.h>
 #include <linux/types.h>
 
 /*
@@ -126,6 +127,7 @@
 #define	SAI_READ_CAPACITY_16  0x10
 #define SAI_GET_LBA_STATUS    0x12
 #define SAI_REPORT_REFERRALS  0x13
+#define SAI_GET_STREAM_STATUS 0x16
 /* values for maintenance in */
 #define MI_REPORT_IDENTIFYING_INFORMATION 0x05
 #define MI_REPORT_TARGET_PGS  0x0a
@@ -275,6 +277,79 @@ struct scsi_lun {
 	__u8 scsi_lun[8];
 };
 
+/* SBC-5 IO advice hints group descriptor */
+struct scsi_io_group_descriptor {
+#if defined(__BIG_ENDIAN)
+	u8 io_advice_hints_mode: 2;
+	u8 reserved1: 3;
+	u8 st_enble: 1;
+	u8 cs_enble: 1;
+	u8 ic_enable: 1;
+#elif defined(__LITTLE_ENDIAN)
+	u8 ic_enable: 1;
+	u8 cs_enble: 1;
+	u8 st_enble: 1;
+	u8 reserved1: 3;
+	u8 io_advice_hints_mode: 2;
+#else
+#error
+#endif
+	u8 reserved2[3];
+	/* Logical block markup descriptor */
+#if defined(__BIG_ENDIAN)
+	u8 acdlu: 1;
+	u8 reserved3: 1;
+	u8 rlbsr: 2;
+	u8 lbm_descriptor_type: 4;
+#elif defined(__LITTLE_ENDIAN)
+	u8 lbm_descriptor_type: 4;
+	u8 rlbsr: 2;
+	u8 reserved3: 1;
+	u8 acdlu: 1;
+#else
+#error
+#endif
+	u8 params[2];
+	u8 reserved4;
+	u8 reserved5[8];
+};
+
+static_assert(sizeof(struct scsi_io_group_descriptor) == 16);
+
+struct scsi_stream_status {
+#if defined(__BIG_ENDIAN)
+	u16 perm: 1;
+	u16 reserved1: 15;
+#elif defined(__LITTLE_ENDIAN)
+	u16 reserved1: 15;
+	u16 perm: 1;
+#else
+#error
+#endif
+	__be16 stream_identifier;
+#if defined(__BIG_ENDIAN)
+	u8 reserved2: 2;
+	u8 rel_lifetime: 6;
+#elif defined(__LITTLE_ENDIAN)
+	u8 rel_lifetime: 6;
+	u8 reserved2: 2;
+#else
+#error
+#endif
+	u8 reserved3[3];
+};
+
+static_assert(sizeof(struct scsi_stream_status) == 8);
+
+struct scsi_stream_status_header {
+	__be32 len;	/* length in bytes of stream_status[] array. */
+	u16 reserved;
+	u16 number_of_open_streams;
+	DECLARE_FLEX_ARRAY(struct scsi_stream_status, stream_status);
+};
+
+static_assert(sizeof(struct scsi_stream_status_header) == 8);
+
 /* SPC asymmetric access states */
 #define SCSI_ACCESS_STATE_OPTIMAL     0x00
 #define SCSI_ACCESS_STATE_ACTIVE      0x01

  parent reply	other threads:[~2023-11-14 21:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 21:40 [PATCH v4 00/15] Pass data lifetime information to SCSI disk devices Bart Van Assche
2023-11-14 21:40 ` [PATCH v4 01/15] fs: Rename the kernel-internal data lifetime constants Bart Van Assche
2023-11-20  7:19   ` Kanchan Joshi
2023-11-27  7:08   ` Christoph Hellwig
2023-11-27  8:45     ` Kanchan Joshi
2023-11-27  9:29       ` Christoph Hellwig
2023-11-27 19:00     ` Bart Van Assche
2023-11-14 21:40 ` [PATCH v4 02/15] fs: Move enum rw_hint into a new header file Bart Van Assche
2023-11-14 21:40 ` [PATCH v4 03/15] block: Restore data lifetime support in struct bio and struct request Bart Van Assche
2023-11-14 21:40 ` [PATCH v4 04/15] fs: Restore write hint support Bart Van Assche
2023-11-14 21:41 ` [PATCH v4 05/15] fs/f2fs: Restore data lifetime support Bart Van Assche
2023-11-20  7:36   ` Kanchan Joshi
2023-11-20 17:53     ` Bart Van Assche
2023-11-14 21:41 ` [PATCH v4 06/15] scsi: core: Query the Block Limits Extension VPD page Bart Van Assche
2023-11-14 21:41 ` Bart Van Assche [this message]
2023-11-14 21:41 ` [PATCH v4 08/15] sd: Translate data lifetime information Bart Van Assche
2023-11-14 21:41 ` [PATCH v4 09/15] scsi_debug: Reduce code duplication Bart Van Assche
2023-11-14 21:41 ` [PATCH v4 10/15] scsi_debug: Support the block limits extension VPD page Bart Van Assche
2023-11-14 21:41 ` [PATCH v4 11/15] scsi_debug: Rework page code error handling Bart Van Assche
2023-11-14 21:41 ` [PATCH v4 12/15] scsi_debug: Rework subpage " Bart Van Assche
2023-11-14 21:41 ` [PATCH v4 13/15] scsi_debug: Implement the IO Advice Hints Grouping mode page Bart Van Assche
2023-11-14 21:41 ` [PATCH v4 14/15] scsi_debug: Implement GET STREAM STATUS Bart Van Assche
2023-11-14 21:41 ` [PATCH v4 15/15] scsi_debug: Maintain write statistics per group number Bart Van Assche
2023-11-21 19:25   ` Bart Van Assche

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=20231114214132.1486867-8-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=daejun7.park@samsung.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=joshi.k@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.