From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B92AB42E44; Tue, 11 Jul 2023 11:25:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3471A40A7D; Tue, 11 Jul 2023 11:25:31 +0200 (CEST) Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2088.outbound.protection.outlook.com [40.107.117.88]) by mails.dpdk.org (Postfix) with ESMTP id C42BF4003C for ; Tue, 11 Jul 2023 11:25:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UNbzLoUsvPrAqf3IarkgeFacK6Zpd1qFy0kJ3v1cZdJm4kGFDR7qdTeOT6QlzmZzxvx1mxNf1p2YGnk6Zr8Ty2dbt3WnolHVG9QUjWwINP/PLiYYF9dGlS2M/MnVitkkfL8ET/qt2QbCOOwiCCLHBDcQlzLSr1WKUZRdr6ydjDjsvikQamLhQ3gApq9FnCvCiqa6rCg88CGCKhTdhiuDjiG10IdwcQ6WnQ2nwWUTFOCoZEOXLBpLODMtZMFfRQ0mOSKJsqeQWSPNqbF/ION1cqcwA/XsfCQ62gc+PKjQMEYrJ4hubjQnS/AWQ+eXUumUIAxSnQoni3/+khNQkWltpw== 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=YMCbX7hBQIh9rpNOQpOh+ovd1CA9QKnw6k7VnkP7rrQ=; b=NkrFffZpCybnAJTk8aePTgH5OYFwr6xpmDfrBLV90FKOcX+c1THB1wbooz9NQ5bDBWYV66xhZWpNqK5+0G3x1Qq+uWEFz6GWoDpi2QT4edJKTymwAVroMaTgzjv7XmPFIjHZPC1cIbWBBgKhgIrrvHidgnVISaAWp6Jwf5/rjQo7pJ0JUeCx9a8yGOMFVF2tMo6hnjcXYogH4PmqZ871Yo341kI1MTXkzTVZwzKUPb2lyauDYQ6lFZjs3BMVyQV+J18v+u4QJNH36egkk1pQVb0EVyp6v8swDKxdBB2+wA7Rjp/XrT2nN2osxotzVnTZJWFxCg/Po7n59ugKe3Uatw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jaguarmicro.com; dmarc=pass action=none header.from=jaguarmicro.com; dkim=pass header.d=jaguarmicro.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jaguarmicro.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YMCbX7hBQIh9rpNOQpOh+ovd1CA9QKnw6k7VnkP7rrQ=; b=m0CTeaQj/ScYQX3Ki83QOsraPx8j+SyKihUPbYvUPp187ZMZvN8IKtElgL5d9VEtvZgAWcn33Jvj7/30EMPrjPTMrVNvRUJw4eKmfmKtJb9ygmP++7cpz1ONa0ss12E6BjxeWcVPZq6zjShpPsciQCVG2QsSxU5W6y8ID/Q/4nh0O1P/JEtN9Wp0w1HyqNoeRZUB5Y7VXKdyJOxf3Ta2j3JBfeli1D7hBjDw9axrA3BOgpAbDWgZxMBLZQ0PLkvGO4fxKUnYrAT0jYkfYNL3yolSHKwyIC/bKNpLZ0f7PcyZRNVnyFuXoG+TIHY27ET12ZlpYYZILiA7k0TL8C9ZXQ== Received: from PUZPR06MB4742.apcprd06.prod.outlook.com (2603:1096:301:b5::13) by TYZPR06MB5949.apcprd06.prod.outlook.com (2603:1096:400:337::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Tue, 11 Jul 2023 09:25:25 +0000 Received: from PUZPR06MB4742.apcprd06.prod.outlook.com ([fe80::936c:12e8:b8ef:7d51]) by PUZPR06MB4742.apcprd06.prod.outlook.com ([fe80::936c:12e8:b8ef:7d51%7]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023 09:25:25 +0000 From: Rma Ma To: dpdk-dev CC: Maxime Coquelin , Chenbo Xia Subject: =?gb2312?B?u9i4tDogW1BBVENIIHYzXSB2aG9zdDogYWRkIG5vdGlmeSByZXBseSBvcHMg?= =?gb2312?Q?to_fix_message_deadlock?= Thread-Topic: [PATCH v3] vhost: add notify reply ops to fix message deadlock Thread-Index: AQHZriKIUaeiph0Px0C7vwJ57C7k96+0VosO Date: Tue, 11 Jul 2023 09:25:25 +0000 Message-ID: References: <20230704023228.24879-1-rma.ma@jaguarmicro.com> <20230704025157.26024-1-rma.ma@jaguarmicro.com> In-Reply-To: <20230704025157.26024-1-rma.ma@jaguarmicro.com> Accept-Language: zh-CN, en-AS, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR06MB4742:EE_|TYZPR06MB5949:EE_ x-ms-office365-filtering-correlation-id: a47b2848-c1d4-4efc-9ea2-08db81f0c258 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dDTbe0hoolfHkolwechGULphh+6KQ2xMLW3QZgixkAhbuf2cgOOgay2o4nL7UzSkVfL38yu8OeoqS6Vb1kzGmCDBql0oBbNVdMmJe9G1E9WehHhraCH7I5w5xrTk6gVUF+CppAjO3gt+UeOkIBzEdUEo8HKOptbEwW7Q7ij+uTDPC4m4XkA6XHE2go1lfejbhhCWAj3fWZNPxg157uRGM8QjtvB5bNpiMywNl53+whZQCM+FAutzB0b0dSc1T3epw3735y7GrRtFluP/n82iSGo6UPev4jr1RPKghdWrRtQ3RUfsCQ56+f1VM2PW5kdQM3OYFTnMx2V69g5IbfLksmFIcTSE54Q7Lz3nEtjhtPDRtuOiI6KYQHIEh2ryJFA69jxnOSVwYRb4XTVSqKnSwe4Og4ymHhT4JVzsLO5HSG0u5X2FTTDUAYyvOs5BxaxWqhsBqrtiKtQk6dL4xwJb1Deh4VAG982dTUPLd7EHLOZFPJMculM7tiY0SBKXVJTt5YdxB87zLaRhYrmWTCDVj9sZA4LnPQtmXD7v9/JNboB3oHZjb4qZ50p+JE8p+dpG/gTa5H6EyB7VgPBCozbDEUx7N5AjX7cw5gjSAoKBy6HxISqbJm2F4zoX8NzkcVQX x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PUZPR06MB4742.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(346002)(376002)(39830400003)(136003)(396003)(366004)(451199021)(55016003)(54906003)(122000001)(66476007)(71200400001)(66946007)(91956017)(478600001)(6916009)(7696005)(8936002)(4326008)(76116006)(38100700002)(41300700001)(66556008)(186003)(66446008)(9686003)(83380400001)(6506007)(26005)(316002)(5660300002)(33656002)(15650500001)(2906002)(86362001)(52536014)(38070700005)(44832011)(64756008)(224303003)(19627405001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?gb2312?B?S1Z0eGVKMXgvSTBpb0g2T3IyNDBaNEh4VkUzU3F3ZlBrd3FPVU9VVXZReUJv?= =?gb2312?B?eDZPREVaUmN4ZEVPRU1STE1WZEZqYXRHNXRpRXNQRmtnRkY0elpRUVEwb05W?= =?gb2312?B?eXkydWRoT21nbTloNmZZTmZ2ZHFBTTlBbVRZYlRXeVRtTmUxNDVpek5UK3pw?= =?gb2312?B?NVczTEJoS1g4dFlxWkROa1Q5SEFRUTE1WEpKMXVyVENJUGJ1Z3ZZSks4RFJE?= =?gb2312?B?OXJhZ2NIZ2V1OFdhSGZyZ2QvZzBGVj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UEx1MGs0NUxMZ1YwckpJalp2M2FrNlEyZXFmY0tmTEcwQmNGbE9DZzZP?= =?gb2312?Q?/A9M=3D?= Content-Type: multipart/alternative; boundary="_000_PUZPR06MB47423251E6A4BBCA6B9FEDA39931APUZPR06MB4742apcp_" MIME-Version: 1.0 X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PUZPR06MB4742.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a47b2848-c1d4-4efc-9ea2-08db81f0c258 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2023 09:25:25.5252 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 1e45a5c2-d3e1-46b3-a0e6-c5ebf6d8ba7b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: j/FkDYxtNm8bFceesXyPdagnf1M0NJYlzgQZI8kP81LFj0BDHRWNERapONVbOM5uepRKHauKytNYSTvDckDxZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5949 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --_000_PUZPR06MB47423251E6A4BBCA6B9FEDA39931APUZPR06MB4742apcp_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 PiBTaW5jZSBiYWNrZW5kIGFuZCBmcm9udGVuZCBtZXNzYWdlIGFyZSBzeW5jaHJvbm91cyBpbiB0 aGUgc2FtZSB0aHJlYWQsDQo+IHRoZXJlIHdpbGwgYmUgYSBwcm9iYWJpbGl0eSBvZiBtZXNzYWdl IGRlYWRsb2NrLg0KPiBDb25zaWRlciBlYWNoIGRyaXZlciB0byBkZXRlcm1pbmUgd2hldGhlciB0 byB3YWl0IGZ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ICBpbnQgKCpnZXRfbm90aWZ5X3JlcGx5X2Zs YWcpKGludCB2aWQsIGJvb2wgKm5lZWRfcmVwbHkpOw0KIH07DQoNCiAvKioNCmRpZmYgLS1naXQg YS9saWIvdmhvc3Qvdmhvc3RfdXNlci5jIGIvbGliL3Zob3N0L3Zob3N0X3VzZXIuYw0KaW5kZXgg OTAxYTgwYmJhYS4uYWE2MTk5MjkzOSAxMDA2NDQNCi0tLSBhL2xpYi92aG9zdC92aG9zdF91c2Vy LmMNCisrKyBiL2xpYi92aG9zdC92aG9zdF91c2VyLmMNCkBAIC0zMzY1LDEzICszMzY1LDE0IEBA IHJ0ZV92aG9zdF9iYWNrZW5kX2NvbmZpZ19jaGFuZ2UoaW50IHZpZCwgYm9vbCBuZWVkX3JlcGx5 KQ0KIHN0YXRpYyBpbnQgdmhvc3RfdXNlcl9iYWNrZW5kX3NldF92cmluZ19ob3N0X25vdGlmaWVy KHN0cnVjdCB2aXJ0aW9fbmV0ICpkZXYsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleCwgaW50IGZkLA0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50NjRfdCBvZmZzZXQsDQot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDY0 X3Qgc2l6ZSkNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB1aW50NjRfdCBzaXplLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBib29sIG5lZWRfcmVwbHkpDQogew0KICAgICAgICAgaW50IHJl dDsNCiAgICAgICAgIHN0cnVjdCB2aHVfbXNnX2NvbnRleHQgY3R4ID0gew0KICAgICAgICAgICAg ICAgICAubXNnID0gew0KICAgICAgICAgICAgICAgICAgICAgICAgIC5yZXF1ZXN0LmJhY2tlbmQg PSBWSE9TVF9VU0VSX0JBQ0tFTkRfVlJJTkdfSE9TVF9OT1RJRklFUl9NU0csDQotICAgICAgICAg ICAgICAgICAgICAgICAuZmxhZ3MgPSBWSE9TVF9VU0VSX1ZFUlNJT04gfCBWSE9TVF9VU0VSX05F RURfUkVQTFksDQorICAgICAgICAgICAgICAgICAgICAgICAuZmxhZ3MgPSBWSE9TVF9VU0VSX1ZF UlNJT04sDQogICAgICAgICAgICAgICAgICAgICAgICAgLnNpemUgPSBzaXplb2YoY3R4Lm1zZy5w YXlsb2FkLmFyZWEpLA0KICAgICAgICAgICAgICAgICAgICAgICAgIC5wYXlsb2FkLmFyZWEgPSB7 DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudTY0ID0gaW5kZXggJiBWSE9TVF9V U0VSX1ZSSU5HX0lEWF9NQVNLLA0KQEAgLTMzODgsNyArMzM4OSwxMyBAQCBzdGF0aWMgaW50IHZo b3N0X3VzZXJfYmFja2VuZF9zZXRfdnJpbmdfaG9zdF9ub3RpZmllcihzdHJ1Y3QgdmlydGlvX25l dCAqZGV2LA0KICAgICAgICAgICAgICAgICBjdHguZmRfbnVtID0gMTsNCiAgICAgICAgIH0NCg0K LSAgICAgICByZXQgPSBzZW5kX3Zob3N0X2JhY2tlbmRfbWVzc2FnZV9wcm9jZXNzX3JlcGx5KGRl diwgJmN0eCk7DQorICAgICAgIGlmICghbmVlZF9yZXBseSkNCisgICAgICAgICAgICAgICByZXQg PSBzZW5kX3Zob3N0X2JhY2tlbmRfbWVzc2FnZShkZXYsICZjdHgpOw0KKyAgICAgICBlbHNlIHsN CisgICAgICAgICAgICAgICBjdHgubXNnLmZsYWdzIHw9IFZIT1NUX1VTRVJfTkVFRF9SRVBMWTsN CisgICAgICAgICAgICAgICByZXQgPSBzZW5kX3Zob3N0X2JhY2tlbmRfbWVzc2FnZV9wcm9jZXNz X3JlcGx5KGRldiwgJmN0eCk7DQorICAgICAgIH0NCisNCi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2xhc3Q7IGkrKykgew0KICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ZHBhX2Rldi0+ b3BzLT5nZXRfbm90aWZ5X2FyZWEodmlkLCBpLCAmb2Zmc2V0LA0KQEAgLTM0NDksNyArMzQ2Miw3 IEBAIGludCBydGVfdmhvc3RfaG9zdF9ub3RpZmllcl9jdHJsKGludCB2aWQsIHVpbnQxNl90IHFp ZCwgYm9vbCBlbmFibGUpDQogICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAg ICAgICAgICAgICAgICAgaWYgKHZob3N0X3VzZXJfYmFja2VuZF9zZXRfdnJpbmdfaG9zdF9ub3Rp ZmllcihkZXYsIGksDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmZp b19kZXZpY2VfZmQsIG9mZnNldCwgc2l6ZSkgPCAwKSB7DQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgdmZpb19kZXZpY2VfZmQsIG9mZnNldCwgc2l6ZSwgbmVlZF9yZXBs eSkgPCAwKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQgPSAtRUZBVUxU Ow0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBkaXNhYmxlOw0KICAgICAg ICAgICAgICAgICAgICAgICAgIH0NCkBAIC0zNDU4LDcgKzM0NzEsNyBAQCBpbnQgcnRlX3Zob3N0 X2hvc3Rfbm90aWZpZXJfY3RybChpbnQgdmlkLCB1aW50MTZfdCBxaWQsIGJvb2wgZW5hYmxlKQ0K IGRpc2FibGU6DQogICAgICAgICAgICAgICAgIGZvciAoaSA9IHFfc3RhcnQ7IGkgPD0gcV9sYXN0 OyBpKyspIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICB2aG9zdF91c2VyX2JhY2tlbmRfc2V0 X3ZyaW5nX2hvc3Rfbm90aWZpZXIoZGV2LCBpLCAtMSwNCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAwLCAwKTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAwLCAwLCBuZWVkX3JlcGx5KTsNCiAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAg fQ0KDQotLQ0KMi4xNy4xDQoNCg== --_000_PUZPR06MB47423251E6A4BBCA6B9FEDA39931APUZPR06MB4742apcp_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
> Since backend and frontend message are synchronous in the same thread,
> there will be a probability of message d= eadlock.
> Consider each driver to determine whethe= r to wait for response.
>
> Fixes: d90cf7d111ac ("vhost: suppor= t host notifier")
> Cc: maxime.coquelin@redhat.com
> Signed-off-by: Rma Ma <rma.ma@jaguarm= icro.com>
> ---
> v2 - fix format error in commit message<= /div>
> v3 - add --in-reply-to
> ---

Hi Maxime,

This patch helps to fix vhost-user message de= adlock, could you help review it?

Thanks.

Best wis= hes,

Rma


=B7=A2=BC=FE=C8=CB: Rma Ma<= br> =B7=A2=CB=CD=CA=B1=BC=E4: 2023=C4=EA7=D4=C24=C8=D5 10:52
=CA=D5=BC=FE=C8=CB: dpdk-dev <dev@dpdk.org>
=B3=AD=CB=CD: Maxime Coquelin <maxime.coquelin@redhat.com>; Ch= enbo Xia <chenbo.xia@intel.com>; Rma Ma <rma.ma@jaguarmicro.com>= ;
=D6=F7=CC=E2: [PATCH v3] vhost: add notify reply ops to fix message = deadlock
 
Since backend and frontend message are synchronous= in the same thread,
there will be a probability of message deadlock.
Consider each driver to determine whether to wait for response.

Fixes: d90cf7d111ac ("vhost: support host notifier")
Cc: maxime.coquelin@redhat.com
Signed-off-by: Rma Ma <rma.ma@jaguarmicro.com>
---
v2 - fix format error in commit message
v3 - add --in-reply-to
---
 lib/vhost/vdpa_driver.h |  3 +++
 lib/vhost/vhost_user.c  | 23 ++++++++++++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/lib/vhost/vdpa_driver.h b/lib/vhost/vdpa_driver.h
index 8db4ab9f4d..3d2ea3c90e 100644
--- a/lib/vhost/vdpa_driver.h
+++ b/lib/vhost/vdpa_driver.h
@@ -81,6 +81,9 @@ struct rte_vdpa_dev_ops {
 
         /** get device type: net d= evice, blk device... */
         int (*get_dev_type)(struct= rte_vdpa_device *dev, uint32_t *type);
+
+       /** Get the notify reply flag */
+       int (*get_notify_reply_flag)(int vid,= bool *need_reply);
 };
 
 /**
diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 901a80bbaa..aa61992939 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -3365,13 +3365,14 @@ rte_vhost_backend_config_change(int vid, bool need_= reply)
 static int vhost_user_backend_set_vring_host_notifier(struct virtio_n= et *dev,
            &nb= sp;            =             &nb= sp;            =    int index, int fd,
            &nb= sp;            =             &nb= sp;            =    uint64_t offset,
-            &n= bsp;            = ;            &n= bsp;            = ; uint64_t size)
+            &n= bsp;            = ;            &n= bsp;            = ; uint64_t size,
+            &n= bsp;            = ;            &n= bsp;            = ;     bool need_reply)
 {
         int ret;
         struct vhu_msg_context ctx= =3D {
            &nb= sp;    .msg =3D {
            &nb= sp;            .requ= est.backend =3D VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG,
-            &n= bsp;          .flags =3D VHOST= _USER_VERSION | VHOST_USER_NEED_REPLY,
+            &n= bsp;          .flags =3D VHOST= _USER_VERSION,
            &nb= sp;            .size= =3D sizeof(ctx.msg.payload.area),
            &nb= sp;            .payl= oad.area =3D {
            &nb= sp;            =         .u64 =3D index & VHOST_USER_= VRING_IDX_MASK,
@@ -3388,7 +3389,13 @@ static int vhost_user_backend_set_vring_host_notifie= r(struct virtio_net *dev,
            &nb= sp;    ctx.fd_num =3D 1;
         }
 
-       ret =3D send_vhost_backend_message_pr= ocess_reply(dev, &ctx);
+       if (!need_reply)
+            &n= bsp;  ret =3D send_vhost_backend_message(dev, &ctx);
+       else {
+            &n= bsp;  ctx.msg.flags |=3D VHOST_USER_NEED_REPLY;
+            &n= bsp;  ret =3D send_vhost_backend_message_process_reply(dev, &ctx);=
+       }
+
         if (ret < 0)
            &nb= sp;    VHOST_LOG_CONFIG(dev->ifname, ERR, "failed to= set host notifier (%d)\n", ret);
 
@@ -3402,6 +3409,7 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t qi= d, bool enable)
         int vfio_device_fd, ret = =3D 0;
         uint64_t offset, size;
         unsigned int i, q_start, q= _last;
+       bool need_reply;
 
         dev =3D get_device(vid);          if (!dev)
@@ -3440,6 +3448,11 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t q= id, bool enable)
         if (vfio_device_fd < 0)=
            &nb= sp;    return -ENOTSUP;
 
+       if (vdpa_dev->ops->get_notify_r= eply_flag =3D=3D NULL)
+            &n= bsp;  need_reply =3D true;
+       else
+            &n= bsp;  vdpa_dev->ops->get_notify_reply_flag(vid, &need_reply)= ;
+
         if (enable) {
            &nb= sp;    for (i =3D q_start; i <=3D q_last; i++) {
            &nb= sp;            if (v= dpa_dev->ops->get_notify_area(vid, i, &offset,
@@ -3449,7 +3462,7 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t qi= d, bool enable)
            &nb= sp;            }
 
            &nb= sp;            if (v= host_user_backend_set_vring_host_notifier(dev, i,
-            &n= bsp;            = ;            &n= bsp; vfio_device_fd, offset, size) < 0) {
+            &n= bsp;            = ;            &n= bsp; vfio_device_fd, offset, size, need_reply) < 0) {
            &nb= sp;            =         ret =3D -EFAULT;
            &nb= sp;            =         goto disable;
            &nb= sp;            }
@@ -3458,7 +3471,7 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t qi= d, bool enable)
 disable:
            &nb= sp;    for (i =3D q_start; i <=3D q_last; i++) {
            &nb= sp;            vhost= _user_backend_set_vring_host_notifier(dev, i, -1,
-            &n= bsp;            = ;            &n= bsp; 0, 0);
+            &n= bsp;            = ;            &n= bsp; 0, 0, need_reply);
            &nb= sp;    }
         }
 
--
2.17.1

--_000_PUZPR06MB47423251E6A4BBCA6B9FEDA39931APUZPR06MB4742apcp_--