From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47DCEA0352; Mon, 23 Dec 2019 03:34:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5EFBD25B3; Mon, 23 Dec 2019 03:34:13 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 56B061252 for ; Mon, 23 Dec 2019 03:34:11 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Dec 2019 18:34:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,346,1571727600"; d="scan'208";a="213793920" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga007.fm.intel.com with ESMTP; 22 Dec 2019 18:34:09 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Dec 2019 18:34:09 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.109]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.164]) with mapi id 14.03.0439.000; Mon, 23 Dec 2019 10:34:08 +0800 From: "Jiang, Cheng1" To: Gavin Hu , "maxime.coquelin@redhat.com" , "Bie, Tiwei" , "Wang, Zhihong" , "Liu, Yong" CC: "dev@dpdk.org" , nd Thread-Topic: [dpdk-dev] [PATCH v2] net/virtio: packed ring notification data feature support Thread-Index: AQHVtYjQB7tIrF8Yd0CXCPplY1lLfafHA71Q Date: Mon, 23 Dec 2019 02:34:07 +0000 Message-ID: References: <20191204150312.32697-1-Cheng1.jiang@intel.com> <20191218081711.9055-1-Cheng1.jiang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 v2] net/virtio: packed ring notification data feature support 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Gavin, > -----Original Message----- > From: Gavin Hu [mailto:Gavin.Hu@arm.com] > Sent: Wednesday, December 18, 2019 5:52 PM > To: Jiang, Cheng1 ; maxime.coquelin@redhat.com; > Bie, Tiwei ; Wang, Zhihong > ; Liu, Yong > Cc: dev@dpdk.org; nd > Subject: RE: [dpdk-dev] [PATCH v2] net/virtio: packed ring notification d= ata > feature support >=20 > Hi Jiang, >=20 > > -----Original Message----- > > From: dev On Behalf Of Cheng Jiang > > Sent: Wednesday, December 18, 2019 4:17 PM > > To: maxime.coquelin@redhat.com; tiwei.bie@intel.com; > > zhihong.wang@intel.com; yong.liu@intel.com > > Cc: dev@dpdk.org; Cheng Jiang > > Subject: [dpdk-dev] [PATCH v2] net/virtio: packed ring notification > > data feature support > > > > This patch supports the feature that the driver passes extra data > > (besides identifying the virtqueue) in its device notifications. > Can the commit log be more specific about the extra data? Something like > "expand the notification to include the avail index and avail wrap counte= r, if > any"? It makes more sense. I will add more specific commit log in the next versio= n. Thank you. > > > > Signed-off-by: Cheng Jiang > > --- > > > > v2: > > * Removed rte_unused attribute in *hw. > > * Added some comments on notify_data. > > > > drivers/net/virtio/virtio_ethdev.h | 3 ++- > > drivers/net/virtio/virtio_pci.c | 27 +++++++++++++++++++++++++-- > > drivers/net/virtio/virtio_pci.h | 6 ++++++ > > 3 files changed, 33 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/net/virtio/virtio_ethdev.h > > b/drivers/net/virtio/virtio_ethdev.h > > index a10111758..cd8947656 100644 > > --- a/drivers/net/virtio/virtio_ethdev.h > > +++ b/drivers/net/virtio/virtio_ethdev.h > > @@ -36,7 +36,8 @@ > > 1ULL << VIRTIO_F_IN_ORDER | \ > > 1ULL << VIRTIO_F_RING_PACKED | \ > > 1ULL << VIRTIO_F_IOMMU_PLATFORM | \ > > - 1ULL << VIRTIO_F_ORDER_PLATFORM) > > + 1ULL << VIRTIO_F_ORDER_PLATFORM | \ > > + 1ULL << VIRTIO_F_NOTIFICATION_DATA) > > > > #define VIRTIO_PMD_SUPPORTED_GUEST_FEATURES \ > > (VIRTIO_PMD_DEFAULT_GUEST_FEATURES | \ > > diff --git a/drivers/net/virtio/virtio_pci.c > > b/drivers/net/virtio/virtio_pci.c index 4468e89cb..8b4e001a1 100644 > > --- a/drivers/net/virtio/virtio_pci.c > > +++ b/drivers/net/virtio/virtio_pci.c > > @@ -416,9 +416,32 @@ modern_del_queue(struct virtio_hw *hw, struct > > virtqueue *vq) } > > > > static void > > -modern_notify_queue(struct virtio_hw *hw __rte_unused, struct > > virtqueue > > *vq) > > +modern_notify_queue(struct virtio_hw *hw, struct virtqueue *vq) > > { > > - rte_write16(vq->vq_queue_index, vq->notify_addr); > > + uint32_t notify_data; > > + > > + if (!vtpci_with_feature(hw, VIRTIO_F_NOTIFICATION_DATA)) { > > + rte_write16(vq->vq_queue_index, vq->notify_addr); > > + return; > > + } > > + > > + if (vtpci_with_feature(hw, VIRTIO_F_RING_PACKED)) { > > + /* > > + * Bit[0:15]: vq queue index > > + * Bit[16:30]: avail index > > + * Bit[31]: avail wrap counter > > + */ > > + notify_data =3D ((((uint32_t)vq- > > >vq_packed.used_wrap_counter << 15) | > Why not do ' used_wrap_counter << 31' to be more straightforward and > matches the above comment? Sure, you're right. I'll modify the patch in the next version.=20 Thanks again. Cheng > > + vq->vq_avail_idx) << 16) | vq- > > >vq_queue_index; >=20 > > + } else { > > + /* > > + * Bit[0:15]: vq queue index > > + * Bit[16:31]: avail index > > + */ > > + notify_data =3D ((uint32_t)vq->vq_avail_idx << 16) | > > + vq->vq_queue_index; > > + } > > + rte_write32(notify_data, vq->notify_addr); > > } > > > > const struct virtio_pci_ops modern_ops =3D { diff --git > > a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h > > index a38cb45ad..7433d2f08 100644 > > --- a/drivers/net/virtio/virtio_pci.h > > +++ b/drivers/net/virtio/virtio_pci.h > > @@ -135,6 +135,12 @@ struct virtnet_ctl; > > */ > > #define VIRTIO_F_ORDER_PLATFORM 36 > > > > +/* > > + * This feature indicates that the driver passes extra data (besides > > + * identifying the virtqueue) in its device notifications. > > + */ > > +#define VIRTIO_F_NOTIFICATION_DATA 38 > > + > > /* The Guest publishes the used index for which it expects an interrup= t > > * at the end of the avail ring. Host should ignore the avail->flags > > field. */ > > /* The Host publishes the avail index for which it expects a kick > > -- > > 2.17.1