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 C2546A00C4; Tue, 26 Apr 2022 11:17:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CF4740C35; Tue, 26 Apr 2022 11:17:11 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 43A4A40691 for ; Tue, 26 Apr 2022 11:17:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650964629; x=1682500629; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=38jVqHf4I+N8fY+B4MGy0WkxkbfGWXdiTIEprAHKQQ8=; b=i4ywl2ZSZreErpfC0acHOgG9Cr82EgwJIdBI6BV6kybmVqnjEH/NovDI nTLOcicriVAn1I0s9xp6MKQwTEIF+HrVDWxhT+RDmoMZTBfiUdaXkf+Il 5Xc9+NYgnzhWfbKejChUFEfC6ZMyhxCfiiem1apv5ht87LTFFftubjnbO bP0rzJA2eUK4vHtLJCt+p1rQ0IrOy/ltlCoqaB51svmbonewy9BGMPk2g cto7sSZYgoyYN2ah7hR4goVPChrX/mw5Gcuixb0wYXgRe/ci7AvhunYjH 5AMkhQ4hCJEyH/QmiXDjdX3Qp7wWSc1uNBYRPcg9OfPUAFrkYfg7hkgSa w==; X-IronPort-AV: E=McAfee;i="6400,9594,10328"; a="264356985" X-IronPort-AV: E=Sophos;i="5.90,290,1643702400"; d="scan'208";a="264356985" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 02:17:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,290,1643702400"; d="scan'208";a="579787059" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga008.jf.intel.com with ESMTP; 26 Apr 2022 02:17:06 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 26 Apr 2022 02:17:05 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 26 Apr 2022 02:17:05 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 26 Apr 2022 02:17:05 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.175) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 26 Apr 2022 02:17:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oQ8gTCuMmMx+ehFpbjn5/MW3yOh49PL3Tw4kczD3gIEqU8RMF76kInVxgzKNSiCxtPC2UZPWviGYVdtow/SIJ1fgxhPbCgFsJT6C7agwzfAKWJhlqppAEC4gBh53/hQMON99vDtWfnTYkxVh3mhporQl3Q6l0imZojuBXL2Ctx+d6+0dVbkKMKYt65nwnQlo69XVOy694VKIS+MLDnVGmYXXjzkCHoPrSq9prUUxeL2RGOy2jxQv8LcctcucwhPiCecNruuFV5WfPWUCidaeXLLBnLKbO/a1t8sMtaabRT3Eyh/EVQmzHNQXqqgtDlnIA/d3fGPbPQBCXqHTMsLU7A== 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=A12AGUhJMXVBaEUftEqzCdRusTEuVbzhMDh+JN7PwSY=; b=MUwwGOI5KFtLwf82DHtu2K/EkKtYEvCxkv+EW1gf2HSPLvL5r2hVs3h2iJMf9nWFaUzfizzzn3f5GzyEhKzgJoBeadIRRRdFyoZUlNlRKVwi3RydJgC4yrD4aPGro/XWlvXLDUl9JwzPDUDN6wTi3nSTar9mRRM+kq2QuYoO8RGK7v84SrX1SgwVKH4qMP/BFals8W57q+0Kb8/Bhi+tgLDZP09TE/AYwTZLN0cwS0L1bqPk+G40rzNAUhphkdfdI4qeatYfM6t9BTEb1Fihm93XRJ/WiJjmSReeToRezvoDNdOQtfFPOZcZZz8uBUzFFQwcK3SwYHESyLK+kvFijg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by BN9PR11MB5241.namprd11.prod.outlook.com (2603:10b6:408:132::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Tue, 26 Apr 2022 09:17:03 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::4d1d:6453:f00c:cf8a]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::4d1d:6453:f00c:cf8a%6]) with mapi id 15.20.5186.021; Tue, 26 Apr 2022 09:17:03 +0000 From: "Xia, Chenbo" To: "Pei, Andy" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Cao, Gang" , "Liu, Changpeng" Subject: RE: [PATCH v6 03/16] vhost: add vhost msg support Thread-Topic: [PATCH v6 03/16] vhost: add vhost msg support Thread-Index: AQHYVWDy88W0O072QUyKZnxo+HEb/q0Alh8AgAFV5ACAAAG/QA== Date: Tue, 26 Apr 2022 09:17:03 +0000 Message-ID: References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1650530034-59744-1-git-send-email-andy.pei@intel.com> <1650530034-59744-4-git-send-email-andy.pei@intel.com> <08f0027681ff4583bf46a835a5e8c9ef@intel.com> In-Reply-To: <08f0027681ff4583bf46a835a5e8c9ef@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 72b2e7ab-c6f9-4f87-577c-08da27658702 x-ms-traffictypediagnostic: BN9PR11MB5241:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: BKTumSf5swX4HqBVpieRtgv/Mv9HRgSc7MjhyPJG6OPUGkrF55qqKutX8y/EnO8xdI5Sl2/EANxvx11Bfk8LWbopu8u6Ua/r7+lrkMujpKxKElBeviGgxDaek2FUKMd5q0jmVqME+7zwWECPQU1MzG8h0NG0GffMQ3/km28IKxGqrOtqrJi7iJ7mtUhnjy3rncv8wJGaAhHtqHXCsdgzkFji+oefH5cgkjSV1m2RRCt1sJXmwcW/cnrxr4NS+dLib3+SXsrTsLKGuLGXL20pc04ayfFY9bfdEWj5THKGUjNLEZTIH9CSXJvtWIyvi4vyv2jyEvPZJoiK57DS6XyHsK79WO7HLrZgC/9+G5lhefWe2X2cJIbMoaVjpswsMqLJDYUUeR0tLoVrteqbgyXXM0wtWoENwx1RHSToOQiHr7B1LOzdiC+xZ7h1ZVh251PTmmk2GswvKGTASqRBG4QfEco3+xBKLlBrmynLAhf/d2jx/ZQ1xWc37UMGGTZZjz7pQyDOjt4clG3q8HOtT+7P6pd/g28kvb9S4RUBvulUawFUA231FaHxki+BwYB8GamRixtvFuXluZZkm/nF51VsW9X+I9K18VE729uknBq/0fhVHS1Cw7Y1W6+Q8Q3KYm9UvVzpR17+E4pdCkY2aJ9AUr+kfXxhvyVVj+NATheCd8f9Tu8eXu6XXCEifcM0obudII2y/0vkYuJ10ueTrjS5Yw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(66946007)(55016003)(508600001)(316002)(8936002)(33656002)(66476007)(64756008)(8676002)(110136005)(76116006)(53546011)(82960400001)(107886003)(54906003)(186003)(9686003)(66556008)(38100700002)(38070700005)(86362001)(4326008)(66446008)(71200400001)(5660300002)(122000001)(2906002)(83380400001)(52536014)(7696005)(26005)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?2S3L6mJi/XVtUlNNgo1wJgQhsyIiy4+G/lAdjb1OPKVs0DEf/JH0zCv0L19E?= =?us-ascii?Q?EOSb+5cBo3mC/z82aRhruospSccB3DWLMbTmyMtQXUx/m0/O/q7HkAnf0ybw?= =?us-ascii?Q?hroYaDvvb4UWYhPx2MCo8MgQ+Oi3dRU8cmY71No2mp5ryn3CoWrGxUY/9wAB?= =?us-ascii?Q?jGoeoHHr/qoLH2HyIb5JtP+T4cx3DFpG7BvHJeoReZhUWUXb12JelwhQoq+g?= =?us-ascii?Q?Ii3kWC5d0n0tCOxOOTRzIHRti2kwiqG67BtkZRmo+90JZxdo42dtQ8MWnXjm?= =?us-ascii?Q?1FfsZyo4qTVj/ojg8RWWAyBiVCBPgxF3Y+7qhP00zeUSm73I8GQeP6eKVvMD?= =?us-ascii?Q?QFRm/Fp/9DNgjwrkank30tIWGUTjnoE9c/Sv9SsBbTS0xE8OF/1hZxGFsXuL?= =?us-ascii?Q?Pm3XTBpHDrmhx9qWm2H+TJGzp/e1hDALfE4PprDYGOrXvPG+Cjb+N+C3kRvP?= =?us-ascii?Q?8X/qkOhITJLgp077Be0j9ztS9HUjynj4kXZ7wWiaL1HPXRlUBZxyaxZd2xm9?= =?us-ascii?Q?apYi4w7XIXEI6NDVzU117qwecal1G4ZsOPMqB5AuEjKFS83T1ZQC4spT3Ld1?= =?us-ascii?Q?vkRnphS1A3UgCmGmad8y9SyjU2CHnz1A771ZKQ++I8pwPbTWFplt50pBm1xe?= =?us-ascii?Q?SxEME8xDdJtQAXncH5p0u+eAFgSN8xh/JmA7KnCojB3gwS45HBSqLNgsEF6T?= =?us-ascii?Q?cD3ZhSjSAkzBVE+ZEYBejjWqBjPLhiwxbJycfdSXUKSdCZ7ibKc7JIuwld7K?= =?us-ascii?Q?J0MxlxfNcrLFs4dFB7iybbhPuNdz4npiKCKUkPCsCOuo7V5Zr17JnNVCTLln?= =?us-ascii?Q?wZYMFF1bhMCPNfdQtXKv+8BaPm1mfCnztLbJn2/yoDsswF8evb28o2iAuMX7?= =?us-ascii?Q?KcFbTUtbKWh74TPE01FjmVd/xYloGmjkcOt6tXlXm24oS2VgUhmGd/mQ+NXB?= =?us-ascii?Q?PnjBLbZNBoxaud6YKVAz9+NnI1292JmVcV2sCJL03uhqH41tFZQ2AbMuMdTG?= =?us-ascii?Q?EpkC3U9OLsnD3HdmEWLwy+jQiBgraTGcL7CD7qzfJbT9cvq5hIEYYZj0xd4d?= =?us-ascii?Q?J+LX85mgvkqcaZOGtVspW30us9Sfc5mYfxAC+NuvANLZbEGlq2VEkQCvdgX5?= =?us-ascii?Q?sxeu+hSy/zUjK/ghxm5gYMg+rBagKEItoDKQ/0PZjqU3Punsc7IE6jGjs8EM?= =?us-ascii?Q?J4qlAX4abPbXCCMBdDosrVTzgzuu8LMOi0M3poXNoU+gz3HOWX/kJjHhtMOb?= =?us-ascii?Q?sJmx6houq6xAq3qBurt4Acp7oRg7n53Yk1KpuDK8FrJetLx+WtyrAIiyNOjU?= =?us-ascii?Q?pFdRS3sgwR/1m96bfn3S0Jziu0JFulVJJs97o/vmvwzWM8Gh9PqaBOPWPZFk?= =?us-ascii?Q?kQ3m2Yej8PidUkaXNTfFHna72MXJeStZe3GGzFklhuo7EDDKi4zNaoCD1ejZ?= =?us-ascii?Q?H8+ntclYHCMs0W9lI6u5ReOiphogV0icDSedvGxaJDEvbN6h6K00sMu/tPXF?= =?us-ascii?Q?Ih/VomhRYgnB6rWdzzryGCUkVUoxvBbrUg79geWShnt/nkTNFatexY6mXriU?= =?us-ascii?Q?DZ15vbQYdkqbJCYATdnCAU4sq6Otr6giZkTKy+fEz1eYwzAJS18VxH97SoDP?= =?us-ascii?Q?BfTB/CH8exiATCs59aWAtWV/8chzTwKcsvRvINCvHbyqazYQoWv+oqcOTW9P?= =?us-ascii?Q?rQjIqsPPliQ00f7M4fHpCx8EO7Fl7O9TX8b0KFXPSxSK5UmwHkot4yMfQfdf?= =?us-ascii?Q?DYCbHDSrIw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72b2e7ab-c6f9-4f87-577c-08da27658702 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2022 09:17:03.6291 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dEN/MkRq0s1PbeiRBZlQhjQLqQHW2sclloj+Zv49gcF1uiXOrTjCXn+9UfFLp0lJy75ihyoZtQlf158hvglVgw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5241 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Pei, Andy > Sent: Tuesday, April 26, 2022 4:56 PM > To: Xia, Chenbo ; dev@dpdk.org > Cc: maxime.coquelin@redhat.com; Cao, Gang ; Liu, > Changpeng > Subject: RE: [PATCH v6 03/16] vhost: add vhost msg support >=20 > HI Chenbo, >=20 > Thanks for your reply. > My reply is inline. >=20 > > -----Original Message----- > > From: Xia, Chenbo > > Sent: Monday, April 25, 2022 8:42 PM > > To: Pei, Andy ; dev@dpdk.org > > Cc: maxime.coquelin@redhat.com; Cao, Gang ; Liu, > > Changpeng > > Subject: RE: [PATCH v6 03/16] vhost: add vhost msg support > > > > Hi Andy, > > > > > -----Original Message----- > > > From: Pei, Andy > > > Sent: Thursday, April 21, 2022 4:34 PM > > > To: dev@dpdk.org > > > Cc: Xia, Chenbo ; maxime.coquelin@redhat.com; > > > Cao, Gang ; Liu, Changpeng > > > > > > Subject: [PATCH v6 03/16] vhost: add vhost msg support > > > > > > Add support for VHOST_USER_GET_CONFIG and > > VHOST_USER_SET_CONFIG. > > > VHOST_USER_GET_CONFIG and VHOST_USER_SET_CONFIG message is only > > > supported by virtio blk VDPA device. > > > > > > Signed-off-by: Andy Pei > > > --- > > > lib/vhost/vhost_user.c | 69 > > > ++++++++++++++++++++++++++++++++++++++++++++++++++ > > > lib/vhost/vhost_user.h | 13 ++++++++++ > > > 2 files changed, 82 insertions(+) > > > > > > diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index > > > 1d39067..3780804 100644 > > > --- a/lib/vhost/vhost_user.c > > > +++ b/lib/vhost/vhost_user.c > > > @@ -80,6 +80,8 @@ > > > [VHOST_USER_NET_SET_MTU] =3D "VHOST_USER_NET_SET_MTU", > > > [VHOST_USER_SET_SLAVE_REQ_FD] =3D > > "VHOST_USER_SET_SLAVE_REQ_FD", > > > [VHOST_USER_IOTLB_MSG] =3D "VHOST_USER_IOTLB_MSG", > > > +[VHOST_USER_GET_CONFIG] =3D "VHOST_USER_GET_CONFIG", > > > +[VHOST_USER_SET_CONFIG] =3D "VHOST_USER_SET_CONFIG", > > > [VHOST_USER_CRYPTO_CREATE_SESS] =3D > > "VHOST_USER_CRYPTO_CREATE_SESS", > > > [VHOST_USER_CRYPTO_CLOSE_SESS] =3D > > "VHOST_USER_CRYPTO_CLOSE_SESS", > > > [VHOST_USER_POSTCOPY_ADVISE] =3D > > "VHOST_USER_POSTCOPY_ADVISE", @@ > > > -2542,6 +2544,71 @@ static int is_vring_iotlb(struct virtio_net *dev, > > > } > > > > > > static int > > > +vhost_user_get_config(struct virtio_net **pdev, > > > +struct vhu_msg_context *ctx, > > > +int main_fd __rte_unused) > > > +{ > > > +struct virtio_net *dev =3D *pdev; > > > +struct rte_vdpa_device *vdpa_dev =3D dev->vdpa_dev; > > > +int ret =3D 0; > > > + > > > +if (vdpa_dev->ops->get_config) { > > > +ret =3D vdpa_dev->ops->get_config(dev->vid, > > > + ctx->msg.payload.cfg.region, > > > + ctx->msg.payload.cfg.size); > > > +if (ret !=3D 0) { > > > +ctx->msg.size =3D 0; > > > +VHOST_LOG_CONFIG(ERR, > > > + "(%s) get_config() return error!\n", > > > + dev->ifname); > > > +} > > > +} else { > > > +VHOST_LOG_CONFIG(ERR, "(%s) get_config() not > > supportted!\n", > > > > Supported > > > I will send out a new version to fix this. > > > + dev->ifname); > > > +} > > > + > > > +return RTE_VHOST_MSG_RESULT_REPLY; > > > +} > > > + > > > +static int > > > +vhost_user_set_config(struct virtio_net **pdev, > > > +struct vhu_msg_context *ctx, > > > +int main_fd __rte_unused) > > > +{ > > > +struct virtio_net *dev =3D *pdev; > > > +struct rte_vdpa_device *vdpa_dev =3D dev->vdpa_dev; > > > +int ret =3D 0; > > > + > > > +if (ctx->msg.size !=3D sizeof(struct vhost_user_config)) { > > > > I think you should do sanity check on payload.cfg.size and make sure > it's > > smaller than VHOST_USER_MAX_CONFIG_SIZE > > > > and same check for offset > > > I think payload.cfg.size can be smaller than or equal to > VHOST_USER_MAX_CONFIG_SIZE. > payload.cfg.ofset can be smaller than or equal to > VHOST_USER_MAX_CONFIG_SIZE as well After double check: offset is the config space offset, so this should be ch= ecked in vdpa driver. Size check on vhost lib layer should be just <=3D MAX_you_d= efined Thanks, Chenbo >=20 > > > +VHOST_LOG_CONFIG(ERR, > > > +"(%s) invalid set config msg size: %"PRId32" !=3D %d\n", > > > +dev->ifname, ctx->msg.size, > > > > Based on you will change the log too, payload.cfg.size is uint32_t, so > PRId32 -> > > PRIu32 > > > > > +(int)sizeof(struct vhost_user_config)); > > > > So this can be %u > > > Sure. > > > +goto OUT; > > > +} > > > + > > > +if (vdpa_dev->ops->set_config) { > > > +ret =3D vdpa_dev->ops->set_config(dev->vid, > > > +ctx->msg.payload.cfg.region, > > > +ctx->msg.payload.cfg.offset, > > > +ctx->msg.payload.cfg.size, > > > +ctx->msg.payload.cfg.flags); > > > +if (ret) > > > +VHOST_LOG_CONFIG(ERR, > > > + "(%s) set_config() return error!\n", > > > + dev->ifname); > > > +} else { > > > +VHOST_LOG_CONFIG(ERR, "(%s) set_config() not > > supportted!\n", > > > > Supported > > > I will send out a new version to fix this. > > > + dev->ifname); > > > +} > > > + > > > +return RTE_VHOST_MSG_RESULT_OK; > > > + > > > +OUT: > > > > Lower case looks better > > > OK. I will send out a new version to fix this. > > > +return RTE_VHOST_MSG_RESULT_ERR; > > > +} > > > > Almost all handlers need check on expected fd num (this case is 0), so > the > > above new handlers should also do that. Please refer to validate_msg_fd= s > in > > other handlers. > > > > BTW, you can wait for review for other patches and send new versions > later. > > > I will send out new patch after vhost: validate fds attached to messages > from David Marchand is merged. > > Thanks, > > Chenbo > > > > > + > > > +static int > > > vhost_user_iotlb_msg(struct virtio_net **pdev, > > > struct vhu_msg_context *ctx, > > > int main_fd __rte_unused) > > > @@ -2782,6 +2849,8 @@ typedef int (*vhost_message_handler_t)(struct > > > virtio_net **pdev, > > > [VHOST_USER_NET_SET_MTU] =3D vhost_user_net_set_mtu, > > > [VHOST_USER_SET_SLAVE_REQ_FD] =3D vhost_user_set_req_fd, > > > [VHOST_USER_IOTLB_MSG] =3D vhost_user_iotlb_msg, > > > +[VHOST_USER_GET_CONFIG] =3D vhost_user_get_config, > > > +[VHOST_USER_SET_CONFIG] =3D vhost_user_set_config, > > > [VHOST_USER_POSTCOPY_ADVISE] =3D > > vhost_user_set_postcopy_advise, > > > [VHOST_USER_POSTCOPY_LISTEN] =3D vhost_user_set_postcopy_listen, > > > [VHOST_USER_POSTCOPY_END] =3D vhost_user_postcopy_end, diff -- > > git > > > a/lib/vhost/vhost_user.h b/lib/vhost/vhost_user.h index > > > c946cc2..97cfb2f 100644 > > > --- a/lib/vhost/vhost_user.h > > > +++ b/lib/vhost/vhost_user.h > > > @@ -50,6 +50,8 @@ > > > VHOST_USER_NET_SET_MTU =3D 20, > > > VHOST_USER_SET_SLAVE_REQ_FD =3D 21, > > > VHOST_USER_IOTLB_MSG =3D 22, > > > +VHOST_USER_GET_CONFIG =3D 24, > > > +VHOST_USER_SET_CONFIG =3D 25, > > > VHOST_USER_CRYPTO_CREATE_SESS =3D 26, > > > VHOST_USER_CRYPTO_CLOSE_SESS =3D 27, > > > VHOST_USER_POSTCOPY_ADVISE =3D 28, > > > @@ -125,6 +127,16 @@ > > > uint16_t queue_size; > > > } VhostUserInflight; > > > > > > +#define VHOST_USER_MAX_CONFIG_SIZE256 > > > + > > > +/** Get/set config msg payload */ > > > +struct vhost_user_config { > > > +uint32_t offset; > > > +uint32_t size; > > > +uint32_t flags; > > > +uint8_t region[VHOST_USER_MAX_CONFIG_SIZE]; > > > +}; > > > + > > > typedef struct VhostUserMsg { > > > union { > > > uint32_t master; /* a VhostUserRequest value */ @@ -148,6 > > +160,7 @@ > > > VhostUserCryptoSessionParam crypto_session; > > > VhostUserVringArea area; > > > VhostUserInflight inflight; > > > +struct vhost_user_config cfg; > > > } payload; > > > /* Nothing should be added after the payload */ } __rte_packed > > > VhostUserMsg; > > > -- > > > 1.8.3.1 > > >=20