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 1A239A050F; Wed, 18 Dec 2019 10:52:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F2102BE5; Wed, 18 Dec 2019 10:52:03 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70084.outbound.protection.outlook.com [40.107.7.84]) by dpdk.org (Postfix) with ESMTP id BF732330 for ; Wed, 18 Dec 2019 10:52:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qGFteF/2Pqyn69eYodmxeJKsmSc8FcFWcAl7h88C4qA=; b=crkIaQNHa3gVnldXZAmdKBpCGGcVE8rPhE4LjNHYhOU1jb+r7tSbsCXSmR7nbn6T8+EhEuVkBXhmuRtwUjSRx8yHaArodhtOihJuzNjtPbnlsNZE9b8dinTlk+ojM0GHgNkvMsaEcfzMQn5LDFDWwTd2Ti+aMSbDcFU0s/4IhYg= Received: from DB6PR0802CA0039.eurprd08.prod.outlook.com (2603:10a6:4:a3::25) by DB8PR08MB5404.eurprd08.prod.outlook.com (2603:10a6:10:117::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.13; Wed, 18 Dec 2019 09:52:00 +0000 Received: from AM5EUR03FT028.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::205) by DB6PR0802CA0039.outlook.office365.com (2603:10a6:4:a3::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14 via Frontend Transport; Wed, 18 Dec 2019 09:52:00 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT028.mail.protection.outlook.com (10.152.16.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14 via Frontend Transport; Wed, 18 Dec 2019 09:51:59 +0000 Received: ("Tessian outbound 4f3bc9719026:v40"); Wed, 18 Dec 2019 09:51:59 +0000 X-CR-MTA-TID: 64aa7808 Received: from a74662e2a663.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7B52EDB8-24D4-46FF-AED0-8977E3C5F146.1; Wed, 18 Dec 2019 09:51:54 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a74662e2a663.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 18 Dec 2019 09:51:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LgcqlNaseRFFQNQlSbHjtkT1o+X9Akm+OrLWBqCzaE+WbaBFi0PIhEk854EEp+b75zBJOQGHOIGiVBJE8dRVz80AF0DudL3g81/+t6TsdQXkTNT5BMhdMF+Lo012VYyfe2wxRORT3AjBAN4Y9T6ZDH9ZB+blguhkTMgIg9HXJfqXgo9W6paWDcWZVtp29vCAWCdDNaSUzUuJrhz2KivfLUtjuon9Ns71eQa/oXIYNPB5VodlDe7nI+c9h68KsTQrQ0dHxJXe0vh9wOKNTyd9HicG/GyCzqmhtjT/rVHyAR9O263GBeovq18cTODP0X8gsxxLmdxXTyWUPLjBjbrdHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qGFteF/2Pqyn69eYodmxeJKsmSc8FcFWcAl7h88C4qA=; b=bQex6kBHm7GbXsiQExa0WIaQ6dxp1c9UERlzrPX6ow4kjoLwg8Tks5cN4yrzXyep0MbnWbMI410AJt42vv6b+8MKnS8G4I1hcHMu231lpW6Ca9/LaIQt4gRo9UZejUPOXBKLD/LkvXuKuFKjFouaEfuDao8ohpGwwr+j+pnl8marxNWUIqy0L4mhmHeQXCOt0QQy5On5B3vfhaf2YkB0iBFwghz/CgWIADBS/r8txDi7nljoZZ0cb4M//rivzxaC5sFvrZVv6OYKoW9nrIJYa6VKj/55wh7bKqMucby2sfMm0DA64EycQ6YrsYdTEvguoXVm6XHiu75aYrusV4PRRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qGFteF/2Pqyn69eYodmxeJKsmSc8FcFWcAl7h88C4qA=; b=crkIaQNHa3gVnldXZAmdKBpCGGcVE8rPhE4LjNHYhOU1jb+r7tSbsCXSmR7nbn6T8+EhEuVkBXhmuRtwUjSRx8yHaArodhtOihJuzNjtPbnlsNZE9b8dinTlk+ojM0GHgNkvMsaEcfzMQn5LDFDWwTd2Ti+aMSbDcFU0s/4IhYg= Received: from VI1PR08MB5376.eurprd08.prod.outlook.com (10.255.196.79) by VI1PR08MB4493.eurprd08.prod.outlook.com (20.179.27.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.14; Wed, 18 Dec 2019 09:51:52 +0000 Received: from VI1PR08MB5376.eurprd08.prod.outlook.com ([fe80::dde8:216f:6a0b:8cfb]) by VI1PR08MB5376.eurprd08.prod.outlook.com ([fe80::dde8:216f:6a0b:8cfb%7]) with mapi id 15.20.2559.012; Wed, 18 Dec 2019 09:51:52 +0000 From: Gavin Hu To: Cheng Jiang , "maxime.coquelin@redhat.com" , "tiwei.bie@intel.com" , "zhihong.wang@intel.com" , "yong.liu@intel.com" CC: "dev@dpdk.org" , nd Thread-Topic: [dpdk-dev] [PATCH v2] net/virtio: packed ring notification data feature support Thread-Index: AQHVtXvXP+FPrADlVUWkr5BUgY52nKe/k3Iw Date: Wed, 18 Dec 2019 09:51:52 +0000 Message-ID: References: <20191204150312.32697-1-Cheng1.jiang@intel.com> <20191218081711.9055-1-Cheng1.jiang@intel.com> In-Reply-To: <20191218081711.9055-1-Cheng1.jiang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: fbf712cd-c041-464c-9977-81cf63167044.0 x-checkrecipientchecked: true Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d439f35e-cd2e-41da-5a75-08d7839fed42 X-MS-TrafficTypeDiagnostic: VI1PR08MB4493:|DB8PR08MB5404: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:2000;OLM:2000; x-forefront-prvs: 0255DF69B9 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39860400002)(136003)(366004)(376002)(346002)(13464003)(199004)(189003)(52536014)(9686003)(55016002)(186003)(86362001)(26005)(76116006)(54906003)(7696005)(110136005)(316002)(478600001)(15650500001)(8936002)(81156014)(81166006)(71200400001)(5660300002)(66446008)(53546011)(66946007)(64756008)(66476007)(4326008)(66556008)(2906002)(6506007)(55236004)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB4493; H:VI1PR08MB5376.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: anR/yebjTpR7xIOuRgXMUM2U2HOcgOCzkTGt2wkKmoPY4aTQfJEPexEtwwp6ipkYKCc9EB8+JpwNaGzhAG6tBOGKa02j3B5VRR9kQHSoMVynVqvC2LJWHjUEGnl9PbUY/eRaU1UU6PKODg9PbWcO6RX49VjS39i8ksVQ6RbrXo3yuZK7uG+CDwwGM5eQ80Vi7NaCA/fIEi2Pxixut1xR3MHbKlShfFREKt0QUUjj4FEAnlyhDA5qSsbVtnFjode+uX0XdyWDCraT89TXgisZzvA4xfRIV2fAmbq4HVL+A8Jk0U02si4LrxddX/oSG3n2TPVvM4/5Mqf0WUTP1OvTgO3Db8ojfw+x3t8nGPdq0f48kJjRUgbTdr3YGkJclZfxkQUeBb96DhVdihoDoZYRqS1r8mbFiTjJX4Z01oFhR+mgdBKFjhN9pJPBhHja+vPa4OtbLPh/MpjnF1O10p2R1N/ZCeiIHBBYPjHfHfnrUYyYS3+RBGJkrTZFcSNAHzlp x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4493 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT028.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(376002)(396003)(39860400002)(13464003)(189003)(199004)(110136005)(54906003)(8936002)(86362001)(15650500001)(70586007)(76130400001)(52536014)(5660300002)(478600001)(316002)(36906005)(81156014)(55016002)(2906002)(26826003)(9686003)(81166006)(356004)(336012)(6506007)(53546011)(186003)(7696005)(26005)(4326008)(33656002)(70206006); DIR:OUT; SFP:1101; SCL:1; SRVR:DB8PR08MB5404; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Pass; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: d891e212-bc85-4d56-e563-08d7839fe8b1 NoDisclaimer: True X-Forefront-PRVS: 0255DF69B9 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iUxdulmuhZZIfyoBFuLp7s6qmUzyFAcXJ1DD4bPdTrPr/wd2YANAcNv7D4DYv0uxvuWLUTGk/ytzb5Fv8Tio6NorHRfk87OADdMloVLNJBngBwo2ZFkEF0cPbq2lcfTILOIizQdenVlKTHn/Vo61Aszj9GCiJmXaNVSbpOS/BmlcBwu6yJc5as+WK0EggJ7XyF/irqaNvBy8CII4KOD9Fj4hO/xmqfHElcbGJcchFBKa+/2OO8S6HqL9SltuyUadPImJg7BbcSQbc+YtxDwW3kjQd6jCUT9gH4PNmTh1GQhrUAYK+eKz8PQoc42i/KFtpWXM22uiaMINPtF8klA1hIs1p+zVCUu+5mslwntfVsaDMtizDn3ZrMrmRJ9pu5KYi+2sggJzOizbYGdSZQ0gxbuG+K7WPMOeGy6U0YtQFpgR8sbkxREYT6QovuBIXByYgRIXW4e46wvsDGZ2X1w0o8YNV1fnDUsmW4eBXJ9y8CN81q5CPBgFDSiBSa+yuXB1 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2019 09:51:59.9211 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d439f35e-cd2e-41da-5a75-08d7839fed42 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5404 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 Jiang, > -----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 >=20 > 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 "e= xpand the notification to include the avail index and avail wrap counter, i= f any"?=20 >=20 > Signed-off-by: Cheng Jiang > --- >=20 > v2: > * Removed rte_unused attribute in *hw. > * Added some comments on notify_data. >=20 > 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(-) >=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..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) > } >=20 > 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 matche= s the above comment? =20 > + vq->vq_avail_idx) << 16) | vq- > >vq_queue_index; > + } 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); > } >=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 fie= ld. */ > /* The Host publishes the avail index for which it expects a kick > -- > 2.17.1