From: Stefan Hajnoczi <stefanha@redhat.com>
To: Parav Pandit <parav@nvidia.com>
Cc: mst@redhat.com, virtio-dev@lists.oasis-open.org,
cohuck@redhat.com, virtio-comment@lists.oasis-open.org,
shahafs@nvidia.com, Max Gurtovoy <mgurtovoy@nvidia.com>
Subject: Re: [virtio-comment] [PATCH] virtio-blk: Define dev cfg layout before its fields
Date: Thu, 23 Feb 2023 15:46:15 -0500 [thread overview]
Message-ID: <Y/fQl7ImbYGHEtVY@fedora> (raw)
In-Reply-To: <20230223135205.175949-1-parav@nvidia.com>
[-- Attachment #1: Type: text/plain, Size: 5125 bytes --]
On Thu, Feb 23, 2023 at 03:52:05PM +0200, Parav Pandit wrote:
> Define device configuration layout structure before describing its
> individual fields.
>
> This is an editorial change.
>
> Suggested-by: Cornelia Huck <cohuck@redhat.com>
> Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> Signed-off-by: Parav Pandit <parav@nvidia.com>
> ---
> device-types/blk/description.tex | 95 ++++++++++++++++----------------
> 1 file changed, 48 insertions(+), 47 deletions(-)
>
> diff --git a/device-types/blk/description.tex b/device-types/blk/description.tex
> index 20007e3..517b012 100644
> --- a/device-types/blk/description.tex
> +++ b/device-types/blk/description.tex
> @@ -83,6 +83,54 @@ \subsubsection{Legacy Interface: Feature bits}\label{sec:Device Types / Block De
>
> \subsection{Device configuration layout}\label{sec:Device Types / Block Device / Device configuration layout}
>
> +The block device has the following device configuration layout.
> +
> +\begin{lstlisting}
> +struct virtio_blk_config {
> + le64 capacity;
> + le32 size_max;
> + le32 seg_max;
> + struct virtio_blk_geometry {
> + le16 cylinders;
> + u8 heads;
> + u8 sectors;
> + } geometry;
> + le32 blk_size;
> + struct virtio_blk_topology {
> + // # of logical blocks per physical block (log2)
> + u8 physical_block_exp;
> + // offset of first aligned logical block
> + u8 alignment_offset;
> + // suggested minimum I/O size in blocks
> + le16 min_io_size;
> + // optimal (suggested maximum) I/O size in blocks
> + le32 opt_io_size;
> + } topology;
> + u8 writeback;
> + u8 unused0;
> + u16 num_queues;
> + le32 max_discard_sectors;
> + le32 max_discard_seg;
> + le32 discard_sector_alignment;
> + le32 max_write_zeroes_sectors;
> + le32 max_write_zeroes_seg;
> + u8 write_zeroes_may_unmap;
> + u8 unused1[3];
> + le32 max_secure_erase_sectors;
> + le32 max_secure_erase_seg;
> + le32 secure_erase_sector_alignment;
> + struct virtio_blk_zoned_characteristics {
> + le32 zone_sectors;
> + le32 max_open_zones;
> + le32 max_active_zones;
> + le32 max_append_sectors;
> + le32 write_granularity;
> + u8 model;
> + u8 unused2[3];
> + } zoned;
> +};
> +\end{lstlisting}
> +
> The \field{capacity} of the device (expressed in 512-byte sectors) is always
> present. The availability of the others all depend on various feature
> bits as indicated above.
> @@ -167,53 +215,6 @@ \subsection{Device configuration layout}\label{sec:Device Types / Block Device /
> terminated by the device with a "zone resources exceeded" error as defined for
> specific commands later.
>
> -\begin{lstlisting}
> -struct virtio_blk_config {
> - le64 capacity;
> - le32 size_max;
> - le32 seg_max;
> - struct virtio_blk_geometry {
> - le16 cylinders;
> - u8 heads;
> - u8 sectors;
> - } geometry;
> - le32 blk_size;
> - struct virtio_blk_topology {
> - // # of logical blocks per physical block (log2)
> - u8 physical_block_exp;
> - // offset of first aligned logical block
> - u8 alignment_offset;
> - // suggested minimum I/O size in blocks
> - le16 min_io_size;
> - // optimal (suggested maximum) I/O size in blocks
> - le32 opt_io_size;
> - } topology;
> - u8 writeback;
> - u8 unused0;
> - u16 num_queues;
> - le32 max_discard_sectors;
> - le32 max_discard_seg;
> - le32 discard_sector_alignment;
> - le32 max_write_zeroes_sectors;
> - le32 max_write_zeroes_seg;
> - u8 write_zeroes_may_unmap;
> - u8 unused1[3];
> - le32 max_secure_erase_sectors;
> - le32 max_secure_erase_seg;
> - le32 secure_erase_sector_alignment;
> - struct virtio_blk_zoned_characteristics {
> - le32 zone_sectors;
> - le32 max_open_zones;
> - le32 max_active_zones;
> - le32 max_append_sectors;
> - le32 write_granularity;
> - u8 model;
> - u8 unused2[3];
> - } zoned;
> -};
> -\end{lstlisting}
> -
> -
> \subsubsection{Legacy Interface: Device configuration layout}\label{sec:Device Types / Block Device / Device configuration layout / Legacy Interface: Device configuration layout}
> When using the legacy interface, transitional devices and drivers
> MUST format the fields in struct virtio_blk_config
> --
> 2.26.2
Yes, please!
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2023-02-23 20:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 13:52 [PATCH] virtio-blk: Define dev cfg layout before its fields Parav Pandit
2023-02-23 20:46 ` Stefan Hajnoczi [this message]
2023-03-12 13:22 ` [virtio-dev] RE: [virtio-comment] " Parav Pandit
2023-03-15 14:24 ` Parav Pandit
2023-03-15 15:00 ` [virtio-dev] " Michael S. Tsirkin
2023-03-15 15:12 ` [virtio-dev] " Parav Pandit
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=Y/fQl7ImbYGHEtVY@fedora \
--to=stefanha@redhat.com \
--cc=cohuck@redhat.com \
--cc=mgurtovoy@nvidia.com \
--cc=mst@redhat.com \
--cc=parav@nvidia.com \
--cc=shahafs@nvidia.com \
--cc=virtio-comment@lists.oasis-open.org \
--cc=virtio-dev@lists.oasis-open.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