From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 116531B365 for ; Tue, 26 Dec 2017 09:03:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Dec 2017 00:03:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,459,1508828400"; d="scan'208";a="15580009" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 26 Dec 2017 00:03:08 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 26 Dec 2017 00:03:08 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 26 Dec 2017 00:03:08 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by shsmsx102.ccr.corp.intel.com ([169.254.2.189]) with mapi id 14.03.0319.002; Tue, 26 Dec 2017 16:03:06 +0800 From: "Wang, Xiao W" To: "Chen, Junjie J" , "yliu@fridaylinux.org" , "maxime.coquelin@redhat.com" , "Bie, Tiwei" CC: "dev@dpdk.org" Thread-Topic: [PATCH v5] vhost: support virtqueue interrupt/notification suppression Thread-Index: AQHTe86T0Can7hWW3Uq4tl+YY8qLT6NVR4Wg Date: Tue, 26 Dec 2017 08:03:06 +0000 Message-ID: References: <20171128110200.60032-1-junjie.j.chen@intel.com> <1514048153-82959-1-git-send-email-junjie.j.chen@intel.com> In-Reply-To: <1514048153-82959-1-git-send-email-junjie.j.chen@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDZlMmQzMjEtYjFhOC00OTE0LTgyMTMtNmY1YWNiZjNiNjgyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJFZGdxSzV6ZGFpWjVGYklwV0JDbDc5dlZVUmYraWJOUUdGRUlvUmFlY21pM01iXC9aZklObnJsVzFDMUF5WTVrciJ9 dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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 v5] 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, 26 Dec 2017 08:03:10 -0000 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 > ; Wang, Xiao W > Cc: dev@dpdk.org; Chen, Junjie J > Subject: [PATCH v5] vhost: support virtqueue interrupt/notification > suppression >=20 > 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. >=20 > 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 i= n > available ring. >=20 > This patch is to enable this feature in vhost. >=20 > Signed-off-by: Junjie Chen >=20 [...] > + /* Last used index we notify to front end. */ > + uint16_t signalled_used; > #define VIRTIO_INVALID_EVENTFD (-1) > #define VIRTIO_UNINITIALIZED_EVENTFD (-2) >=20 > @@ -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)) >=20 > 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 @@ >=20 > #define MAX_BATCH_LEN 256 >=20 > +#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