On 19/09/2016 18:48, Michael S. Tsirkin wrote:
> > > 
> > > #define BATCH_NOT_FIRST 0x0010
> > > #define BATCH_NOT_LAST  0x0020
> > > 
> > > In other words only descriptor in batch is 0000.
> > > 
> > > Batch does not have to be processed together, so
> > > !first/!last flags can be changed when descriptor is used.
> > > 
> > 
> > I don't exactly understand why this is necessary.
> > Is there any added value by knowing that a bunch of messages have been 
> > written at 
> > the same time.
> 
> virtio net mergeable buffers pretty much rely on this.

How so?  num_buffers is specified in the virtio-net header, which is
going to be in the first received descriptor.  You don't need explicit
marking of which descriptor is the first or the last.

If you want to do parallel polling of the ring, perhaps we can define
extra device-specific flags, and define one (e.g.,
VIRTIO_NET_F_RXBUF_HAS_VIRTIO_NET_HDR) or two (adding also
VIRTIO_NET_F_RXBUF_LAST) for MRG_RXBUF.

> Which is optimal depends on the workload:
> - index requires and update each time we enable interrupts
> - flag requires an ipdate each time we switch to enabled/disabled
>   interrupts
> 
> Accordingly, for workloads that enable interrupts often,
> flags are better. For workloads that keep interrupts
> disabled most of the time, index is better.

Yeah, this makes sense.  So I guess both indexes and flags should stay.

Paolo

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

Reply via email to