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 B611BA04F1; Mon, 9 Dec 2019 03:00:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E9E50374E; Mon, 9 Dec 2019 03:00:03 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id AA297374E for ; Mon, 9 Dec 2019 03:00:02 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Dec 2019 18:00:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,293,1571727600"; d="scan'208";a="219881873" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 08 Dec 2019 18:00:00 -0800 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 8 Dec 2019 18:00:00 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 8 Dec 2019 18:00:00 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.29]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.164]) with mapi id 14.03.0439.000; Mon, 9 Dec 2019 09:59:58 +0800 From: "Liu, Yong" To: "Jiang, Cheng1" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Bie, Tiwei" , "Wang, Zhihong" , "Jiang, Cheng1" Thread-Topic: [dpdk-dev] [DPDK] net/virtio: packed ring notification data feature support Thread-Index: AQHVqnQzD3YNN5+qPEWfg3kzQRM1v6exErSA Date: Mon, 9 Dec 2019 01:59:57 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E6341F67E@SHSMSX103.ccr.corp.intel.com> References: <20191204150312.32697-1-Cheng1.jiang@intel.com> In-Reply-To: <20191204150312.32697-1-Cheng1.jiang@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmQ4NzkxNzgtODdhOC00YmUzLTkzNzYtMTJjNzYyNjBkNGU5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiXC9rRm9qM29KSzBiejJ5WE5YeUNPOGw4cWQ1MlI4bWQ5KzRCZGp2SFQxU1NjQnBETW14OEtRUmxKOWRtRzdGemUifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 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] [DPDK] 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" > -----Original Message----- > From: dev On Behalf Of Cheng Jiang > Sent: Wednesday, December 04, 2019 11:03 PM > To: dev@dpdk.org > Cc: maxime.coquelin@redhat.com; Bie, Tiwei ; Wang, > Zhihong ; Jiang, Cheng1 > Subject: [dpdk-dev] [DPDK] net/virtio: packed ring notification data > feature support >=20 > This patch supports the feature that the driver passes extra data > (besides identifying the virtqueue) in its device notifications. >=20 > Signed-off-by: Cheng Jiang > --- > drivers/net/virtio/virtio_ethdev.h | 3 ++- > drivers/net/virtio/virtio_pci.c | 15 ++++++++++++++- > drivers/net/virtio/virtio_pci.h | 6 ++++++ > 3 files changed, 22 insertions(+), 2 deletions(-) >=20 > 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) >=20 > #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..2462a7dab 100644 > --- a/drivers/net/virtio/virtio_pci.c > +++ b/drivers/net/virtio/virtio_pci.c > @@ -418,7 +418,20 @@ modern_del_queue(struct virtio_hw *hw, struct > virtqueue *vq) > static void > modern_notify_queue(struct virtio_hw *hw __rte_unused, struct virtqueue > *vq) > { Hi Cheng, hw pointer will be used in notify function, please remove rte_unused attrib= ute.=20 Thanks, Marvin > - 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)) > + notify_data =3D ((((uint32_t)vq->vq_packed.used_wrap_counter << > 15) | > + vq->vq_avail_idx) << 16) | vq->vq_queue_index; > + else > + notify_data =3D ((uint32_t)vq->vq_avail_idx << 16) | > + vq->vq_queue_index; > + rte_write32(notify_data, vq->notify_addr); > } >=20 > 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 >=20 > +/* > + * 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 interrupt > * 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