DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] dev Digest, Vol 164, Issue 196
       [not found] <mailman.2412.1507272069.3414.dev@dpdk.org>
@ 2017-10-16  7:47 ` Jan Scheurich
  0 siblings, 0 replies; only message in thread
From: Jan Scheurich @ 2017-10-16  7:47 UTC (permalink / raw)
  To: dev, yliu

> Date: Fri, 6 Oct 2017 14:40:15 +0800
> From: Yuanhan Liu <yliu@fridaylinux.org>
> To: Jan Scheurich <jan.scheurich@ericsson.com>
> Cc: "'dev@dpdk.org'" <dev@dpdk.org>
> Subject: Re: [dpdk-dev] [PATCH v3] vhost: Expose virtio interrupt need
> 	on rte_vhost API
> Message-ID: <20171006064015.GD1545@yliu-home>
> Content-Type: text/plain; charset=us-ascii
> 
> On Sat, Sep 23, 2017 at 08:31:37PM +0000, Jan Scheurich wrote:
> ...
> > +int rte_vhost_tx_interrupt_requested(int vid, uint16_t qid)
> > +{
> > +	struct virtio_net *dev;
> > +	struct vhost_virtqueue *vq;
> > +
> > +	dev = get_device(vid);
> > +	if (dev == NULL)
> > +		return 0;
> > +
> > +	vq = dev->virtqueue[qid];
> > +	if (vq == NULL)
> > +		return 0;
> > +
> > +	if (unlikely(vq->enabled == 0 || vq->avail == NULL))
> > +		return 0;
> > +
> > +	return !(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT);
> 
> Two comments here:
> 
> - as you see, the flags is stored at vq->avail, which is stored at the
>   shared memory. That means, the virtio driver could change the value
>   at any time.
> 
>   That said, this API should not be intended to be invoked once. Then
>   you have to invoke it repeatedly, which might be a bit costy.

That is understood.

> - OTOH, you might want to try "rte_vhost_get_vhost_vring" API, which
>   exposes the vq->avail, therefore, the interrupt flag is also exposed.

Thanks for the pointer. I checked and all necessary tools to access the interrupt flag are publicly available on the API. So the proposed new API function is not needed. I will obsolete the patch. 

Regards, Jan

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-16  7:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.2412.1507272069.3414.dev@dpdk.org>
2017-10-16  7:47 ` [dpdk-dev] dev Digest, Vol 164, Issue 196 Jan Scheurich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).