From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 59FED1322C for ; Tue, 9 Jan 2018 03:12:06 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 18:12:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,333,1511856000"; d="scan'208";a="9716444" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 08 Jan 2018 18:12:05 -0800 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 18:12:05 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 18:12:04 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Tue, 9 Jan 2018 10:12:03 +0800 From: "Chen, Junjie J" To: Yuanhan Liu CC: "Wang, Xiao W" , "maxime.coquelin@redhat.com" , "Bie, Tiwei" , "dev@dpdk.org" , "Yao, Lei A" Thread-Topic: [PATCH v6] vhost: support virtqueue interrupt/notification suppression Thread-Index: AQHTfjC4M6uJNE+NRkGPCcXn9Iz4QKNpkWeAgAFEqPA= Date: Tue, 9 Jan 2018 02:12:02 +0000 Message-ID: References: <1514048153-82959-1-git-send-email-junjie.j.chen@intel.com> <1514310190-140916-1-git-send-email-junjie.j.chen@intel.com> <20180108140659.GA29540@yliu-mob> In-Reply-To: <20180108140659.GA29540@yliu-mob> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTU3MGE0ZWMtMzRiOC00M2E2LTkwNzMtMDY0MGRkMWM5ZTRhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ0NWtYOFY5OWRmZUxhUDE0d3V5eEZIUnNOTVhFU0I2eUJlcDhBQ0x5R1huMHJITFwvM0lsNVZyblB4eGphcW85YyJ9 x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v6] vhost: support virtqueue interrupt/notification suppression X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jan 2018 02:12:07 -0000 Hi > -----Original Message----- > From: Yuanhan Liu [mailto:yliu@fridaylinux.org] > Sent: Monday, January 8, 2018 10:07 PM > To: Chen, Junjie J > Cc: Wang, Xiao W ; maxime.coquelin@redhat.com; > Bie, Tiwei ; dev@dpdk.org; Yao, Lei A > > Subject: Re: [PATCH v6] vhost: support virtqueue interrupt/notification > suppression >=20 > 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 >=20 > You need put "---" before the change log. Otherwise, it will be tracked i= n the > commit log. Will update this. >=20 > > +#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 =3D vq->signalled_used; > > + uint16_t new =3D vq->last_used_idx; > > + > > + LOG_DEBUG(VHOST_DATA, "%s: used_event_idx=3D%d, old=3D%d, > new=3D%d\n", > > + __func__, > > + vhost_used_event(vq), > > + old, new); > > + if (vring_need_event(vhost_used_event(vq), new, old) >=20 > 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 defin= es 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 co= nsistent. Is that OK for you? >=20 > Besides that, I have few more comments (and some requirements): >=20 > - 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. >=20 > - 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. >=20 > - 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. >=20 > --yliu