All of lore.kernel.org
 help / color / mirror / Atom feed
* [virtio-dev] [PATCH] virtio-blk: clarify semantics of multi-segment discard/write zeroes commands
@ 2019-02-26 16:25 Stefan Hajnoczi
  2019-02-26 17:09 ` Cornelia Huck
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2019-02-26 16:25 UTC (permalink / raw)
  To: virtio-dev; +Cc: Jan Kiszka, Stefan Hajnoczi

Describe the failure case and maximum number of segments in a
multi-segment discard/write zeroes command.

Fixes: https://github.com/oasis-tcs/virtio-spec/issues/34
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
I would like to request a vote on this.

 content.tex | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/content.tex b/content.tex
index c5fdc34..7bfcc78 100644
--- a/content.tex
+++ b/content.tex
@@ -3967,8 +3967,10 @@ read from the block device (in multiples of 512 bytes).  VIRTIO_BLK_T_OUT
 requests write the contents of \field{data} to the block device (in multiples
 of 512 bytes).
 
-The \field{data} used for discard or write zeroes command is described
-by one or more virtio_blk_discard_write_zeroes structs:
+The \field{data} used for discard or write zeroes commands consists of one or
+more segments.  The maximum number of segments is \field{max_discard_seg} for
+discard commands and \field{max_write_zeroes_seg} for write zeroes commands.
+Each segment is of form:
 
 \begin{lstlisting}
 struct virtio_blk_discard_write_zeroes {
@@ -3997,6 +3999,10 @@ error or VIRTIO_BLK_S_UNSUPP for a request unsupported by device:
 #define VIRTIO_BLK_S_UNSUPP    2
 \end{lstlisting}
 
+The status of individual segments is indeterminate when a discard or write zero
+command produces VIRTIO_BLK_S_IOERR.  A segment may have completed
+successfully, failed, or not been processed by the device.
+
 \drivernormative{\subsubsection}{Device Operation}{Device Types / Block Device / Device Operation}
 
 A driver MUST NOT submit a request which would cause a read or write
@@ -4014,6 +4020,14 @@ The length of \field{data} MUST be a multiple of the size of struct
 virtio_blk_discard_write_zeroes for VIRTIO_BLK_T_DISCARD and
 VIRTIO_BLK_T_WRITE_ZEROES requests.
 
+VIRTIO_BLK_T_DISCARD requests MUST NOT contain more than
+\field{max_discard_seg} struct virtio_blk_discard_write_zeroes segments in
+\field{data}.
+
+VIRTIO_BLK_T_WRITE_ZEROES requests MUST NOT contain more than
+\field{max_write_zeroes_seg} struct virtio_blk_discard_write_zeroes segments in
+\field{data}.
+
 If the VIRTIO_BLK_F_CONFIG_WCE feature is negotiated, the driver MAY
 switch to writethrough or writeback mode by writing respectively 0 and
 1 to the \field{writeback} field.  After writing a 0 to \field{writeback},
@@ -4024,6 +4038,11 @@ The \field{unmap} bit MUST be zero for discard commands.  The driver
 MUST NOT assume anything about the data returned by read requests after
 a range of sectors has been discarded.
 
+A driver MUST NOT assume that individual segments in a multi-segment
+VIRTIO_BLK_T_DISCARD or VIRTIO_BLK_T_WRITE_ZEROES request completed
+successfully, failed, or were processed by the device at all if the request
+failed with VIRTIO_BLK_S_IOERR.
+
 \devicenormative{\subsubsection}{Device Operation}{Device Types / Block Device / Device Operation}
 
 A device MUST set the \field{status} byte to VIRTIO_BLK_S_IOERR
-- 
2.20.1


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [virtio-dev] [PATCH] virtio-blk: clarify semantics of multi-segment discard/write zeroes commands
  2019-02-26 16:25 [virtio-dev] [PATCH] virtio-blk: clarify semantics of multi-segment discard/write zeroes commands Stefan Hajnoczi
@ 2019-02-26 17:09 ` Cornelia Huck
  2019-02-26 17:44   ` Cornelia Huck
  2019-02-26 17:44   ` Stefan Hajnoczi
  0 siblings, 2 replies; 7+ messages in thread
From: Cornelia Huck @ 2019-02-26 17:09 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: virtio-dev, Jan Kiszka

On Tue, 26 Feb 2019 16:25:53 +0000
Stefan Hajnoczi <stefanha@redhat.com> wrote:

> Describe the failure case and maximum number of segments in a
> multi-segment discard/write zeroes command.
> 
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/34
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> I would like to request a vote on this.

Only one minor nit from me, below.

> 
>  content.tex | 23 +++++++++++++++++++++--
>  1 file changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/content.tex b/content.tex
> index c5fdc34..7bfcc78 100644
> --- a/content.tex
> +++ b/content.tex
> @@ -3967,8 +3967,10 @@ read from the block device (in multiples of 512 bytes).  VIRTIO_BLK_T_OUT
>  requests write the contents of \field{data} to the block device (in multiples
>  of 512 bytes).
>  
> -The \field{data} used for discard or write zeroes command is described
> -by one or more virtio_blk_discard_write_zeroes structs:
> +The \field{data} used for discard or write zeroes commands consists of one or
> +more segments.  The maximum number of segments is \field{max_discard_seg} for
> +discard commands and \field{max_write_zeroes_seg} for write zeroes commands.
> +Each segment is of form:

Maybe s/of form/of the form/ ?

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [virtio-dev] [PATCH] virtio-blk: clarify semantics of multi-segment discard/write zeroes commands
  2019-02-26 17:09 ` Cornelia Huck
@ 2019-02-26 17:44   ` Cornelia Huck
  2019-02-26 17:44   ` Stefan Hajnoczi
  1 sibling, 0 replies; 7+ messages in thread
From: Cornelia Huck @ 2019-02-26 17:44 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: virtio-dev, Jan Kiszka

On Tue, 26 Feb 2019 18:09:03 +0100
Cornelia Huck <cohuck@redhat.com> wrote:

> On Tue, 26 Feb 2019 16:25:53 +0000
> Stefan Hajnoczi <stefanha@redhat.com> wrote:
> 
> > Describe the failure case and maximum number of segments in a
> > multi-segment discard/write zeroes command.
> > 
> > Fixes: https://github.com/oasis-tcs/virtio-spec/issues/34
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> > I would like to request a vote on this.  
> 
> Only one minor nit from me, below.
> 
> > 
> >  content.tex | 23 +++++++++++++++++++++--
> >  1 file changed, 21 insertions(+), 2 deletions(-)
> > 
> > diff --git a/content.tex b/content.tex
> > index c5fdc34..7bfcc78 100644
> > --- a/content.tex
> > +++ b/content.tex
> > @@ -3967,8 +3967,10 @@ read from the block device (in multiples of 512 bytes).  VIRTIO_BLK_T_OUT
> >  requests write the contents of \field{data} to the block device (in multiples
> >  of 512 bytes).
> >  
> > -The \field{data} used for discard or write zeroes command is described
> > -by one or more virtio_blk_discard_write_zeroes structs:
> > +The \field{data} used for discard or write zeroes commands consists of one or
> > +more segments.  The maximum number of segments is \field{max_discard_seg} for
> > +discard commands and \field{max_write_zeroes_seg} for write zeroes commands.
> > +Each segment is of form:  
> 
> Maybe s/of form/of the form/ ?

...and that is certainly a non-material change we could do on top.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [virtio-dev] [PATCH] virtio-blk: clarify semantics of multi-segment discard/write zeroes commands
  2019-02-26 17:09 ` Cornelia Huck
  2019-02-26 17:44   ` Cornelia Huck
@ 2019-02-26 17:44   ` Stefan Hajnoczi
  2019-02-26 17:45     ` Cornelia Huck
  2019-02-26 19:51     ` Michael S. Tsirkin
  1 sibling, 2 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2019-02-26 17:44 UTC (permalink / raw)
  To: Cornelia Huck; +Cc: virtio-dev, Jan Kiszka

[-- Attachment #1: Type: text/plain, Size: 1620 bytes --]

On Tue, Feb 26, 2019 at 06:09:03PM +0100, Cornelia Huck wrote:
> On Tue, 26 Feb 2019 16:25:53 +0000
> Stefan Hajnoczi <stefanha@redhat.com> wrote:
> 
> > Describe the failure case and maximum number of segments in a
> > multi-segment discard/write zeroes command.
> > 
> > Fixes: https://github.com/oasis-tcs/virtio-spec/issues/34
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> > I would like to request a vote on this.
> 
> Only one minor nit from me, below.
> 
> > 
> >  content.tex | 23 +++++++++++++++++++++--
> >  1 file changed, 21 insertions(+), 2 deletions(-)
> > 
> > diff --git a/content.tex b/content.tex
> > index c5fdc34..7bfcc78 100644
> > --- a/content.tex
> > +++ b/content.tex
> > @@ -3967,8 +3967,10 @@ read from the block device (in multiples of 512 bytes).  VIRTIO_BLK_T_OUT
> >  requests write the contents of \field{data} to the block device (in multiples
> >  of 512 bytes).
> >  
> > -The \field{data} used for discard or write zeroes command is described
> > -by one or more virtio_blk_discard_write_zeroes structs:
> > +The \field{data} used for discard or write zeroes commands consists of one or
> > +more segments.  The maximum number of segments is \field{max_discard_seg} for
> > +discard commands and \field{max_write_zeroes_seg} for write zeroes commands.
> > +Each segment is of form:
> 
> Maybe s/of form/of the form/ ?

I wanted to stay consistent with the existing text above it:

  The driver queues requests to the virtqueue, and they are used by
  the device (not necessarily in order). Each request is of form:

  ...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [virtio-dev] [PATCH] virtio-blk: clarify semantics of multi-segment discard/write zeroes commands
  2019-02-26 17:44   ` Stefan Hajnoczi
@ 2019-02-26 17:45     ` Cornelia Huck
  2019-02-26 19:54       ` Stefan Hajnoczi
  2019-02-26 19:51     ` Michael S. Tsirkin
  1 sibling, 1 reply; 7+ messages in thread
From: Cornelia Huck @ 2019-02-26 17:45 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: virtio-dev, Jan Kiszka

[-- Attachment #1: Type: text/plain, Size: 1821 bytes --]

On Tue, 26 Feb 2019 17:44:16 +0000
Stefan Hajnoczi <stefanha@redhat.com> wrote:

> On Tue, Feb 26, 2019 at 06:09:03PM +0100, Cornelia Huck wrote:
> > On Tue, 26 Feb 2019 16:25:53 +0000
> > Stefan Hajnoczi <stefanha@redhat.com> wrote:
> >   
> > > Describe the failure case and maximum number of segments in a
> > > multi-segment discard/write zeroes command.
> > > 
> > > Fixes: https://github.com/oasis-tcs/virtio-spec/issues/34
> > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > ---
> > > I would like to request a vote on this.  
> > 
> > Only one minor nit from me, below.
> >   
> > > 
> > >  content.tex | 23 +++++++++++++++++++++--
> > >  1 file changed, 21 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/content.tex b/content.tex
> > > index c5fdc34..7bfcc78 100644
> > > --- a/content.tex
> > > +++ b/content.tex
> > > @@ -3967,8 +3967,10 @@ read from the block device (in multiples of 512 bytes).  VIRTIO_BLK_T_OUT
> > >  requests write the contents of \field{data} to the block device (in multiples
> > >  of 512 bytes).
> > >  
> > > -The \field{data} used for discard or write zeroes command is described
> > > -by one or more virtio_blk_discard_write_zeroes structs:
> > > +The \field{data} used for discard or write zeroes commands consists of one or
> > > +more segments.  The maximum number of segments is \field{max_discard_seg} for
> > > +discard commands and \field{max_write_zeroes_seg} for write zeroes commands.
> > > +Each segment is of form:  
> > 
> > Maybe s/of form/of the form/ ?  
> 
> I wanted to stay consistent with the existing text above it:
> 
>   The driver queues requests to the virtqueue, and they are used by
>   the device (not necessarily in order). Each request is of form:
> 
>   ...

Fine with me as well.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [virtio-dev] [PATCH] virtio-blk: clarify semantics of multi-segment discard/write zeroes commands
  2019-02-26 17:44   ` Stefan Hajnoczi
  2019-02-26 17:45     ` Cornelia Huck
@ 2019-02-26 19:51     ` Michael S. Tsirkin
  1 sibling, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2019-02-26 19:51 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Cornelia Huck, virtio-dev, Jan Kiszka

On Tue, Feb 26, 2019 at 05:44:16PM +0000, Stefan Hajnoczi wrote:
> On Tue, Feb 26, 2019 at 06:09:03PM +0100, Cornelia Huck wrote:
> > On Tue, 26 Feb 2019 16:25:53 +0000
> > Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > 
> > > Describe the failure case and maximum number of segments in a
> > > multi-segment discard/write zeroes command.
> > > 
> > > Fixes: https://github.com/oasis-tcs/virtio-spec/issues/34
> > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > ---
> > > I would like to request a vote on this.
> > 
> > Only one minor nit from me, below.
> > 
> > > 
> > >  content.tex | 23 +++++++++++++++++++++--
> > >  1 file changed, 21 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/content.tex b/content.tex
> > > index c5fdc34..7bfcc78 100644
> > > --- a/content.tex
> > > +++ b/content.tex
> > > @@ -3967,8 +3967,10 @@ read from the block device (in multiples of 512 bytes).  VIRTIO_BLK_T_OUT
> > >  requests write the contents of \field{data} to the block device (in multiples
> > >  of 512 bytes).
> > >  
> > > -The \field{data} used for discard or write zeroes command is described
> > > -by one or more virtio_blk_discard_write_zeroes structs:
> > > +The \field{data} used for discard or write zeroes commands consists of one or
> > > +more segments.  The maximum number of segments is \field{max_discard_seg} for
> > > +discard commands and \field{max_write_zeroes_seg} for write zeroes commands.
> > > +Each segment is of form:
> > 
> > Maybe s/of form/of the form/ ?
> 
> I wanted to stay consistent with the existing text above it:
> 
>   The driver queues requests to the virtqueue, and they are used by
>   the device (not necessarily in order). Each request is of form:
> 
>   ...



OK so I will cancel the vote on this version for now?

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [virtio-dev] [PATCH] virtio-blk: clarify semantics of multi-segment discard/write zeroes commands
  2019-02-26 17:45     ` Cornelia Huck
@ 2019-02-26 19:54       ` Stefan Hajnoczi
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2019-02-26 19:54 UTC (permalink / raw)
  To: Cornelia Huck; +Cc: virtio-dev, Jan Kiszka

[-- Attachment #1: Type: text/plain, Size: 2026 bytes --]

On Tue, Feb 26, 2019 at 06:45:21PM +0100, Cornelia Huck wrote:
> On Tue, 26 Feb 2019 17:44:16 +0000
> Stefan Hajnoczi <stefanha@redhat.com> wrote:
> 
> > On Tue, Feb 26, 2019 at 06:09:03PM +0100, Cornelia Huck wrote:
> > > On Tue, 26 Feb 2019 16:25:53 +0000
> > > Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > >   
> > > > Describe the failure case and maximum number of segments in a
> > > > multi-segment discard/write zeroes command.
> > > > 
> > > > Fixes: https://github.com/oasis-tcs/virtio-spec/issues/34
> > > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > > ---
> > > > I would like to request a vote on this.  
> > > 
> > > Only one minor nit from me, below.
> > >   
> > > > 
> > > >  content.tex | 23 +++++++++++++++++++++--
> > > >  1 file changed, 21 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/content.tex b/content.tex
> > > > index c5fdc34..7bfcc78 100644
> > > > --- a/content.tex
> > > > +++ b/content.tex
> > > > @@ -3967,8 +3967,10 @@ read from the block device (in multiples of 512 bytes).  VIRTIO_BLK_T_OUT
> > > >  requests write the contents of \field{data} to the block device (in multiples
> > > >  of 512 bytes).
> > > >  
> > > > -The \field{data} used for discard or write zeroes command is described
> > > > -by one or more virtio_blk_discard_write_zeroes structs:
> > > > +The \field{data} used for discard or write zeroes commands consists of one or
> > > > +more segments.  The maximum number of segments is \field{max_discard_seg} for
> > > > +discard commands and \field{max_write_zeroes_seg} for write zeroes commands.
> > > > +Each segment is of form:  
> > > 
> > > Maybe s/of form/of the form/ ?  
> > 
> > I wanted to stay consistent with the existing text above it:
> > 
> >   The driver queues requests to the virtqueue, and they are used by
> >   the device (not necessarily in order). Each request is of form:
> > 
> >   ...
> 
> Fine with me as well.

Okay, great!  Let's leave it as-is.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-02-26 19:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26 16:25 [virtio-dev] [PATCH] virtio-blk: clarify semantics of multi-segment discard/write zeroes commands Stefan Hajnoczi
2019-02-26 17:09 ` Cornelia Huck
2019-02-26 17:44   ` Cornelia Huck
2019-02-26 17:44   ` Stefan Hajnoczi
2019-02-26 17:45     ` Cornelia Huck
2019-02-26 19:54       ` Stefan Hajnoczi
2019-02-26 19:51     ` Michael S. Tsirkin

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.