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 2C7FE41E30; Thu, 9 Mar 2023 06:36:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1CFA242B7E; Thu, 9 Mar 2023 06:36:36 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 8977E42B7E for ; Thu, 9 Mar 2023 06:36:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678340192; x=1709876192; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=xa+FvYwFpYlyUdyV3wHI/aQEGIeQushZKcknyCRrgBc=; b=S44Fq5Yna0Jv6SL3jpFkT0pMBz1hUspRkDAmrDpAxUDREdYFyY20/403 uR7aDOzhmu+m2K3/cO30Ink8Xv4K0zEX67dvo6doN4wrK+XYdMTBeuQob Vrh0a1F7u7UPS1/GeJZkikxtebh0IA94jGvthHBJM5z4++e+Ac7+1MTvA 65/ngkgWbd4BUvwQWFjA01bB0aE3aZjLL+rQZQ2nhvTcygy/8aiYnSfSz 8AmttEgKOQACubWJshP0GjWCH01e5EHlTzNnb5vXyZ25yFc9a35rMMkwX x4m1PbmFqOOy9xHedrufsA0Wr1s/4PCZqU7/RC7OzH0Y0RW9S6fUjJrUv Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="316752635" X-IronPort-AV: E=Sophos;i="5.98,245,1673942400"; d="scan'208";a="316752635" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 21:36:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="677247419" X-IronPort-AV: E=Sophos;i="5.98,245,1673942400"; d="scan'208";a="677247419" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga002.jf.intel.com with ESMTP; 08 Mar 2023 21:36:29 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 8 Mar 2023 21:36:28 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 8 Mar 2023 21:36:28 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Wed, 8 Mar 2023 21:36:28 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Wed, 8 Mar 2023 21:36:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mDqZkkXpU9jjhb1prKdbO53VZVfIbGzByNchXOE+ZTPQrfWc488oryij7tLSxecUioOyKBl2FtYHEZdMkMHCME0hH3VnWvLNgxK1qgaptDgD3+MJoA+t6dVPcvWUgKAnzjJFmDSjsUNGp6ef24tn/YbxP077ZxP96wVV+TAaH2SlVKPjDutWxCJGtC82zb9Y4FElcxwa1Q2AjgWX836ppXm9ZmQHXkbnpD6s16lGZb93yRz3V+jpcYsimStJ41qFNa3hMm/AIqIlWt9nLq3RK3Mk4q0plP2mrk0Kra+jMs9OB89AGi3q7naDvADSpppojmIuGrdKxlAbAFa7ZVSTMg== 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=7jqCbtuwFAMOrCQgq1YFPBz4BTDv9Ocqu94DcVSzYZA=; b=nPxJwJ4u+Hm2N2xnrTK3bLrboNv5uNWd1bE+Favn+9TlgG/TDxAtOR7AYGSGhjA6Jih89H1dfXDDAeYxBakj3HqZNaUe3Gc4Zp7XSRoLwdS4vV12KPJGHBkBt5Tpx8Y+8NCETPr0LBbyL3000MwVmP0SLhYoXY1mQu/UaIbGdCb6jZgaabzbWh0LPtTl9ZDXAiXLwTRpXd2hZ+QpW+rLfj7fryxRJ0VibmhoLHh6vb55H+S3QopHkG4DIF9OK/vBbys/WoW2wiQ/tvV+XLiYAR4MlDgAQ3hiQZcZzIbhiMEUlj8DwdzSEbw/5PMpLmv4a27eYThl7H9FeymkeLvm5g== 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 DM4PR11MB8178.namprd11.prod.outlook.com (2603:10b6:8:18f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.22; Thu, 9 Mar 2023 05:36:26 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::930b:6671:e4f0:4ebc]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::930b:6671:e4f0:4ebc%3]) with mapi id 15.20.6156.029; Thu, 9 Mar 2023 05:36:26 +0000 From: "Xia, Chenbo" To: Nobuhiro MIKI , "maxime.coquelin@redhat.com" CC: "dev@dpdk.org" , "stephen@networkplumber.org" Subject: RE: [PATCH v2 2/2] vhost: refactor to follow new naming convention Thread-Topic: [PATCH v2 2/2] vhost: refactor to follow new naming convention Thread-Index: AQHZUkZvUYmIa1NXXkGgmxEuAqNYO67x7ZaQ Date: Thu, 9 Mar 2023 05:36:26 +0000 Message-ID: References: <20230309051643.70171-1-nmiki@yahoo-corp.jp> <20230309051643.70171-3-nmiki@yahoo-corp.jp> In-Reply-To: <20230309051643.70171-3-nmiki@yahoo-corp.jp> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR11MB3504:EE_|DM4PR11MB8178:EE_ x-ms-office365-filtering-correlation-id: f47b5771-9e9f-4ce9-c8db-08db206039f0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: H2h4YwwxzO8o5P6y83+b2a+ykoSq7q2xN83hmNO7wCDE4ryWufuBAp2SHRZ7GAAvDOAc64QstFW36t2wFZOT5z2LJt8nRuu7MDxjXfZEP7UqlFV/B+SXKoKyxlxC/UoWSv2D7Q3oFy+ZXYMyztJMFr6/Xe92r9tFM/LwZnfA7AP0ZlIEeaDyBdvEbc3LeGhy5y+7iuAhmHvEDjdptjzj/qu/PswBvg4obhAFex57x63TIzajanbs3F8Z+LTsvObK3GiXzll4XES1P8u4eKTEjy2jU6aBD+srOL/JRtiH+h7kHjeOg4EC5HCzBv/5FbpHFFGbdEw1FiOCorvsGOOgp59fZgGC72q/CxOuK1csSCpHOXrSG4WYFp5VFQOIfXqwLkzTZiYsnPgUCAjLegBSf1rWrMhZhwd/SS+HUYZ2kJESMeP+c7BnusJpsBDQeaAi8xDgD1jvyajODvr4Vt6fnxiaJPJUyYLllVqzHp3i4qbufUv9fGPODBuiFLwSRK9UPgATCiO9kssqA2kV/5h5kI+P2J21CYkx4yeuD+8lqzjsYNgXRDRE4sKStTVhwwnsXNjK9UG/Co+4LE7TKdJlA+b9oLhdp2mZ77PiWNbfCWdKAA0cUaXJ0meNDuPHVPgwnty5Gv0oCnAeB27J6iFboXbXVkkurAqftCEfGI7X0xWpAaCBRTPCVQ2COp2G/AqtIOjK3y0fbE8pojRdDTi7oA== 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:(13230025)(346002)(39860400002)(136003)(396003)(376002)(366004)(451199018)(33656002)(83380400001)(82960400001)(6506007)(53546011)(186003)(26005)(7696005)(71200400001)(9686003)(41300700001)(8936002)(2906002)(52536014)(64756008)(66446008)(66476007)(66556008)(66946007)(76116006)(8676002)(86362001)(4326008)(5660300002)(30864003)(38070700005)(122000001)(38100700002)(316002)(55016003)(478600001)(54906003)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?GSkL1VSXD5YUU2n/jd8p/3HULyGhtl96hxrRnrLHJc4lioLi7MfcyP00bgJ2?= =?us-ascii?Q?SWu1xtEVu5RT0QyYF7IV28c1BqobpU1vFB1ozAU/nEdgJOUaNK5U4zz+e9sU?= =?us-ascii?Q?FkbzVIZyriJqqp17XDau2Joy0LZdctX0Oaq+KOWEEZT953HF/dPEW7Vnx1Va?= =?us-ascii?Q?hMgZbaYmgsMFIj+t09ev0N194CiMy5Qfw7wBoP3kXD7VTif46657d5yyzdB5?= =?us-ascii?Q?Ic3Poe6H8/CE40Q2kJxp8AceJoSwW6f+hkEIck75a2pgE9JZmXyvhljnHJg5?= =?us-ascii?Q?zOypjdovVxe2NFNgrK4dJQYmug+HH+9tgUiDbZ9MDBAHVGe4dHTIS7r3PYQ+?= =?us-ascii?Q?HgggkkfA48+zxfmeV2H/iQbZJsUKP4PrXQElaqH4Fufl4IDmziP2+PnkiPZq?= =?us-ascii?Q?o7lDvugousr/Fix0KwVsFg40XLAjmKxchMv3D0JfGt5AxIPzZ/56vk1vrqzH?= =?us-ascii?Q?ac+ICeAPaCm7Kc8BtU3l84vKzfMvFVec+3Jh0Xf1ZuGDlcU0v2WdH4Ybnyo7?= =?us-ascii?Q?A1SFxsq1cheiDn9yNuLdAdtYRydYNSNbasi8UV3stk7xhvJ3xpzp4x0gPBic?= =?us-ascii?Q?0qg23sWr8lGjIHNTcLcgcSiKSrGuHTy1543S1q8FYP5y6lxNoX//1AhFDswf?= =?us-ascii?Q?yGgf9kPtgNMQRL0g0p64J7AEBG6rVICcex2C0kJlQaxcualEurUq5lZ6drLw?= =?us-ascii?Q?fNK0ffFmPkC7pIS4P8YmPHJ4EEHrh5ffjkxrv/1CbK/atsoJZCcn1W4KJIzd?= =?us-ascii?Q?PpVMTqGQJwKsGPEz1u1T3VJ+n3SaxEtjXw0Dl85c3Mgv2Iak45AXGUXWYpOf?= =?us-ascii?Q?lwRdzmCt7VJkY/uNTbS0FrP0r4brBZClZCY57+Er7LjkoqZuQ9rjWJK8T9Wx?= =?us-ascii?Q?ih5r3zMs1tLFL4bhe4sNf4FhKxDf5W5qlRqmwj1bRXyD9dkFeKGY2X21s+b/?= =?us-ascii?Q?xYaMlQ/Cl1USoW7l0tbySGApBtsg5V2QE3tMrrNYWzvCzjLMHNN6VBfUTNwX?= =?us-ascii?Q?RWcGxydf7Pi/Da6SqcjO/RgpbJqfv0ricbq+Ll6C1JAON8UW9pDzA+1Hxw/k?= =?us-ascii?Q?oaSNh11E2K1Q+Tu61HGF3T0R2pcxoqLgaWRtZp8M1w6A4asL0IMZvpf+Z5Dq?= =?us-ascii?Q?39zfTQbzsQAhinlBFWWEt9/HMJEr3aB7xbwapGYufZqBcmPlSGHoO/1B7LRS?= =?us-ascii?Q?5k+dHprzMNq2De882u4g/q5kcZ8XiB+ikDYobyc7yyBTq9ueSLMRCPKjdndq?= =?us-ascii?Q?n+owDN6hq2hl5LqKXu4MAg05SHIfSHnB3uAcfBSUM5HaMn/0jZ7Xa/+TOQ7o?= =?us-ascii?Q?nN/FRT7KHrDlXYjSGVsMw+/76TPCG3n07KEUWGdhz7KJnpeT8qkGe0Xp9HWy?= =?us-ascii?Q?lkEJWaUUis1UnaUjMTL7qK2Dr4QNQ0VP0UZsM/WBgmGl7ipjrmBEhoqYWqCm?= =?us-ascii?Q?q6d/LDsukFma3NdEzTSYeGekzPPg1dG2vWZOUGN92ZhR7SsB4UGp7ftUS7iU?= =?us-ascii?Q?M1+GyO5V7dTxdfXcbRfjiWF5Rr37PF8/uvOgQlEWoktKO6bR5zFVvrCgmPHs?= =?us-ascii?Q?G3l5Trbs4n2X7W1LeIHXHiNYSmzxJ0OC7Og9/qWS?= 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: f47b5771-9e9f-4ce9-c8db-08db206039f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Mar 2023 05:36:26.3462 (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: 1VowLH8nnXUBHXKoEVueMUhD1zWJU2neOcOmDZLxYdajgptQ6HIUStWM0d+VCaCzZbVI876eiucr1R9lnSzWhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB8178 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: Nobuhiro MIKI > Sent: Thursday, March 9, 2023 1:17 PM > To: maxime.coquelin@redhat.com; Xia, Chenbo > Cc: dev@dpdk.org; stephen@networkplumber.org; Nobuhiro MIKI corp.jp> > Subject: [PATCH v2 2/2] vhost: refactor to follow new naming convention >=20 > Simply replace 'master' with 'frontend' and 'slave' with 'backend'. >=20 > Signed-off-by: Nobuhiro MIKI > Acked-by: Stephen Hemminger > --- > drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- > lib/vhost/rte_vhost.h | 8 ++-- > lib/vhost/version.map | 2 +- > lib/vhost/vhost.c | 4 +- > lib/vhost/vhost.h | 4 +- > lib/vhost/vhost_crypto.c | 2 +- > lib/vhost/vhost_user.c | 82 +++++++++++++++++------------------ > lib/vhost/vhost_user.h | 8 ++-- > 8 files changed, 56 insertions(+), 56 deletions(-) >=20 > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.= c > index fe4d278c5380..e4133568c1aa 100644 > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > @@ -605,7 +605,7 @@ virtio_interrupt_handler(struct ifcvf_internal > *internal) > int vid =3D internal->vid; > int ret; >=20 > - ret =3D rte_vhost_slave_config_change(vid, 1); > + ret =3D rte_vhost_backend_config_change(vid, 1); > if (ret) > DRV_LOG(ERR, "failed to notify the guest about configuration > space change."); > } > diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h > index ed255fc6c51f..58a5d4be92f8 100644 > --- a/lib/vhost/rte_vhost.h > +++ b/lib/vhost/rte_vhost.h > @@ -264,9 +264,9 @@ typedef enum rte_vhost_msg_result > (*rte_vhost_msg_handle)(int vid, void *msg); > * Optional vhost user message handlers. > */ > struct rte_vhost_user_extern_ops { > - /* Called prior to the master message handling. */ > + /* Called prior to the frontend message handling. */ > rte_vhost_msg_handle pre_msg_handle; > - /* Called after the master message handling. */ > + /* Called after the frontend message handling. */ > rte_vhost_msg_handle post_msg_handle; > }; >=20 > @@ -1060,13 +1060,13 @@ rte_vhost_get_vdpa_device(int vid); > * @param vid > * vhost device ID > * @param need_reply > - * wait for the master response the status of this operation > + * wait for the frontend response the status of this operation > * @return > * 0 on success, < 0 on failure > */ > __rte_experimental > int > -rte_vhost_slave_config_change(int vid, bool need_reply); > +rte_vhost_backend_config_change(int vid, bool need_reply); >=20 > /** > * Retrieve names of statistics of a Vhost virtqueue. > diff --git a/lib/vhost/version.map b/lib/vhost/version.map > index d779a5cf3a0a..d322a4a888cd 100644 > --- a/lib/vhost/version.map > +++ b/lib/vhost/version.map > @@ -68,7 +68,7 @@ EXPERIMENTAL { > global: >=20 > rte_vhost_crypto_driver_start; > - rte_vhost_slave_config_change; > + rte_vhost_backend_config_change; > rte_vhost_async_channel_register; > rte_vhost_async_channel_unregister; > rte_vhost_submit_enqueue_burst; > diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c > index 358672bb176b..ef3794381751 100644 > --- a/lib/vhost/vhost.c > +++ b/lib/vhost/vhost.c > @@ -701,9 +701,9 @@ vhost_new_device(void) >=20 > dev->vid =3D i; > dev->flags =3D VIRTIO_DEV_BUILTIN_VIRTIO_NET; > - dev->slave_req_fd =3D -1; > + dev->backend_req_fd =3D -1; > dev->postcopy_ufd =3D -1; > - rte_spinlock_init(&dev->slave_req_lock); > + rte_spinlock_init(&dev->backend_req_lock); >=20 > return i; > } > diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h > index a31d810531d7..8fdab13c7097 100644 > --- a/lib/vhost/vhost.h > +++ b/lib/vhost/vhost.h > @@ -499,8 +499,8 @@ struct virtio_net { > uint32_t max_guest_pages; > struct guest_page *guest_pages; >=20 > - int slave_req_fd; > - rte_spinlock_t slave_req_lock; > + int backend_req_fd; > + rte_spinlock_t backend_req_lock; >=20 > int postcopy_ufd; > int postcopy_listening; > diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c > index f02bf865c349..9bf5ef67b9ad 100644 > --- a/lib/vhost/vhost_crypto.c > +++ b/lib/vhost/vhost_crypto.c > @@ -451,7 +451,7 @@ vhost_crypto_msg_post_handler(int vid, void *msg) > return RTE_VHOST_MSG_RESULT_ERR; > } >=20 > - switch (ctx->msg.request.master) { > + switch (ctx->msg.request.frontend) { > case VHOST_USER_CRYPTO_CREATE_SESS: > vhost_crypto_create_sess(vcrypto, > &ctx->msg.payload.crypto_session); > diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c > index cd4104ea5ce0..92ed4f02a68c 100644 > --- a/lib/vhost/vhost_user.c > +++ b/lib/vhost/vhost_user.c > @@ -7,11 +7,11 @@ > * The vhost-user protocol connection is an external interface, so it > must be > * robust against invalid inputs. > * > - * This is important because the vhost-user master is only one step > removed > + * This is important because the vhost-user frontend is only one step > removed > * from the guest. Malicious guests that have escaped will then launch > further > - * attacks from the vhost-user master. > + * attacks from the vhost-user frontend. > * > - * Even in deployments where guests are trusted, a bug in the vhost-user > master > + * Even in deployments where guests are trusted, a bug in the vhost-user > frontend > * can still cause invalid messages to be sent. Such messages must not > * compromise the stability of the DPDK application by causing crashes, > memory > * corruption, or other problematic behavior. > @@ -95,7 +95,7 @@ validate_msg_fds(struct virtio_net *dev, struct > vhu_msg_context *ctx, int expect >=20 > VHOST_LOG_CONFIG(dev->ifname, ERR, > "expect %d FDs for request %s, received %d\n", > - expected_fds, vhost_message_handlers[ctx- > >msg.request.master].description, > + expected_fds, vhost_message_handlers[ctx- > >msg.request.frontend].description, > ctx->fd_num); >=20 > close_msg_fds(ctx); > @@ -226,9 +226,9 @@ vhost_backend_cleanup(struct virtio_net *dev) > dev->inflight_info =3D NULL; > } >=20 > - if (dev->slave_req_fd >=3D 0) { > - close(dev->slave_req_fd); > - dev->slave_req_fd =3D -1; > + if (dev->backend_req_fd >=3D 0) { > + close(dev->backend_req_fd); > + dev->backend_req_fd =3D -1; > } >=20 > if (dev->postcopy_ufd >=3D 0) { > @@ -349,7 +349,7 @@ vhost_user_set_features(struct virtio_net **pdev, > return RTE_VHOST_MSG_RESULT_OK; >=20 > /* > - * Error out if master tries to change features while device > is > + * Error out if frontend tries to change features while device > is > * in running state. The exception being VHOST_F_LOG_ALL, > which > * is enabled when the live-migration starts. > */ > @@ -1192,10 +1192,10 @@ vhost_user_postcopy_register(struct virtio_net > *dev, int main_fd, > if (validate_msg_fds(dev, &ack_ctx, 0) !=3D 0) > return -1; >=20 > - if (ack_ctx.msg.request.master !=3D VHOST_USER_SET_MEM_TABLE) { > + if (ack_ctx.msg.request.frontend !=3D VHOST_USER_SET_MEM_TABLE) { > VHOST_LOG_CONFIG(dev->ifname, ERR, > "bad qemu ack on postcopy set-mem-table (%d)\n", > - ack_ctx.msg.request.master); > + ack_ctx.msg.request.frontend); > return -1; > } >=20 > @@ -2257,11 +2257,11 @@ vhost_user_set_protocol_features(struct virtio_ne= t > **pdev, > { > struct virtio_net *dev =3D *pdev; > uint64_t protocol_features =3D ctx->msg.payload.u64; > - uint64_t slave_protocol_features =3D 0; > + uint64_t backend_protocol_features =3D 0; >=20 > rte_vhost_driver_get_protocol_features(dev->ifname, > - &slave_protocol_features); > - if (protocol_features & ~slave_protocol_features) { > + &backend_protocol_features); > + if (protocol_features & ~backend_protocol_features) { > VHOST_LOG_CONFIG(dev->ifname, ERR, "received invalid protocol > features.\n"); > return RTE_VHOST_MSG_RESULT_ERR; > } > @@ -2458,14 +2458,14 @@ vhost_user_set_req_fd(struct virtio_net **pdev, >=20 > if (fd < 0) { > VHOST_LOG_CONFIG(dev->ifname, ERR, > - "invalid file descriptor for slave channel (%d)\n", fd); > + "invalid file descriptor for backend channel (%d)\n", > fd); > return RTE_VHOST_MSG_RESULT_ERR; > } >=20 > - if (dev->slave_req_fd >=3D 0) > - close(dev->slave_req_fd); > + if (dev->backend_req_fd >=3D 0) > + close(dev->backend_req_fd); >=20 > - dev->slave_req_fd =3D fd; > + dev->backend_req_fd =3D fd; >=20 > return RTE_VHOST_MSG_RESULT_OK; > } > @@ -2931,46 +2931,46 @@ send_vhost_reply(struct virtio_net *dev, int > sockfd, struct vhu_msg_context *ctx > } >=20 > static int > -send_vhost_slave_message(struct virtio_net *dev, struct vhu_msg_context > *ctx) > +send_vhost_backend_message(struct virtio_net *dev, struct vhu_msg_contex= t > *ctx) > { > - return send_vhost_message(dev, dev->slave_req_fd, ctx); > + return send_vhost_message(dev, dev->backend_req_fd, ctx); > } >=20 > static int > -send_vhost_slave_message_process_reply(struct virtio_net *dev, struct > vhu_msg_context *ctx) > +send_vhost_backend_message_process_reply(struct virtio_net *dev, struct > vhu_msg_context *ctx) > { > struct vhu_msg_context msg_reply; > int ret; >=20 > - rte_spinlock_lock(&dev->slave_req_lock); > - ret =3D send_vhost_slave_message(dev, ctx); > + rte_spinlock_lock(&dev->backend_req_lock); > + ret =3D send_vhost_backend_message(dev, ctx); > if (ret < 0) { > VHOST_LOG_CONFIG(dev->ifname, ERR, "failed to send config > change (%d)\n", ret); > goto out; > } >=20 > - ret =3D read_vhost_message(dev, dev->slave_req_fd, &msg_reply); > + ret =3D read_vhost_message(dev, dev->backend_req_fd, &msg_reply); > if (ret <=3D 0) { > if (ret < 0) > VHOST_LOG_CONFIG(dev->ifname, ERR, > - "vhost read slave message reply failed\n"); > + "vhost read backend message reply failed\n"); > else > VHOST_LOG_CONFIG(dev->ifname, INFO, "vhost peer > closed\n"); > ret =3D -1; > goto out; > } >=20 > - if (msg_reply.msg.request.slave !=3D ctx->msg.request.slave) { > + if (msg_reply.msg.request.backend !=3D ctx->msg.request.backend) { > VHOST_LOG_CONFIG(dev->ifname, ERR, > "received unexpected msg type (%u), expected %u\n", > - msg_reply.msg.request.slave, ctx->msg.request.slave); > + msg_reply.msg.request.backend, ctx->msg.request.backend); > ret =3D -1; > goto out; > } >=20 > ret =3D msg_reply.msg.payload.u64 ? -1 : 0; > out: > - rte_spinlock_unlock(&dev->slave_req_lock); > + rte_spinlock_unlock(&dev->backend_req_lock); > return ret; > } >=20 > @@ -2983,7 +2983,7 @@ vhost_user_check_and_alloc_queue_pair(struct > virtio_net *dev, > { > uint32_t vring_idx; >=20 > - switch (ctx->msg.request.master) { > + switch (ctx->msg.request.frontend) { > case VHOST_USER_SET_VRING_KICK: > case VHOST_USER_SET_VRING_CALL: > case VHOST_USER_SET_VRING_ERR: > @@ -3080,14 +3080,14 @@ vhost_user_msg_handler(int vid, int fd) > } > } >=20 > - ctx.msg.request.master =3D VHOST_USER_NONE; > + ctx.msg.request.frontend =3D VHOST_USER_NONE; > ret =3D read_vhost_message(dev, fd, &ctx); > if (ret =3D=3D 0) { > VHOST_LOG_CONFIG(dev->ifname, INFO, "vhost peer closed\n"); > return -1; > } >=20 > - request =3D ctx.msg.request.master; > + request =3D ctx.msg.request.frontend; > if (request > VHOST_USER_NONE && request < > RTE_DIM(vhost_message_handlers)) > msg_handler =3D &vhost_message_handlers[request]; > else > @@ -3307,7 +3307,7 @@ vhost_user_iotlb_miss(struct virtio_net *dev, > uint64_t iova, uint8_t perm) > int ret; > struct vhu_msg_context ctx =3D { > .msg =3D { > - .request.slave =3D VHOST_USER_BACKEND_IOTLB_MSG, > + .request.backend =3D VHOST_USER_BACKEND_IOTLB_MSG, > .flags =3D VHOST_USER_VERSION, > .size =3D sizeof(ctx.msg.payload.iotlb), > .payload.iotlb =3D { > @@ -3318,7 +3318,7 @@ vhost_user_iotlb_miss(struct virtio_net *dev, > uint64_t iova, uint8_t perm) > }, > }; >=20 > - ret =3D send_vhost_message(dev, dev->slave_req_fd, &ctx); > + ret =3D send_vhost_message(dev, dev->backend_req_fd, &ctx); > if (ret < 0) { > VHOST_LOG_CONFIG(dev->ifname, ERR, > "failed to send IOTLB miss message (%d)\n", > @@ -3330,11 +3330,11 @@ vhost_user_iotlb_miss(struct virtio_net *dev, > uint64_t iova, uint8_t perm) > } >=20 > int > -rte_vhost_slave_config_change(int vid, bool need_reply) > +rte_vhost_backend_config_change(int vid, bool need_reply) > { > struct vhu_msg_context ctx =3D { > .msg =3D { > - .request.slave =3D VHOST_USER_BACKEND_CONFIG_CHANGE_MSG, > + .request.backend =3D VHOST_USER_BACKEND_CONFIG_CHANGE_MSG, > .flags =3D VHOST_USER_VERSION, > .size =3D 0, > } > @@ -3347,10 +3347,10 @@ rte_vhost_slave_config_change(int vid, bool > need_reply) > return -ENODEV; >=20 > if (!need_reply) { > - ret =3D send_vhost_slave_message(dev, &ctx); > + ret =3D send_vhost_backend_message(dev, &ctx); > } else { > ctx.msg.flags |=3D VHOST_USER_NEED_REPLY; > - ret =3D send_vhost_slave_message_process_reply(dev, &ctx); > + ret =3D send_vhost_backend_message_process_reply(dev, &ctx); > } >=20 > if (ret < 0) > @@ -3358,7 +3358,7 @@ rte_vhost_slave_config_change(int vid, bool > need_reply) > return ret; > } >=20 > -static int vhost_user_slave_set_vring_host_notifier(struct virtio_net > *dev, > +static int vhost_user_backend_set_vring_host_notifier(struct virtio_net > *dev, > int index, int fd, > uint64_t offset, > uint64_t size) > @@ -3366,7 +3366,7 @@ static int > vhost_user_slave_set_vring_host_notifier(struct virtio_net *dev, > int ret; > struct vhu_msg_context ctx =3D { > .msg =3D { > - .request.slave =3D > VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG, > + .request.backend =3D > VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG, > .flags =3D VHOST_USER_VERSION | VHOST_USER_NEED_REPLY, > .size =3D sizeof(ctx.msg.payload.area), > .payload.area =3D { > @@ -3384,7 +3384,7 @@ static int > vhost_user_slave_set_vring_host_notifier(struct virtio_net *dev, > ctx.fd_num =3D 1; > } >=20 > - ret =3D send_vhost_slave_message_process_reply(dev, &ctx); > + ret =3D send_vhost_backend_message_process_reply(dev, &ctx); > if (ret < 0) > VHOST_LOG_CONFIG(dev->ifname, ERR, "failed to set host > notifier (%d)\n", ret); >=20 > @@ -3444,7 +3444,7 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t > qid, bool enable) > goto disable; > } >=20 > - if (vhost_user_slave_set_vring_host_notifier(dev, i, > + if (vhost_user_backend_set_vring_host_notifier(dev, i, > vfio_device_fd, offset, size) < 0) { > ret =3D -EFAULT; > goto disable; > @@ -3453,7 +3453,7 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t > qid, bool enable) > } else { > disable: > for (i =3D q_start; i <=3D q_last; i++) { > - vhost_user_slave_set_vring_host_notifier(dev, i, -1, > + vhost_user_backend_set_vring_host_notifier(dev, i, -1, > 0, 0); > } > } > diff --git a/lib/vhost/vhost_user.h b/lib/vhost/vhost_user.h > index 8e418414ba94..a0987a58f9e8 100644 > --- a/lib/vhost/vhost_user.h > +++ b/lib/vhost/vhost_user.h > @@ -62,12 +62,12 @@ typedef enum VhostUserRequest { > VHOST_USER_GET_STATUS =3D 40, > } VhostUserRequest; >=20 > -typedef enum VhostUserSlaveRequest { > +typedef enum VhostUserBackendRequest { > VHOST_USER_BACKEND_NONE =3D 0, > VHOST_USER_BACKEND_IOTLB_MSG =3D 1, > VHOST_USER_BACKEND_CONFIG_CHANGE_MSG =3D 2, > VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG =3D 3, > -} VhostUserSlaveRequest; > +} VhostUserBackendRequest; >=20 > typedef struct VhostUserMemoryRegion { > uint64_t guest_phys_addr; > @@ -136,8 +136,8 @@ struct vhost_user_config { >=20 > typedef struct VhostUserMsg { > union { > - uint32_t master; /* a VhostUserRequest value */ > - uint32_t slave; /* a VhostUserSlaveRequest value*/ > + uint32_t frontend; /* a VhostUserRequest value */ > + uint32_t backend; /* a VhostUserBackendRequest value*/ > } request; >=20 > #define VHOST_USER_VERSION_MASK 0x3 > -- > 2.31.1 Reviewed-by: Chenbo Xia =20