DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Chen, Junjie J" <junjie.j.chen@intel.com>
To: Yuanhan Liu <yliu@fridaylinux.org>
Cc: "Wang, Xiao W" <xiao.w.wang@intel.com>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
	"Bie, Tiwei" <tiwei.bie@intel.com>, "dev@dpdk.org" <dev@dpdk.org>,
	"Yao, Lei A" <lei.a.yao@intel.com>
Subject: Re: [dpdk-dev] [PATCH v6] vhost: support virtqueue interrupt/notification suppression
Date: Tue, 9 Jan 2018 02:12:02 +0000	[thread overview]
Message-ID: <AA85A5A5E706C44BACB0BEFD5AC08BF6313296E1@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <20180108140659.GA29540@yliu-mob>

Hi

> -----Original Message-----
> From: Yuanhan Liu [mailto:yliu@fridaylinux.org]
> Sent: Monday, January 8, 2018 10:07 PM
> To: Chen, Junjie J <junjie.j.chen@intel.com>
> Cc: Wang, Xiao W <xiao.w.wang@intel.com>; maxime.coquelin@redhat.com;
> Bie, Tiwei <tiwei.bie@intel.com>; dev@dpdk.org; Yao, Lei A
> <lei.a.yao@intel.com>
> Subject: Re: [PATCH v6] vhost: support virtqueue interrupt/notification
> suppression
> 
> On Tue, Dec 26, 2017 at 12:43:10PM -0500, Junjie Chen wrote:
> > 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 ring in 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>
> 
> You need put "---" before the change log. Otherwise, it will be tracked in the
> commit log.

Will update this.
> 
> > +#define vhost_used_event(vr) \
> > +	(*(volatile uint16_t*)&(vr)->avail->ring[(vr)->size])
> > +
> > +static __rte_always_inline void
> > +vhost_notify(struct virtio_net *dev,  struct vhost_virtqueue *vq) {
> > +	/* Don't notify guest if we don't reach index specified by guest. */
> > +	if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) {
> > +		uint16_t old = vq->signalled_used;
> > +		uint16_t new = vq->last_used_idx;
> > +
> > +		LOG_DEBUG(VHOST_DATA, "%s: used_event_idx=%d, old=%d,
> new=%d\n",
> > +			__func__,
> > +			vhost_used_event(vq),
> > +			old, new);
> > +		if (vring_need_event(vhost_used_event(vq), new, old)
> 
> It's a bit weird that you use one from the standard linux header file
> (vring_need_event), while you define you own one (vhost_used_event).
> Note that the system header file also has "vring_used_event()" defined.
The vring_used_event is defined and used for virtio in kernel, kernel defines a vhost_used_event in vhost.c for vhost, so I just use a separated macro for vhost end.

I'd like to define both vhost_need_event and vhost_used_event in vhost.h to remove potential build issue in old linux distribution and also to keep consistent. Is that OK for you?

> 
> Besides that, I have few more comments (and some requirements):
> 
> - It'd be much better if there is a Tested-by tag. Expeclitly,
>   I'm asking a test with Linux kernel virtio-net driver in guest.
Sure.
> 
> - I also hope you could have done a build test on some old distributions.
>   AFAIK, the two macros (vring_need_event and vring_used_event) come
>   from kernel 3.0 (or above). Any kernel older than that would fail
>   the build.
> 
> - I'd be great if you could make a new one based on top of my latest
>   tree: I have just applied a patchset that should conflict with this
>   one.

Sure, will do this.
> 
> 	--yliu

  reply	other threads:[~2018-01-09  2:12 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
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 [this message]
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=AA85A5A5E706C44BACB0BEFD5AC08BF6313296E1@SHSMSX101.ccr.corp.intel.com \
    --to=junjie.j.chen@intel.com \
    --cc=dev@dpdk.org \
    --cc=lei.a.yao@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=xiao.w.wang@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).