DPDK patches and discussions
 help / color / mirror / Atom feed
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
Date: Fri, 6 Oct 2017 14:40:15 +0800	[thread overview]
Message-ID: <20171006064015.GD1545@yliu-home> (raw)
In-Reply-To: <CFF8EF42F1132E4CBE2BF0AB6C21C58D7881782F@ESESSMB107.ericsson.se>

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.

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

	--yliu

  parent reply	other threads:[~2017-10-06  6:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-23 20:31 Jan Scheurich
2017-10-04 10:00 ` Jan Scheurich
2017-10-05 10:14 ` Jens Freimann
2017-10-06  6:40 ` Yuanhan Liu [this message]
2017-10-16 15:30 Jan Scheurich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171006064015.GD1545@yliu-home \
    --to=yliu@fridaylinux.org \
    --cc=dev@dpdk.org \
    --cc=jan.scheurich@ericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).