Re: [virtio-dev] [PATCH] content: document console vq detach buffer

2019-08-14 Thread Stefan Hajnoczi
On Wed, Aug 14, 2019 at 02:33:15AM -0400, Pankaj Gupta wrote:
> > On Tue, Aug 13, 2019 at 06:21:33PM +0530, Pankaj Gupta wrote:
> > > This patch documents console special case where vq buffers
> > > are deleted at port hotunplug time. This behavior is different in
> > > other devices where vq buffers are deleted at device unplug time.
> > > 
> > > Signed-off-by: Pankaj Gupta 
> > > ---
> > >  content.tex | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/content.tex b/content.tex
> > > index ee0d7c9..33e8ccc 100644
> > > --- a/content.tex
> > > +++ b/content.tex
> > > @@ -497,6 +497,8 @@ \section{Device Cleanup}\label{sec:General
> > > Initialization And Device Operation /
> > >  of a live virtqueue.
> > >  
> > >  Thus a driver MUST ensure a virtqueue isn't live (by device reset) before
> > >  removing exposed buffers.
> > > +Console has a special property that when port is detached virtqueue is
> > > considered stopped, device
> > > +must not use any buffers, and it is legal to take buffers out of the
> > > device.
> > 
> > The word "detach" is not defined or used in the spec, so it's unclear
> > what this is supposed to mean.  Is this related to a control message
> > (VIRTIO_CONSOLE_PORT_OPEN)?
> 
> By detach here we mean "unplug".  

"unplug" also has no meaning defined in the spec.  Please explain things
in terms of the actual device interface (control messages, config space
fields, etc) so that the spec is clear.  Which event or operation are
you talking about?

> > 
> > How about:
> > 
> >   The device MUST NOT use buffers after it has sent
> >   VIRTIO_CONSOLE_PORT_OPEN with value=0 for a port.
> > 
> > I'm not sure what you mean by "take buffers out of the device"?  I guess
> > you mean the driver can modify the vring because the device isn't
> > looking.
> 
> "take buffers out of the device" means "remove the unused buffers from the 
> virt queue".

What does "remove the unused buffers from the virt queue" mean?
Decreasing the avail index (for split-ring virtqueue layouts) so that
previously available buffers are no longer available?

Stefan


signature.asc
Description: PGP signature


Re: [virtio-dev] [PATCH] content: document console vq detach buffer

2019-08-13 Thread Pankaj Gupta


> 
> On Tue, Aug 13, 2019 at 06:21:33PM +0530, Pankaj Gupta wrote:
> > This patch documents console special case where vq buffers
> > are deleted at port hotunplug time. This behavior is different in
> > other devices where vq buffers are deleted at device unplug time.
> > 
> > Signed-off-by: Pankaj Gupta 
> > ---
> >  content.tex | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/content.tex b/content.tex
> > index ee0d7c9..33e8ccc 100644
> > --- a/content.tex
> > +++ b/content.tex
> > @@ -497,6 +497,8 @@ \section{Device Cleanup}\label{sec:General
> > Initialization And Device Operation /
> >  of a live virtqueue.
> >  
> >  Thus a driver MUST ensure a virtqueue isn't live (by device reset) before
> >  removing exposed buffers.
> > +Console has a special property that when port is detached virtqueue is
> > considered stopped, device
> > +must not use any buffers, and it is legal to take buffers out of the
> > device.
> 
> The word "detach" is not defined or used in the spec, so it's unclear
> what this is supposed to mean.  Is this related to a control message
> (VIRTIO_CONSOLE_PORT_OPEN)?

By detach here we mean "unplug".  

> 
> How about:
> 
>   The device MUST NOT use buffers after it has sent
>   VIRTIO_CONSOLE_PORT_OPEN with value=0 for a port.
> 
> I'm not sure what you mean by "take buffers out of the device"?  I guess
> you mean the driver can modify the vring because the device isn't
> looking.

"take buffers out of the device" means "remove the unused buffers from the virt 
queue".

How about the below text:

Console has a special property that when port is unplugged virtqueue is
considered stopped, device must not use any buffers, and it is legal to
remove the unused buffers from the device.

Thanks,
Pankaj
> 

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



Re: [virtio-dev] [PATCH] content: document console vq detach buffer

2019-08-13 Thread Stefan Hajnoczi
On Tue, Aug 13, 2019 at 06:21:33PM +0530, Pankaj Gupta wrote:
> This patch documents console special case where vq buffers
> are deleted at port hotunplug time. This behavior is different in
> other devices where vq buffers are deleted at device unplug time.
> 
> Signed-off-by: Pankaj Gupta 
> ---
>  content.tex | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/content.tex b/content.tex
> index ee0d7c9..33e8ccc 100644
> --- a/content.tex
> +++ b/content.tex
> @@ -497,6 +497,8 @@ \section{Device Cleanup}\label{sec:General Initialization 
> And Device Operation /
>  of a live virtqueue.
>  
>  Thus a driver MUST ensure a virtqueue isn't live (by device reset) before 
> removing exposed buffers.
> +Console has a special property that when port is detached virtqueue is 
> considered stopped, device
> +must not use any buffers, and it is legal to take buffers out of the device.

The word "detach" is not defined or used in the spec, so it's unclear
what this is supposed to mean.  Is this related to a control message
(VIRTIO_CONSOLE_PORT_OPEN)?

How about:

  The device MUST NOT use buffers after it has sent
  VIRTIO_CONSOLE_PORT_OPEN with value=0 for a port.

I'm not sure what you mean by "take buffers out of the device"?  I guess
you mean the driver can modify the vring because the device isn't
looking.


signature.asc
Description: PGP signature