DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wang, Xiao W" <xiao.w.wang@intel.com>
To: "Chen, Junjie J" <junjie.j.chen@intel.com>,
	"yliu@fridaylinux.org" <yliu@fridaylinux.org>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
	"Bie, Tiwei" <tiwei.bie@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v5] vhost: support virtqueue interrupt/notification suppression
Date: Tue, 26 Dec 2017 08:03:06 +0000	[thread overview]
Message-ID: <B7F2E978279D1D49A3034B7786DACF406F806969@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1514048153-82959-1-git-send-email-junjie.j.chen@intel.com>

Hi,

> -----Original Message-----
> From: Chen, Junjie J
> Sent: Sunday, December 24, 2017 12:56 AM
> To: yliu@fridaylinux.org; maxime.coquelin@redhat.com; Bie, Tiwei
> <tiwei.bie@intel.com>; Wang, Xiao W <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org; Chen, Junjie J <junjie.j.chen@intel.com>
> Subject: [PATCH v5] vhost: support virtqueue interrupt/notification
> suppression
> 
> The driver can suppress interrupt when VIRTIO_F_EVENT_IDX feature bit is
> negotiated. The driver set vring flags to 0, and MAY use used_event in
> available ring to advise device interrupt util reach an index specified
> by used_event. The device ignore the lower bit of vring flags, and send
> an interrupt when index reach used_event.
> 
> The device can suppress notification in a manner analogous to the ways
> driver suppress interrupt. The device manipulates flags or avail_event in
> the used ringin the same way the driver manipulates flags or used_event in
> available ring.
> 
> This patch is to enable this feature in vhost.
> 
> Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
> 
[...]
> +	/* Last used index we notify to front end. */
> +	uint16_t		signalled_used;
>  #define VIRTIO_INVALID_EVENTFD		(-1)
>  #define VIRTIO_UNINITIALIZED_EVENTFD	(-2)
> 
> @@ -211,6 +213,7 @@ struct vhost_msg {
>  				(1ULL << VIRTIO_NET_F_GUEST_TSO4) | \
>  				(1ULL << VIRTIO_NET_F_GUEST_TSO6) | \
>  				(1ULL << VIRTIO_RING_F_INDIRECT_DESC) | \
> +				(1ULL << VIRTIO_RING_F_EVENT_IDX) | \
>  				(1ULL << VIRTIO_NET_F_MTU) | \
>  				(1ULL << VIRTIO_F_IOMMU_PLATFORM))
> 
> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
> index 6fee16e..2badeda 100644
> --- a/lib/librte_vhost/virtio_net.c
> +++ b/lib/librte_vhost/virtio_net.c
> @@ -52,6 +52,35 @@
> 
>  #define MAX_BATCH_LEN 256
> 
> +#define vhost_used_event(vr)  ((vr)->avail->ring[(vr)->size])
> +#define vhost_avail_event(vr) \
> +	(*(volatile uint16_t *)&(vr)->used->ring[(vr)->size])
> +

>From vhost side, vhost_used_event(vr) is volatile.

BRs,
Xiao

  reply	other threads:[~2017-12-26  8:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 11:02 [dpdk-dev] [PATCH v4] " junjie.j.chen
2017-12-23 16:55 ` [dpdk-dev] [PATCH v5] " Junjie Chen
2017-12-26  8:03   ` Wang, Xiao W [this message]
2017-12-26 17:43   ` [dpdk-dev] [PATCH v6] " Junjie Chen
2018-01-05  5:25     ` Wang, Xiao W
2018-01-08 14:06     ` Yuanhan Liu
2018-01-09  2:12       ` Chen, Junjie J
2018-01-09  2:29         ` Yuanhan Liu
2018-01-09 11:03     ` [dpdk-dev] [PATCH v7] " Junjie Chen
2018-01-09  7:34       ` Yao, Lei A
2018-01-09 12:58         ` Yuanhan Liu
2018-01-09  8:56       ` Maxime Coquelin

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=B7F2E978279D1D49A3034B7786DACF406F806969@SHSMSX101.ccr.corp.intel.com \
    --to=xiao.w.wang@intel.com \
    --cc=dev@dpdk.org \
    --cc=junjie.j.chen@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=yliu@fridaylinux.org \
    /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).