[dpdk-dev] [DPDK] net/virtio: packed ring notification data feature support

Jiang, Cheng1 cheng1.jiang at intel.com
Mon Jan 13 03:57:59 CET 2020


Hi Marvin,

> -----Original Message-----
> From: Liu, Yong
> Sent: Thursday, January 9, 2020 3:29 PM
> To: Jiang, Cheng1 <cheng1.jiang at intel.com>; dev at dpdk.org
> Cc: maxime.coquelin at redhat.com; Bie, Tiwei <tiwei.bie at intel.com>; Wang,
> Zhihong <zhihong.wang at intel.com>; Jiang, Cheng1
> <cheng1.jiang at intel.com>
> Subject: RE: [dpdk-dev] [DPDK] net/virtio: packed ring notification data
> feature support
> 
> 
> 
> > -----Original Message-----
> > From: dev <dev-bounces at dpdk.org> On Behalf Of Cheng Jiang
> > Sent: Wednesday, December 04, 2019 11:03 PM
> > To: dev at dpdk.org
> > Cc: maxime.coquelin at redhat.com; Bie, Tiwei <tiwei.bie at intel.com>;
> > Wang, Zhihong <zhihong.wang at intel.com>; Jiang, Cheng1
> > <cheng1.jiang at intel.com>
> > Subject: [dpdk-dev] [DPDK] net/virtio: packed ring notification data
> > feature support
> >
> > This patch supports the feature that the driver passes extra data
> > (besides identifying the virtqueue) in its device notifications.
> >
> > Signed-off-by: Cheng Jiang <Cheng1.jiang at intel.com>
> > ---
> >  drivers/net/virtio/virtio_ethdev.h |  3 ++-
> >  drivers/net/virtio/virtio_pci.c    | 15 ++++++++++++++-
> >  drivers/net/virtio/virtio_pci.h    |  6 ++++++
> >  3 files changed, 22 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/virtio/virtio_ethdev.h
> > b/drivers/net/virtio/virtio_ethdev.h
> > index a10111758..cd8947656 100644
> > --- a/drivers/net/virtio/virtio_ethdev.h
> > +++ b/drivers/net/virtio/virtio_ethdev.h
> > +	if (vtpci_with_feature(hw, VIRTIO_F_RING_PACKED))
> > +		notify_data = ((((uint32_t)vq-
> >vq_packed.used_wrap_counter <<
> > 15) |
> > +				vq->vq_avail_idx) << 16) | vq-
> >vq_queue_index;
> > +	else
> > +		notify_data = ((uint32_t)vq->vq_avail_idx << 16) |
> > +				vq->vq_queue_index;
> 
> Hi Cheng,
> According to virtio1.1 spec, wrap counter should refer to next available
> descriptor.
> So used_wrap_counter should be replaced with avail_wrap_counter. Sorry
> for late noticing.
> 
> Thanks,
> Marvin
> 

Sure, I'm going to modify it in the next version.
Thanks very much.

Cheng

> > +	rte_write32(notify_data, vq->notify_addr);
> >  }
> >



More information about the dev mailing list