From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15F5EC43603 for ; Thu, 12 Dec 2019 09:08:27 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id A44D5214AF for ; Thu, 12 Dec 2019 09:08:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A44D5214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AF9672BD3; Thu, 12 Dec 2019 10:08:25 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id F2F332BC8 for ; Thu, 12 Dec 2019 10:08:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2019 01:08:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,305,1571727600"; d="scan'208";a="208006980" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga008.jf.intel.com with ESMTP; 12 Dec 2019 01:08:22 -0800 Received: from fmsmsx162.amr.corp.intel.com (10.18.125.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 12 Dec 2019 01:08:22 -0800 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx162.amr.corp.intel.com (10.18.125.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 12 Dec 2019 01:08:21 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.109]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.72]) with mapi id 14.03.0439.000; Thu, 12 Dec 2019 17:08:20 +0800 From: "Jiang, Cheng1" To: "Liu, Yong" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Bie, Tiwei" , "Wang, Zhihong" Thread-Topic: [dpdk-dev] [DPDK] net/virtio: packed ring notification data feature support Thread-Index: AQHVrjRctSMfsxex906jVnAmLTctPqe2On8g Date: Thu, 12 Dec 2019 09:08:19 +0000 Message-ID: References: <20191204150312.32697-1-Cheng1.jiang@intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E6341F67E@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E6341F67E@SHSMSX103.ccr.corp.intel.com> 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] [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: Liu, Yong > Sent: Monday, December 9, 2019 10:00 AM > To: Jiang, Cheng1 ; dev@dpdk.org > Cc: maxime.coquelin@redhat.com; Bie, Tiwei ; Wang, > Zhihong ; Jiang, Cheng1 > > Subject: RE: [dpdk-dev] [DPDK] net/virtio: packed ring notification data > feature support >=20 >=20 >=20 > > -----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 > > > > This patch supports the feature that the driver passes extra data > > (besides identifying the virtqueue) in its device notifications. > > > > 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(-) > > > > 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..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) > > { >=20 > Hi Cheng, > hw pointer will be used in notify function, please remove rte_unused > attribute. >=20 > Thanks, > Marvin >=20 Sure, I'll remove it in the next version. Thanks very much! Cheng > > - 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); > > } > > > > 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