[dpdk-dev] [PATCH v5 03/15] vhost: vring address setup for packed queues

Tiwei Bie tiwei.bie at intel.com
Sat Jun 30 04:18:11 CEST 2018


On Fri, Jun 29, 2018 at 06:34:09PM +0200, Maxime Coquelin wrote:
> On 06/29/2018 05:59 PM, Tiwei Bie wrote:
> > On Fri, Jun 22, 2018 at 03:43:15PM +0200, Maxime Coquelin wrote:
[...]
> > > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> > > index 34a614c97..671b4b3bf 100644
> > > --- a/lib/librte_vhost/vhost.h
> > > +++ b/lib/librte_vhost/vhost.h
> > > @@ -84,7 +84,10 @@ struct log_cache_entry {
> > >    * Structure contains variables relevant to RX/TX virtqueues.
> > >    */
> > >   struct vhost_virtqueue {
> > > -	struct vring_desc	*desc;
> > > +	union {
> > > +		struct vring_desc	*desc;
> > > +		struct vring_desc_packed   *desc_packed;
> > > +	};
> > >   	struct vring_avail	*avail;
> > >   	struct vring_used	*used;
> > >   	uint32_t		size;
> > > @@ -122,6 +125,8 @@ struct vhost_virtqueue {
> > >   	struct batch_copy_elem	*batch_copy_elems;
> > >   	uint16_t		batch_copy_nb_elems;
> > > +	uint16_t		used_wrap_counter;
> > > +	uint16_t		avail_wrap_counter;
> > 
> > Not quite sure about this. Do you think it will be
> > better to define wrap counters as bool (as only 0 or
> > 1 are available)?
> 
> I think it should work, but not sure this is cleaner.
> 
> When defining something as bool, I expect to use true or false
> for its assignment, but maybe that's me.
> 
> But I could certainly use uint8_t instead to reduce the size of the
> struct.
> 
> What do you think?

I don't have a strong opinion on this.
Jason suggested me to use bool in my patch [1].
So I wanted to hear your opinion too.

[1] https://lkml.org/lkml/2018/5/29/47

Best regards,
Tiwei Bie


More information about the dev mailing list