From nobody Tue Nov 26 14:45:45 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=1706259867; cv=pass; d=zohomail.com; s=zohoarc; b=hg2nTNXOLrj/H3FMg+wn+Ul5yPiuW4Xj+5uBXWolqBt7ug/8e0TvIt2SjhLqE+PwK5fVxvSsDHa3H5000hjaqyf20xG/l2Y/Q+KXQCJU8az1SY4lsrtlF/Xd4TXqeAvjYaiuICrSHo76VCpQFFtG9AREFPF8QN66/YMLYk1fHzs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706259867; 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=j+kCJQ/lILeR6UQ7HR61TWC6noJQBEGYI2u0SPwmzpM=; b=P+wsQt4GuR2IBqI0FRy0hVe5vnJ1jzjfsYi+8RxZfYxQrL6JoqBwtgVYSe2RD9F/8XZwM94cwlGATcGKTyzROhNyzYA1WjEeQoA4q2Kg7HhclhB7uzYz3alqXByVA0BbhMGDNK/WeKk/pQxwigh++a65oZhAoqzlIYbgIdIMLqU= 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 1706259867278617.0683137036383; Fri, 26 Jan 2024 01:04:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTI88-0001E5-Hu; Fri, 26 Jan 2024 04:04: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 1rTI86-0001Dw-2f for qemu-devel@nongnu.org; Fri, 26 Jan 2024 04:04:06 -0500 Received: from mail-dm6nam10on2139.outbound.protection.outlook.com ([40.107.93.139] helo=NAM10-DM6-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 1rTI83-0001Bs-Sv for qemu-devel@nongnu.org; Fri, 26 Jan 2024 04:04:05 -0500 Received: from SN4PR13MB5727.namprd13.prod.outlook.com (2603:10b6:806:213::12) by PH7PR13MB5865.namprd13.prod.outlook.com (2603:10b6:510:157::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.37; Fri, 26 Jan 2024 08:58: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.7228.027; Fri, 26 Jan 2024 08:58:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VErENfx5nnoBKlnzTWvG+IXUUCet+E8CBXj3o+TO4LwVauSg4WA2VC3iJX4yd5s0sD2ZzryFGtv9xfaLI/MI6TQOUrn58q4BEetL7vMgxsmD2s2rkCu/ln/CAu1lLeh3tAUAyi6sDlcwB+4rGmjc+duRsAhx33XqdsvLAZHmSSo/2Wft67nYQ0QedUqiE8Rp2qwyrgT1GD88YnhLx2J66n4K8wZr5d0YIWRl3aKDr2bY2SCZF/Gz2EXbrRKjJeGlc0LE+nL5is10/a0dqagv0ooGIs4YLut6aaion+IE9F+x9dttFuRT1i3KipPozR0iZGQfAv59frUAo3oPsBaj3Q== 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=j+kCJQ/lILeR6UQ7HR61TWC6noJQBEGYI2u0SPwmzpM=; b=GWhpEF/PPOnBxhomWivyIZ0kGGuH5LatLkhSiBq/6AY82bAwgU7GJIgViJ3ZXXC+HEG0ntLCC3jzQXias+lXOWLkSYvVnmKfIdW8j7iKX9VCHtIOHQ3vt3+iE4vxGkoJnhorP9UiZtzuSkqZWA2RuGFP3MQ9RPcl+Pxes9qx82RyVMnN7szK/QcKgEpbjvIjBs9+UkgPATPyuPOrAtMjsdaSCFcZUWHoMLepVGFKSxsPlJUEdAApt7ZZgfPtSZyisd4zTElSCMpvd/Bis19vllYvXhlR2ra7Z6nBsb7xxs7o+0G8vr2s7JANKqOO/cJjLlVaZtxsQM2YhONxVOrcgQ== 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=j+kCJQ/lILeR6UQ7HR61TWC6noJQBEGYI2u0SPwmzpM=; b=shOxXxvp/X/IKM7PmrCDyOcU+1wm9WV+QwPK5o28mzW+YdD1IoVXWlcVLqfhNsnN79MctCT+BQVPdov32WCV5a71Ec89f0uW8ewbNO9WHnK2XD6BfCHrYhXHoRUrveJ3EgThk3OCg3TPQT8YIGvpaz25mjWvURLYViHMlEwFuKEC22DihXUvIYksa4zm7jVhSyqL0MBjXaouKdEdQ+RTFR/O388Q4P+M1ydgYmdyeuD+NUMbf5ZU7s0MKGdKbL3P19yavAWmKpu6tQIgdw+umAZK6LfGeCiix2EmBfeV6phLy7Q/XkaIkcy6xQ0HAIDy3keVMLy8XYbZsW5w+J3zfg== From: Wentao Jia To: Rick Zhong , Eugenio Perez Martin CC: "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/EgY4mSYwAAJ9PgAABGqn8AAAz8ygAfvHuzAAhk7OgAA1l2oAAAD22YAAB9kDgACXz1iAAAgyIIAAAEaZwAFcG0xw Date: Fri, 26 Jan 2024 08:58:57 +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_|PH7PR13MB5865:EE_ x-ms-office365-filtering-correlation-id: d168361c-38aa-433e-9a6b-08dc1e4d0811 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +8sGZIf5v0tZMuhFR5opBveqEB8NEzBOeIDJ36ACJhYoZv8LV3qBvv1Jp7SGS77q4tJZ/fsqzNXlKuVa0Tt1xckws0wjnI8tbMveX0tmGvzrtaobsUkFF2Ng1hCWMgxtV3vSTc/lqb268nPMvtIyQIv2u2yYFDOohgxIFRCpoNgGNi/DpjixRTO0LGXL1KYEYI9u1Wp7bi7LdNIO2ke61M9Yhh7buBYqR7fx8IWDYWPwaxpcHbStmw/2ZTRvB51A/SDg1LFMlLU65n2YEMEGtoqq7lcGeFYUCqywPMiG5/b1GVhJhzB/P4nBnNDkgxCfb3BQH3IDGJO4QgQn45+S3Vl3T5LmkXpaEERT98msqNiv8U3BV+EwhQLfVlL5nM55K1hG5SMhZSssi02H7vTIoSkshXaZuKDvksZaWi2TFWvoyU3EkS/xDQj+TxOfFmFTJOscrsVbmUST92SCKmVsfZ8ZiiEXYHtXquJiisPwUag0c/V0YYLsUa6zULJUftJ9J0gfqO6l0tsbkutb/bRfJQxOryVxqOF5h4hJ7abeemOVKabRklIq4bXAaweOCWD3xB3QrDXeKaNO8S30tCSerLOp8e+1ZSAV1/GzrhXBIurOfcmhJXyuhtWz3E+bJGjVcrcrvgXGsazu7evNfFmIzvz6ZZ3mo9dKts8ToBisxV0= 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)(39840400004)(366004)(136003)(346002)(376002)(230922051799003)(230273577357003)(230173577357003)(1800799012)(451199024)(186009)(64100799003)(7696005)(9686003)(66899024)(107886003)(6506007)(53546011)(83380400001)(41300700001)(66476007)(8676002)(38070700009)(66946007)(5660300002)(64756008)(2906002)(54906003)(316002)(86362001)(8936002)(110136005)(52536014)(66556008)(33656002)(66446008)(76116006)(44832011)(26005)(4326008)(71200400001)(966005)(478600001)(122000001)(55016003)(38100700002)(550774002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?L28zZ1Q3cWJLUVV2QVdpUHplOVBSN0tPb2YvblU1RkRrMnY3anU3dDV2b1hi?= =?utf-8?B?bTR0TUc4aHMvR3dZT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dTR3NtOTJkMG1Bai9H?= =?utf-8?B?SHkwSC80WS8xMHdjN0M2Zm1PbDJqVjhVWWtVcnJacVI4SjgrVCt1VEdFYzc3?= =?utf-8?B?MllSeHVwTi9udHgrZU8ydy9YbytmTDNETGlPTVdiWEpOWFlEdXg0aWJiZkpy?= =?utf-8?B?eGtFcFI5L1lNVXBSR290L0VWSlhUaHlKd3FjUndBdDQ2OG56eWJTUHo2Zkhu?= =?utf-8?B?V3RYdlloSW5UQ1J3Zm1mTGN2K1Q2WkZCRVU5aDlCVkNlYTZOL1VGeWpzR2Zo?= =?utf-8?Q?T26RGno3UFIosZASTLHRU/4HH?= 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: d168361c-38aa-433e-9a6b-08dc1e4d0811 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jan 2024 08:58:57.5919 (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: XCwQdrAPyIZilmmD1+FQbbb2Kp8fwdGz/A6KPp7W+67vmJm5Xypd3dcqwjXEOJFtpeVVc/iD1kCBqzErFBRk8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5865 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.93.139; envelope-from=wentao.jia@nephogine.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 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_BL_SPAMCOP_NET=1.347, 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=no 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: 1706259869233100001 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 command = line Do you have comments about this patch? Best Regards Wentao Jia VIRTIO_F_IN_ORDER and VIRTIO_F_NOTIFICATION_DATA feature are important feat= ure for dpdk vdpa packets transmitting performance, add these features at vhost= -user front-end to negotiation with backend. In this patch, these features are turned off by default, turn on the featur= es 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 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 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 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 virtio_queue_enabled_legacy(VirtIODevice *vdev, int n); -- 2.31.1 -----Original Message----- From: Rick Zhong =20 Sent: Friday, January 19, 2024 6:39 PM To: Eugenio Perez Martin ; Wentao Jia Cc: qemu-devel@nongnu.org; mst@redhat.com; Jason Wang = ; Peter Xu ; Guo Zhi Subject: =E5=9B=9E=E5=A4=8D: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER = and VIRTIO_F_NOTIFICATION_DATA feature Hi Eugenio, Thanks for your comments. Very helpful. Wentao and I will discuss and get b= ack 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 ; Jason Wang ; Peter Xu ; Guo Zhi =E4=B8=BB=E9=A2=98: Re: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER and V= IRTIO_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 important=20 > feature for dpdk vdpa packets transmitting performance, add the 2=20 > 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 append= ed to the array of the QEMU version that introduced the property in the vir= tio_net_properties array, not the one that imported the macro from the kern= el. This allows QEMU to know that old versions have these features disabled= although the default set in hw/net/virtio-net.c:virtio_net_properties is t= rue when migrating from / to these versions. You can check that this is added properly by migrating from / to a previous= version of QEMU, with the combinations of true and false. You have an example in [1] with blk devices multiqueue. CCing Peter Xu as h= e knows more than me about this. This is very easy to miss when adding new features. Somebody who knows perl= should add a test in checkpath.pl similar to the warning "added, moved or = deleted file(s), does MAINTAINERS need updating?" when virtio properties ar= e 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 feature= s as available when they're not. You can test it by running qemu with the p= arameters: -netdev tap,id=3Dhostnet0,vhost=3Doff -device virtio-net-pci,netdev=3Dhostn= et0,... The emulated device must support both features before making them tunnables. On the other hand, all kinds of virtio devices can use in_order and notific= ation_data, so they should be in include/hw/virtio/virtio.h:DEFINE_VIRTIO_C= OMMON_FEATURES. But not all of them benefit from in_order. One example of t= his is virtio-blk. It is usual that requests are completed out of order by = the backend device, so my impression is that in_order will hurt its perform= ance. I've never profiled it though, so I may be wrong :). Long story short: Maybe in_order should be false by default, and enabled ju= st 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] https://www.qemu.org/docs/master/devel/migration/compatibility.html#how= -backwards-compatibility-works [2] https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg02772.html > DEFINE_PROP_END_OF_LIST(), > }; > > -- >