From nobody Wed Nov 13 07:26:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nephogine.com); dmarc=pass(p=none dis=none) header.from=nephogine.com ARC-Seal: i=2; a=rsa-sha256; t=1706784844; cv=pass; d=zohomail.com; s=zohoarc; b=ilXI65silWDWV5QFTEamMninAl7CPlApJaC+Of9XczZAgZAxg/1f2ptfRoaRLs1yQD9/UnGn9pU+W01Si+7yHeZMaF8J8p1+BkvhhaJlKG/6HZfzi8BYAEK5uJCiQA2YyC4CZpcTDyJFwoYRnYSF59ypS6XLmeinL7ota6FM4JM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706784844; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KzHBqrYYkbjnNygPXXqa+2Ey5GpU7d4iZBCHEZc65/Q=; b=l9WYLWQxRgveNIWw8XmFBncsSu3Cw2IVAJhXBa8+hmFxRGMVM60AXjyA/fZ62/U++epPoa/m3hDt4e6zrLzvxiEw7P/l5/KI9HVYkjHsY++r1w10N94hC9MIMwhjBenbEEdipvcB9MP4ZQEsx1Wq1vOZgHSgGPpGBU4YSjDLj70= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nephogine.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170678484395212.12272746512599; Thu, 1 Feb 2024 02:54:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rVUgv-0003mQ-99; Thu, 01 Feb 2024 05:53:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rVUgt-0003lp-JQ for qemu-devel@nongnu.org; Thu, 01 Feb 2024 05:53:07 -0500 Received: from mail-bn1nam02on2105.outbound.protection.outlook.com ([40.107.212.105] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rVUgr-0000F5-5w for qemu-devel@nongnu.org; Thu, 01 Feb 2024 05:53:07 -0500 Received: from SN4PR13MB5727.namprd13.prod.outlook.com (2603:10b6:806:213::12) by DM8PR13MB5126.namprd13.prod.outlook.com (2603:10b6:8:31::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Thu, 1 Feb 2024 10:47:57 +0000 Received: from SN4PR13MB5727.namprd13.prod.outlook.com ([fe80::4ae0:9319:cd44:9350]) by SN4PR13MB5727.namprd13.prod.outlook.com ([fe80::4ae0:9319:cd44:9350%4]) with mapi id 15.20.7249.027; Thu, 1 Feb 2024 10:47:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KAHOS9l+Ds8PsIb279M4NN3DGmkii9jzmVPs04F9Q6ItEC344z7nrVJYz2IYYBdAxVyW9YUKAox3iE5UJYiMR3bmOrIvPnbxMeUtDhMPqwHOv1WUFzrOfE3BUjXNRLNZvDWy5nNvq//ykJkqf3xlLsnGIxtn6t/fndKgcNrPAUGNsCmwOMOfkpOG+0XTFHcQoRyrdXg7D8hkS+t8ulNfg3HLdx9GyuD61mslADy6tU/J3WYCjvmC8kvRUcvxGXDwwWsAlXf1N3cQ2jwGpWDDCJcSh4UILzyxc9pEj9KKp+jcfu8h5KxWQz6NgMQ1M5CEbMjBp2I/8K3O0IJFAzrUUg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KzHBqrYYkbjnNygPXXqa+2Ey5GpU7d4iZBCHEZc65/Q=; b=jLEItKNeBQn5abQ3zr1XbuI5rXkMhwpZORrBrwITm3WJopPKQs/MtawqBoKNQavxe02NYyJDe+BzsWVTgmdskUMe84t2Q+3F/F7krvDchO2mpfTGZ+4F2GzgF5wqnW7NugeeOEsacHKyWXdIY4ikAwfjyRqyxVlLSxHaedKDQA3gnEgg9xwWlGDAe5OchBhYvMRs7MQY/MJOSwapNkI8ypMr+I+cBEwLQuOfzoJFOkU/JzV/5UlsQ4weGpCn/MhZgiMdkqhF4WD0XqK6fbSPYBHfQK4lKBAhCsdcecaAHoS7YxXC8IJJuOFhzDGwBMQOPTsWNyyhPTsIUF9UqcIBzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nephogine.com; dmarc=pass action=none header.from=nephogine.com; dkim=pass header.d=nephogine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nephogine.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KzHBqrYYkbjnNygPXXqa+2Ey5GpU7d4iZBCHEZc65/Q=; b=pA/W3NVLWhLCHBdEyLTSbKdniiCS9Bh9kQixZ9XHsVNovkAIu4w4btCydwoUvChCTJHrrzQgaSBPQPJpwOr8rjoKO/fTJLP/P1+IfZpvpd99qjsc/BlHUNkkd83LJW0Qci+r9ZLSLELquLMjqBAtDz3rr1RXYIRNg09J9+nRu/zflhg4T2KliRw6dIIGqEy005Q4eHCtJgLuQfkaWK42a+sI2T2HRxwVb9B1PwoL8GRSDY9zfRqFt8qgDvquybr2vKkx5xrG6tuOepO/am+yhBn/ZJGEUEOcqjxqYqDTG0L5wiImJldWCv7cWP9HweuKxuqEDXKB+PVwFoXTHVmiqQ== From: Wentao Jia To: Eugenio Perez Martin CC: Rick Zhong , "qemu-devel@nongnu.org" , "mst@redhat.com" , Jason Wang , Peter Xu , Guo Zhi , Xinying Yu Subject: RE: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER and VIRTIO_F_NOTIFICATION_DATA feature Thread-Topic: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER and VIRTIO_F_NOTIFICATION_DATA feature Thread-Index: AdokPrZLsAJfb0btQhCy7EbMDce/EgY4mSYwAAJ9PgAABGqn8AAAz8ygAfvHuzAAhk7OgAA1l2oAAAD22YAAB9kDgACXz1iAAAgyIIAAAEaZwAFcG0xwABOlOwABFssUYA== Date: Thu, 1 Feb 2024 10:47:56 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nephogine.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN4PR13MB5727:EE_|DM8PR13MB5126:EE_ x-ms-office365-filtering-correlation-id: c9f77d9d-3149-4001-b6f2-08dc2313402a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1MVCxaAcKiNY05KZ+paHvC+89ik0AgusxlTrok4K09k9D4yIfXaIlsYp6tN66GXF5BbQpSHOXkVtQt2sU/ys773savH0vf8oAlR5mhKT5YrE/2Nuoo0/Wshx7U/XQk0hm9D3R6aqdr+S30aEM32DnzdfOGlTKHwIt0nr+yndFBPJhJYWmlTWgVDg0aAQPTzB25mm1QDfBjYDU5Nhi8IRQZj5fyEyg3QpB5qB8hrBn49S5Vcu5qk1h74Ob/5tGqr5gFhcIUovMrNSlWycn/9PxpmsVaouZ9Kapzz6Jl6CdAWHC3Jz0l2kG4PkkygqZU5F/a9r0lLtrf68Cw+DZUgWgIGZoa0k9edGWJQlvEr1cBqGdj1tPHy6ecGEOKTt9bIQGbONhEDoCGvmhuQXSzOOSwm9QUfFyzgpUO0iRD0Fk3N4XtVshoTKD6sWdxcR7vYU3RAJFEHhoYihSqDK2nfaQ6Ds40Vi3BSyj3KALUvs9kB/E3zNWg8Ur/bwXvBjGVTuboh8kY/d7eEtgHMI+YnQCVnoozS4O7q7oPi2KG+iLmr9u7ClmIP2vZ4UQmE/wkT2sIZDWrUDiAIqGuPFC5r3iuf3HrRVxwuE8VysicpxNySPtjWfj3MocJPF7n7WdjUKRiJKiPLeXPJ8/UspuLonpaq0blYVo1c1kbys5H66LzE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN4PR13MB5727.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(376002)(346002)(136003)(39830400003)(230273577357003)(230922051799003)(230173577357003)(64100799003)(451199024)(1800799012)(186009)(41300700001)(66899024)(66946007)(8936002)(66446008)(52536014)(30864003)(8676002)(33656002)(44832011)(2906002)(4326008)(5660300002)(76116006)(86362001)(6916009)(66556008)(64756008)(316002)(38070700009)(54906003)(966005)(7696005)(66476007)(38100700002)(122000001)(6506007)(83380400001)(478600001)(53546011)(71200400001)(9686003)(107886003)(55016003)(550774002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?WlBZMUZOVXNDZFpLMVZuVUdNSzNGL1ZJU1hKMEE5WXhkVHBOSHI5R1V0NWgz?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2NEFmOEJzNEFxbkIvN3hw?= =?utf-8?B?OVpkVWRZVGdFb2hQNFJ0QlJaYkk3NXV5Yk83TjBQbm5EWmdQZEs2blNmZ3FE?= =?utf-8?B?YURCNUxRWmZkVTBzaXdtb29TZzRrK2g5VldsZ2JHRFEwZnNBemlDWEVkaVJO?= =?utf-8?B?ZHZNMTYrcGQ1aFdudFZqVS8renBQRVZFSm94VWNKVWxkTFFFTnF0STVYd2d0?= =?utf-8?B?N01tc2dmSlJqNlZHZGI2SGZTQjZmczdadVZFSHcwQVRhb1R5YzVlSEEzZVd1?= =?utf-8?Q?WjCM=3D?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nephogine.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN4PR13MB5727.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9f77d9d-3149-4001-b6f2-08dc2313402a X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Feb 2024 10:47:56.7311 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WLS7+CPnv59y/BG1el/24qY3aajyoQlMriXk+IG+LD5E1VSygbprUprWrc2QxPEAcnMs17L1BAEmkW0Ubrtzyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR13MB5126 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.212.105; envelope-from=wentao.jia@nephogine.com; helo=NAM02-BN1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nephogine.com) X-ZM-MESSAGEID: 1706784846078100001 Hi, Eugenio Thanks for you comments It is a dilemma, our team mainly work on smartNIC vDPA, features implementa= tion in the QEMU emulated devices is a certain workload for us. I have a proposal, clear these features except vhost, it will not affect em= ulated devices, do you agree the change? partial codes for clear these features diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 7a2846fa1c..f4cf8b74da 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -822,6 +822,8 @@ static uint64_t virtio_net_get_features(VirtIODevice *v= dev, uint64_t features, } if (!get_vhost_net(nc->peer)) { + virtio_clear_feature(&features, VIRTIO_F_IN_ORDER); + virtio_clear_feature(&features, VIRTIO_F_NOTIFICATION_DATA); return features; } Best Regards Wentao Jia -----Original Message----- From: Eugenio Perez Martin =20 Sent: Saturday, January 27, 2024 2:04 AM To: Wentao Jia Cc: Rick Zhong ; qemu-devel@nongnu.org; mst@r= edhat.com; Jason Wang ; Peter Xu ; = Guo Zhi ; Xinying Yu Subject: Re: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER and VIRTIO_F_NOT= IFICATION_DATA feature On Fri, Jan 26, 2024 at 9:59=E2=80=AFAM Wentao Jia wrote: > > Hi, Eugenio > > Thanks for you comments, Our team has made new change about the patch,=20 > these features in hw/virtio/virtio.h:DEFINE_VIRTIO_COMMON_FEATURES, > they are turned off by default , and can be turned on from at qemu=20 > command line Do you have comments about this patch? > If the commandline is set to =3Don on an emulated device, we're back at squ= are one: The guest will try to use these features in the emulator device an= d the kick or the descriptors exchange will fail. Maybe we can propose their implementation in the emulated devices on Google= Summer of Code? Would you be interested in mentoring this? I can help with= it for sure. On the other hand I'm not sure about the benefits of notification_data for = emulated devices or even vhost-kernel. My understanding is that the data wr= itten cannot be passed with the eventfd, so QEMU should fully vmexit to the= iowrite (which probably is slower in the event of a lot of notifications).= Unless we can transmit the avail idx, the device must read the avail ring = anyway. So the question for MST / Jason is, Is this enough justification to maybe f= ail the initialization of virtio-net-pci devices with backends different th= an vhost-user of vdpa if notification_data=3Don? Should this be backed by p= rofiled data? In my opinion the emulated device should implement it and be =3Doff by defa= ult, just for testing the driver implementation. But maybe it can be done o= n top after the early failure? Thanks! > Best Regards > Wentao Jia > > > VIRTIO_F_IN_ORDER and VIRTIO_F_NOTIFICATION_DATA feature are important=20 > feature for dpdk vdpa packets transmitting performance, add these=20 > features at vhost-user front-end to negotiation with backend. > > In this patch, these features are turned off by default, turn on the=20 > features at qemu command line. > ... notification_data=3Don,in_order=3Don ... > > Signed-off-by: Wentao Jia > Signed-off-by: Xinying Yu > Signed-off-by: Kyle Xu > Reviewed-by: Shujing Dong > Reviewed-by: Rick Zhong > --- > hw/core/machine.c | 2 ++ > hw/net/vhost_net.c | 2 ++ > include/hw/virtio/virtio.h | 6 +++++- > 3 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/hw/core/machine.c b/hw/core/machine.c index=20 > fb5afdcae4..40489c23a6 100644 > --- a/hw/core/machine.c > +++ b/hw/core/machine.c > @@ -40,6 +40,7 @@ GlobalProperty hw_compat_8_1[] =3D { > { "ramfb", "x-migrate", "off" }, > { "vfio-pci-nohotplug", "x-ramfb-migrate", "off" }, > { "igb", "x-pcie-flr-init", "off" }, > + { "virtio-device", "notification_data", "off"}, > }; > const size_t hw_compat_8_1_len =3D G_N_ELEMENTS(hw_compat_8_1); > > @@ -65,6 +66,7 @@ GlobalProperty hw_compat_7_1[] =3D { > { "virtio-rng-pci", "vectors", "0" }, > { "virtio-rng-pci-transitional", "vectors", "0" }, > { "virtio-rng-pci-non-transitional", "vectors", "0" }, > + { "virtio-device", "in_order", "off"}, > }; > const size_t hw_compat_7_1_len =3D G_N_ELEMENTS(hw_compat_7_1); > > diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index=20 > e8e1661646..211ca859a6 100644 > --- a/hw/net/vhost_net.c > +++ b/hw/net/vhost_net.c > @@ -76,6 +76,8 @@ static const int user_feature_bits[] =3D { > VIRTIO_F_IOMMU_PLATFORM, > VIRTIO_F_RING_PACKED, > VIRTIO_F_RING_RESET, > + VIRTIO_F_IN_ORDER, > + VIRTIO_F_NOTIFICATION_DATA, > VIRTIO_NET_F_RSS, > VIRTIO_NET_F_HASH_REPORT, > VIRTIO_NET_F_GUEST_USO4, > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h=20 > index c8f72850bc..e6aa10f01b 100644 > --- a/include/hw/virtio/virtio.h > +++ b/include/hw/virtio/virtio.h > @@ -368,7 +368,11 @@ typedef struct VirtIORNGConf VirtIORNGConf; > DEFINE_PROP_BIT64("packed", _state, _field, \ > VIRTIO_F_RING_PACKED, false), \ > DEFINE_PROP_BIT64("queue_reset", _state, _field, \ > - VIRTIO_F_RING_RESET, true) > + VIRTIO_F_RING_RESET, true), \ > + DEFINE_PROP_BIT64("in_order", _state, _field, \ > + VIRTIO_F_IN_ORDER, false), \ > + DEFINE_PROP_BIT64("notification_data", _state, _field, \ > + VIRTIO_F_NOTIFICATION_DATA, false) > > hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n); bool=20 > virtio_queue_enabled_legacy(VirtIODevice *vdev, int n); > -- > 2.31.1 > > -----Original Message----- > From: Rick Zhong > Sent: Friday, January 19, 2024 6:39 PM > To: Eugenio Perez Martin ; Wentao Jia=20 > > Cc: qemu-devel@nongnu.org; mst@redhat.com; Jason Wang=20 > ; Peter Xu ; Guo Zhi=20 > > Subject: =E5=9B=9E=E5=A4=8D: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDE= R and=20 > VIRTIO_F_NOTIFICATION_DATA feature > > Hi Eugenio, > > Thanks for your comments. Very helpful. Wentao and I will discuss and get= back to you later. > > Also welcome for any comments from other guys. > > Best Regards, > Rick Zhong > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Eugenio Perez Martin > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2024=E5=B9=B41=E6=9C=8819=E6=97=A5 = 18:26 > =E6=94=B6=E4=BB=B6=E4=BA=BA: Wentao Jia > =E6=8A=84=E9=80=81: qemu-devel@nongnu.org; mst@redhat.com; Rick Zhong=20 > ; Jason Wang ;=20 > Peter Xu ; Guo Zhi > =E4=B8=BB=E9=A2=98: Re: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER and=20 > VIRTIO_F_NOTIFICATION_DATA feature > > On Fri, Jan 19, 2024 at 7:42=E2=80=AFAM Wentao Jia wrote: > > > > > > VIRTIO_F_IN_ORDER and VIRTIO_F_NOTIFICATION_DATA feature are=20 > > important feature for dpdk vdpa packets transmitting performance,=20 > > add the 2 features at vhost-user front-end to negotiation with backend. > > > > Signed-off-by: Kyle Xu > > Signed-off-by: Wentao Jia > > Reviewed-by: Xinying Yu > > Reviewed-by: Shujing Dong > > Reviewed-by: Rick Zhong > > --- > > hw/core/machine.c | 2 ++ > > hw/net/vhost_net.c | 2 ++ > > hw/net/virtio-net.c | 4 ++++ > > 3 files changed, 8 insertions(+) > > > > diff --git a/hw/core/machine.c b/hw/core/machine.c index > > fb5afdcae4..e620f5e7d0 100644 > > --- a/hw/core/machine.c > > +++ b/hw/core/machine.c > > @@ -40,6 +40,7 @@ GlobalProperty hw_compat_8_1[] =3D { > > { "ramfb", "x-migrate", "off" }, > > { "vfio-pci-nohotplug", "x-ramfb-migrate", "off" }, > > { "igb", "x-pcie-flr-init", "off" }, > > + { TYPE_VIRTIO_NET, "notification_data", "off"}, > > }; > > Assuming the default "true" in > hw/net/virtio-net.c:virtio_net_properties is valid, this needs to be appe= nded to the array of the QEMU version that introduced the property in the v= irtio_net_properties array, not the one that imported the macro from the ke= rnel. This allows QEMU to know that old versions have these features disabl= ed although the default set in hw/net/virtio-net.c:virtio_net_properties is= true when migrating from / to these versions. > > You can check that this is added properly by migrating from / to a previo= us version of QEMU, with the combinations of true and false. > > You have an example in [1] with blk devices multiqueue. CCing Peter Xu as= he knows more than me about this. > > This is very easy to miss when adding new features. Somebody who knows pe= rl should add a test in checkpath.pl similar to the warning "added, moved o= r deleted file(s), does MAINTAINERS need updating?" when virtio properties = are modified :). > > > const size_t hw_compat_8_1_len =3D G_N_ELEMENTS(hw_compat_8_1); > > > > @@ -65,6 +66,7 @@ GlobalProperty hw_compat_7_1[] =3D { > > { "virtio-rng-pci", "vectors", "0" }, > > { "virtio-rng-pci-transitional", "vectors", "0" }, > > { "virtio-rng-pci-non-transitional", "vectors", "0" }, > > + { TYPE_VIRTIO_NET, "in_order", "off"}, > > }; > > const size_t hw_compat_7_1_len =3D G_N_ELEMENTS(hw_compat_7_1); > > > > diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index > > e8e1661646..211ca859a6 100644 > > --- a/hw/net/vhost_net.c > > +++ b/hw/net/vhost_net.c > > @@ -76,6 +76,8 @@ static const int user_feature_bits[] =3D { > > VIRTIO_F_IOMMU_PLATFORM, > > VIRTIO_F_RING_PACKED, > > VIRTIO_F_RING_RESET, > > + VIRTIO_F_IN_ORDER, > > + VIRTIO_F_NOTIFICATION_DATA, > > VIRTIO_NET_F_RSS, > > VIRTIO_NET_F_HASH_REPORT, > > VIRTIO_NET_F_GUEST_USO4, > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index > > 7a2846fa1c..dc0a028934 100644 > > --- a/hw/net/virtio-net.c > > +++ b/hw/net/virtio-net.c > > @@ -3949,6 +3949,10 @@ static Property virtio_net_properties[] =3D { > > VIRTIO_NET_F_GUEST_USO6, true), > > DEFINE_PROP_BIT64("host_uso", VirtIONet, host_features, > > VIRTIO_NET_F_HOST_USO, true), > > + DEFINE_PROP_BIT64("in_order", VirtIONet, host_features, > > + VIRTIO_F_IN_ORDER, true), > > + DEFINE_PROP_BIT64("notification_data", VirtIONet, host_features, > > + VIRTIO_F_NOTIFICATION_DATA, true), > > This default=3Dtrue is wrong, and makes emulated devices show these featu= res as available when they're not. You can test it by running qemu with the= parameters: > > -netdev tap,id=3Dhostnet0,vhost=3Doff -device virtio-net-pci,netdev=3Dhos= tnet0,... > > The emulated device must support both features before making them tunnabl= es. > > On the other hand, all kinds of virtio devices can use in_order and notif= ication_data, so they should be in include/hw/virtio/virtio.h:DEFINE_VIRTIO= _COMMON_FEATURES. But not all of them benefit from in_order. One example of= this is virtio-blk. It is usual that requests are completed out of order b= y the backend device, so my impression is that in_order will hurt its perfo= rmance. > I've never profiled it though, so I may be wrong :). > > Long story short: Maybe in_order should be false by default, and enabled = just in virtio-net? > > You can see previous attempts of implementing this feature in qemu in [2]= . CCing Guo too, as I don't know if he plans to continue this work soon. > > Please let me know if you need any help with these! > > Thanks! > > [1]=20 > https://www.qemu.org/docs/master/devel/migration/compatibility.html#ho > w-backwards-compatibility-works [2]=20 > https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg02772.html > > > DEFINE_PROP_END_OF_LIST(), > > }; > > > > -- > > >