On Fri, Aug 17, 2018 at 07:04:42PM +0200, Paolo Bonzini wrote:
> Define them in terms of descriptors, not segments, and explain what the
> driver and device are to use them for. >
> Signed-off-by: Paolo Bonzini <> > ---
> content.tex
17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-) >
> diff --git a/content.tex b/content.tex
> index 4cdfeef..fd3a3c2 100644 > --- a/content.tex > +++ b/content.tex > @@ -3515,11 +3515,11 @@ device except where noted.
> subsection{Feature bits}label{sec:Device Types / Block Device / Feature bits} >
> egin{description} > -item[VIRTIO_BLK_F_SIZE_MAX (1)] Maximum size of any single segment is > -
in field{size_max}. > +item[VIRTIO_BLK_F_SIZE_MAX (1)] Maximum size of any single descriptor in > +
the data portion of a request ("segment") is in field{size_max}. >
> -item[VIRTIO_BLK_F_SEG_MAX (2)] Maximum number of segments in a > -
request is in field{seg_max}. > +item[VIRTIO_BLK_F_SEG_MAX (2)] Maximum number of descriptors in the > +
data portion of a request ("segments") is in field{seg_max}. >
> item[VIRTIO_BLK_F_GEOMETRY (4)] Disk-style geometry specified in
>
field{geometry}. So it's a bit of a mess. For example when you count descriptors with an indirect descriptor you don't count the pointer. Split and packed ring terminology also differ. We need to have a definition in the common part. Up to cleaning this up?
> @@ -3762,6 +3762,10 @@ error or VIRTIO_BLK_S_UNSUPP for a request unsupported by device:
> A driver SHOULD NOT submit a request which would cause a read or write
> beyond field{capacity}. >
> +A driver SHOULD NOT submit a request which has more than field{seg_max} > +descriptors in the data portion, or which has more than field{size_max} > +bytes in a single descriptor in the data portion. > +
> A driver SHOULD accept the VIRTIO_BLK_F_RO feature if offered. >
> A driver MUST set field{sector} to 0 for a VIRTIO_BLK_T_FLUSH request. > @@ -3782,6 +3786,11 @@ a range of sectors has been discarded.
> A device MUST set the field{status} byte to VIRTIO_BLK_S_IOERR for a
> request which would cause a read or write beyond field{capacity}. >
> +A device MAY set the field{status} byte to VIRTIO_BLK_S_IOERR for a > +request which has more than field{seg_max} descriptors in the data > +portion, or which has more than field{size_max} bytes in a single > +descriptor in the data portion. > +
> A device MUST set the field{status} byte to VIRTIO_BLK_S_IOERR
> for a write request if the VIRTIO_BLK_F_RO feature if offered, and MUST NOT
> write any data. > --
> 2.17.1 > > > >
---------------------------------------------------------------------
> To unsubscribe from this mail list, you must leave the OASIS TC that
> generates this mail. Follow this link to all your TCs in OASIS at:
> https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php