From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7E93AA0520; Thu, 2 Jul 2020 13:17:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 680981D983; Thu, 2 Jul 2020 13:17:40 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 819771D989 for ; Thu, 2 Jul 2020 13:17:38 +0200 (CEST) IronPort-SDR: 5Z9KIhCDIftHyLW2CxqAEE0lUQl+9VmSkA4d6T8ouwKqiQKM1WglPkqm0Akn1PK8d2G8nSI4dN wTwqGwhibjng== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="148416136" X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="148416136" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 04:17:32 -0700 IronPort-SDR: 2XDRstYupXC7iO3ia2pxTggDP4flR9PCRhL4f0+ROReyLMxwKEmSs/gXbJbPH9qEzn5vW/Gwnl Uo4b5PRty0cA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="304213351" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 04:17:32 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jul 2020 04:17:32 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 2 Jul 2020 04:17:31 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 2 Jul 2020 04:17:31 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.54) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jul 2020 04:17:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tms0j3q52M/dZD3mNEyG2TupsjxiuzzMLsDZZsTI8OAhdGooTUhGhD4Mt2AehPCX6PGNUbThS7pVqs1reE0FJXux+7k3/9TCnhXxY4mf73vG4qEnAtlF/6GEiqrdldxNZdaSN405dvJD/5xCZICRfOBydAl4dqFRcqlkqDr3iX/MtnND6q0fY++SBfVwP4q+yiMhBRBgQsWPO1A7iq51sfg6qhMi7VVZjy4z7SC6k0YikCipjhUCA3jXklVsXNQVLCDB/u7t7Gr945Pu5GL8RoKir6g7PuFvkMtst8jqDMsxXy+ZAERhwTqqRBgxaRef++ZdYFP24rmciVC1mzZx2A== 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-SenderADCheck; bh=9AaojLUdhBvT8D0/qExSGAS5GGWiuhS5ThxX+r4GE8E=; b=JZxjn3DIu1ukb2B4PBO2xi5+3VUH8TkVgNOpTWR7fWIeBI0RTvJjkuX9YmELdjomxO4iDGkKbV3Db1xDIBNbis8SOwTAcSRvm7jHfGd7IvpdM76Yf4zzhkWVSDcu+AUwqovSKZLHJXM2BzfGo5HUcd/jC3Z/gCo3XuaDIVUl//sReVZ7zplTOZlfCFaIKKxpJDQ7pNqXRzbY/R1dKrLpt1xDAIntBz9VrTwj4tcyvFvA8k+NcJ3/IRRWe1T9EuLg1gC3eJQr+E140No3O2Qc25AGR7Iovsrht1kr42WWhXDzAeV5yzqPBKylHiT3LDenM5AplDvXc8f+nAVFGCYrHg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9AaojLUdhBvT8D0/qExSGAS5GGWiuhS5ThxX+r4GE8E=; b=GufKwgGAIoFjE87uh6+HQjpMhsrwBux+qZxpkWY4CF9WIDrocCkDKx60r45xtqIYNRxh5H1j9NnNUy96jML79X9tq+0YeexLFRM9X8AKbo/aUe3Mlh7cuMfJTRXTfQVPy5y0XX+L4LlTDqQ0D0K+sMdvmebYaYxWaOeG2zQ4Lig= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB3677.namprd11.prod.outlook.com (2603:10b6:208:f6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.23; Thu, 2 Jul 2020 11:17:29 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::7cde:8326:5010:c47e]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::7cde:8326:5010:c47e%7]) with mapi id 15.20.3131.036; Thu, 2 Jul 2020 11:17:29 +0000 From: "Xia, Chenbo" To: Stephen Hemminger , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 27/27] vhost: rename SLAVE to CLIENT Thread-Index: AQHWT+ZM0g2B2n9WQE+M20i+OOciTKj0H0zQ Date: Thu, 2 Jul 2020 11:17:29 +0000 Message-ID: References: <20200604210200.25405-1-stephen@networkplumber.org> <20200701202359.17006-1-stephen@networkplumber.org> <20200701202359.17006-28-stephen@networkplumber.org> In-Reply-To: <20200701202359.17006-28-stephen@networkplumber.org> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2aa1ea86-89ee-4ae0-f2b9-08d81e79820a x-ms-traffictypediagnostic: MN2PR11MB3677: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0452022BE1 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +SEmZzpM+s9WxuBtfDD+f1PI0t0Id+ZPSobfnzY7rcM69EtuQ73mduDtOUQMAwowEVxs4C8fvb0Xjr+7NNjoyD31HBl897ZiZDns9P34Mn5lqeKhn+EIQUpEvLnLvq3T4ZrWRxLdEBS81gruy1dpEsBTWfi6r1gbWssJ8V8zTE7yMswpxEFCLMbQhwsbxUuxOwh9NpncrMYRvM9IISlxrLRggqd2YlmBUa6tnvomOb1clpGPLajs1ZxuKeVjLurf+PTBfyXz2l0GOC4XXGnw+qUJCslSV6q0FrSUlc6yQi4RG09NP2rPuiDBs4jNGQPhcAShYXwjwjyO+SPM4r4+IQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(366004)(136003)(346002)(376002)(396003)(76116006)(52536014)(66556008)(64756008)(5660300002)(66476007)(66446008)(110136005)(6506007)(30864003)(53546011)(8936002)(66946007)(33656002)(71200400001)(2906002)(8676002)(55016002)(26005)(86362001)(7696005)(186003)(83380400001)(478600001)(9686003)(316002)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: 7raAq36SaVakb+VHdd8j5fFZ26WWilkJjyWn4V+QlmfbHtaRxSAI6SSbxavCaLokExjCXEKE85MCnyurgGowdSoztAeL5wrtzph23t0ppusHqdKvbqLtPl7jqOa/563nezdhos6RHV5ZrM8rSFFjhUZ65GqFj7431fVSOI6XlLkp0cCCLBlWgorUEEZeyhCTq+eafVte1/JMTLyef+850U5pdzHZql2lfaKH3GDPbX6DwpIIqChsAqUPWPSxKd5YRJ4s7rZgvb6chzlYIJTinPhTuNTd+RdjkkoSyDf2q6fZQ6yEQhN66zT96k8a9y7Bs18mA3KAJiGNin28LMpVcL2JsQoMh9o/Xbrk+Q8jZSNp1itQmWbiz42hy+o1JEQ4F5uQK+yp6NjCZJ8wfPx+XSv8qtUSpIT0OIu4qN8hwQzntgS6zf+wC0xtOClWXy9wuCd83Q0sUasCBUjbI/4UhmznqD69C/dZmvfpcQY09k3siZvyi7NgBso8qjWqPz1U x-ms-exchange-transport-forked: True 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: MN2PR11MB4063.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2aa1ea86-89ee-4ae0-f2b9-08d81e79820a X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2020 11:17:29.2877 (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: dIODW+/EL8dwFDJWAud48SsT0kaDXmPCrTpfQ8vUQdGCh/8ClzeZDA8DEH1BYL98l3kTPjbKh8LL/yWjKG+FMg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4 27/27] vhost: rename SLAVE to CLIENT X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Stephen, Thanks for working on this! The slave/master naming of vhost is defined by vhost-user spec, which is maintained by QEMU. I think if we want to=20 change it. The spec in QEMU should first be changed, then as an implementat= ion of the spec, we could easily change it. Also, using server/client to be the new version may cause some code confusion in vhost. Because vhost traditionally can act as a socket server or client (you can see the names i= n the code) and the vhost-user slave/master generally refers to vhost-user pmd/QEMU. So it may make the code hard to understand. Do you think this make sense? Thanks! Chenbo > -----Original Message----- > From: dev On Behalf Of Stephen Hemminger > Sent: Thursday, July 2, 2020 4:24 AM > To: dev@dpdk.org > Cc: Stephen Hemminger > Subject: [dpdk-dev] [PATCH v4 27/27] vhost: rename SLAVE to CLIENT >=20 > The vhost is a client server architecture so replace the > term slave with client. >=20 > Signed-off-by: Stephen Hemminger > --- > drivers/vdpa/ifc/ifcvf_vdpa.c | 4 +- > drivers/vdpa/mlx5/mlx5_vdpa.c | 4 +- > lib/librte_vhost/rte_vhost.h | 16 ++--- > lib/librte_vhost/rte_vhost_version.map | 2 +- > lib/librte_vhost/vhost.c | 4 +- > lib/librte_vhost/vhost.h | 4 +- > lib/librte_vhost/vhost_crypto.c | 2 +- > lib/librte_vhost/vhost_user.c | 96 +++++++++++++------------- > lib/librte_vhost/vhost_user.h | 41 +++++------ > 9 files changed, 87 insertions(+), 86 deletions(-) >=20 > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.= c > index de54dc8aab6c..6c02b99f5e44 100644 > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > @@ -1071,8 +1071,8 @@ ifcvf_get_vdpa_features(struct rte_vdpa_device > *vdev, uint64_t *features) >=20 > #define VDPA_SUPPORTED_PROTOCOL_FEATURES \ > (1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK | \ > - 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ | \ > - 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD | \ > + 1ULL << VHOST_USER_PROTOCOL_F_CLIENT_REQ | \ > + 1ULL << VHOST_USER_PROTOCOL_F_CLIENT_SEND_FD | \ > 1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER | \ > 1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) > static int > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.= c > index dbd36ab0c95e..8fd2de9ba98f 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa.c > +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c > @@ -34,8 +34,8 @@ > (1ULL << VIRTIO_NET_F_MTU)) >=20 > #define MLX5_VDPA_PROTOCOL_FEATURES \ > - ((1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ) | > \ > - (1ULL << > VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \ > + ((1ULL << VHOST_USER_PROTOCOL_F_CLIENT_REQ) > | \ > + (1ULL << > VHOST_USER_PROTOCOL_F_CLIENT_SEND_FD) | \ > (1ULL << > VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \ > (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) > | \ > (1ULL << VHOST_USER_PROTOCOL_F_MQ) | \ > diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h > index 8a5c332c83ac..b952e6d47021 100644 > --- a/lib/librte_vhost/rte_vhost.h > +++ b/lib/librte_vhost/rte_vhost.h > @@ -74,8 +74,8 @@ extern "C" { > #define VHOST_USER_PROTOCOL_F_NET_MTU 4 > #endif >=20 > -#ifndef VHOST_USER_PROTOCOL_F_SLAVE_REQ > -#define VHOST_USER_PROTOCOL_F_SLAVE_REQ 5 > +#ifndef VHOST_USER_PROTOCOL_F_CLIENT_REQ > +#define VHOST_USER_PROTOCOL_F_CLIENT_REQ 5 > #endif >=20 > #ifndef VHOST_USER_PROTOCOL_F_CRYPTO_SESSION > @@ -90,8 +90,8 @@ extern "C" { > #define VHOST_USER_PROTOCOL_F_CONFIG 9 > #endif >=20 > -#ifndef VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD > -#define VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD 10 > +#ifndef VHOST_USER_PROTOCOL_F_CLIENT_SEND_FD > +#define VHOST_USER_PROTOCOL_F_CLIENT_SEND_FD 10 > #endif >=20 > #ifndef VHOST_USER_PROTOCOL_F_HOST_NOTIFIER > @@ -249,9 +249,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 server message handling. */ > rte_vhost_msg_handle pre_msg_handle; > - /* Called after the master message handling. */ > + /* Called after the server message handling. */ > rte_vhost_msg_handle post_msg_handle; > }; >=20 > @@ -1008,13 +1008,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 server 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_client_config_change(int vid, bool need_reply); >=20 > #ifdef __cplusplus > } > diff --git a/lib/librte_vhost/rte_vhost_version.map > b/lib/librte_vhost/rte_vhost_version.map > index 86784405a1e8..74973ce9b8ec 100644 > --- a/lib/librte_vhost/rte_vhost_version.map > +++ b/lib/librte_vhost/rte_vhost_version.map > @@ -65,7 +65,7 @@ EXPERIMENTAL { > rte_vhost_clr_inflight_desc_packed; > rte_vhost_get_vhost_ring_inflight; > rte_vhost_get_vring_base_from_inflight; > - rte_vhost_slave_config_change; > + rte_vhost_client_config_change; > rte_vdpa_find_device_by_name; > rte_vdpa_get_rte_device; > rte_vdpa_get_queue_num; > diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c > index 0d822d6a3f48..3d111d714bf1 100644 > --- a/lib/librte_vhost/vhost.c > +++ b/lib/librte_vhost/vhost.c > @@ -632,9 +632,9 @@ vhost_new_device(void) > vhost_devices[i] =3D dev; > dev->vid =3D i; > dev->flags =3D VIRTIO_DEV_BUILTIN_VIRTIO_NET; > - dev->slave_req_fd =3D -1; > + dev->client_req_fd =3D -1; > dev->postcopy_ufd =3D -1; > - rte_spinlock_init(&dev->slave_req_lock); > + rte_spinlock_init(&dev->client_req_lock); >=20 > return i; > } > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h > index 0344636997a6..a0902d1535c4 100644 > --- a/lib/librte_vhost/vhost.h > +++ b/lib/librte_vhost/vhost.h > @@ -356,8 +356,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 client_req_fd; > + rte_spinlock_t client_req_lock; >=20 > int postcopy_ufd; > int postcopy_listening; > diff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_cry= pto.c > index 0f9df4059d0b..8e4fc1bf015a 100644 > --- a/lib/librte_vhost/vhost_crypto.c > +++ b/lib/librte_vhost/vhost_crypto.c > @@ -460,7 +460,7 @@ vhost_crypto_msg_post_handler(int vid, void *msg) > return RTE_VHOST_MSG_RESULT_ERR; > } >=20 > - switch (vmsg->request.master) { > + switch (vmsg->request.server) { > case VHOST_USER_CRYPTO_CREATE_SESS: > vhost_crypto_create_sess(vcrypto, > &vmsg->payload.crypto_session); > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.= c > index 6039a8fdb9cb..56da81cd1e17 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -7,11 +7,11 @@ > * The vhost-user protocol connection is an external interface, so it mu= st be > * robust against invalid inputs. > * > - * This is important because the vhost-user master is only one step remo= ved > + * This is important because the vhost-user server is only one step remo= ved > * from the guest. Malicious guests that have escaped will then launch = further > - * attacks from the vhost-user master. > + * attacks from the vhost-user server. > * > - * 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= server > * 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. > @@ -78,7 +78,7 @@ static const char *vhost_message_str[VHOST_USER_MAX] > =3D { > [VHOST_USER_SET_VRING_ENABLE] =3D > "VHOST_USER_SET_VRING_ENABLE", > [VHOST_USER_SEND_RARP] =3D "VHOST_USER_SEND_RARP", > [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_SET_CLIENT_REQ_FD] =3D > "VHOST_USER_SET_CLIENT_REQ_FD", > [VHOST_USER_IOTLB_MSG] =3D "VHOST_USER_IOTLB_MSG", > [VHOST_USER_CRYPTO_CREATE_SESS] =3D > "VHOST_USER_CRYPTO_CREATE_SESS", > [VHOST_USER_CRYPTO_CLOSE_SESS] =3D > "VHOST_USER_CRYPTO_CLOSE_SESS", > @@ -114,7 +114,7 @@ validate_msg_fds(struct VhostUserMsg *msg, int > expected_fds) > VHOST_LOG_CONFIG(ERR, > " Expect %d FDs for request %s, received %d\n", > expected_fds, > - vhost_message_str[msg->request.master], > + vhost_message_str[msg->request.server], > msg->fd_num); >=20 > close_msg_fds(msg); > @@ -215,9 +215,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->client_req_fd >=3D 0) { > + close(dev->client_req_fd); > + dev->client_req_fd =3D -1; > } >=20 > if (dev->postcopy_ufd >=3D 0) { > @@ -346,7 +346,7 @@ vhost_user_set_features(struct virtio_net **pdev, str= uct > VhostUserMsg *msg, > return RTE_VHOST_MSG_RESULT_OK; >=20 > /* > - * Error out if master tries to change features while device is > + * Error out if server 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. > */ > @@ -1235,10 +1235,10 @@ vhost_user_set_mem_table(struct virtio_net > **pdev, struct VhostUserMsg *msg, > if (validate_msg_fds(&ack_msg, 0) !=3D 0) > goto err_mmap; >=20 > - if (ack_msg.request.master !=3D VHOST_USER_SET_MEM_TABLE) > { > + if (ack_msg.request.server !=3D VHOST_USER_SET_MEM_TABLE) { > VHOST_LOG_CONFIG(ERR, > "Bad qemu ack on postcopy set-mem-table > (%d)\n", > - ack_msg.request.master); > + ack_msg.request.server); > goto err_mmap; > } >=20 > @@ -2049,14 +2049,14 @@ vhost_user_set_protocol_features(struct virtio_ne= t > **pdev, > { > struct virtio_net *dev =3D *pdev; > uint64_t protocol_features =3D msg->payload.u64; > - uint64_t slave_protocol_features =3D 0; > + uint64_t client_protocol_features =3D 0; >=20 > if (validate_msg_fds(msg, 0) !=3D 0) > return RTE_VHOST_MSG_RESULT_ERR; >=20 > rte_vhost_driver_get_protocol_features(dev->ifname, > - &slave_protocol_features); > - if (protocol_features & ~slave_protocol_features) { > + &client_protocol_features); > + if (protocol_features & ~client_protocol_features) { > VHOST_LOG_CONFIG(ERR, > "(%d) received invalid protocol features.\n", > dev->vid); > @@ -2228,15 +2228,15 @@ vhost_user_set_req_fd(struct virtio_net **pdev, > struct VhostUserMsg *msg, >=20 > if (fd < 0) { > VHOST_LOG_CONFIG(ERR, > - "Invalid file descriptor for slave channel (%d)\n", > + "Invalid file descriptor for client 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->client_req_fd >=3D 0) > + close(dev->client_req_fd); >=20 > - dev->slave_req_fd =3D fd; > + dev->client_req_fd =3D fd; >=20 > return RTE_VHOST_MSG_RESULT_OK; > } > @@ -2472,7 +2472,7 @@ static vhost_message_handler_t > vhost_message_handlers[VHOST_USER_MAX] =3D { > [VHOST_USER_SET_VRING_ENABLE] =3D vhost_user_set_vring_enable, > [VHOST_USER_SEND_RARP] =3D vhost_user_send_rarp, > [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_SET_CLIENT_REQ_FD] =3D vhost_user_set_req_fd, > [VHOST_USER_IOTLB_MSG] =3D vhost_user_iotlb_msg, > [VHOST_USER_POSTCOPY_ADVISE] =3D vhost_user_set_postcopy_advise, > [VHOST_USER_POSTCOPY_LISTEN] =3D vhost_user_set_postcopy_listen, > @@ -2541,16 +2541,16 @@ send_vhost_reply(int sockfd, struct VhostUserMsg > *msg) > } >=20 > static int > -send_vhost_slave_message(struct virtio_net *dev, struct VhostUserMsg *ms= g) > +send_vhost_client_message(struct virtio_net *dev, struct VhostUserMsg *m= sg) > { > int ret; >=20 > if (msg->flags & VHOST_USER_NEED_REPLY) > - rte_spinlock_lock(&dev->slave_req_lock); > + rte_spinlock_lock(&dev->client_req_lock); >=20 > - ret =3D send_vhost_message(dev->slave_req_fd, msg); > + ret =3D send_vhost_message(dev->client_req_fd, msg); > if (ret < 0 && (msg->flags & VHOST_USER_NEED_REPLY)) > - rte_spinlock_unlock(&dev->slave_req_lock); > + rte_spinlock_unlock(&dev->client_req_lock); >=20 > return ret; > } > @@ -2564,7 +2564,7 @@ vhost_user_check_and_alloc_queue_pair(struct > virtio_net *dev, > { > uint32_t vring_idx; >=20 > - switch (msg->request.master) { > + switch (msg->request.server) { > case VHOST_USER_SET_VRING_KICK: > case VHOST_USER_SET_VRING_CALL: > case VHOST_USER_SET_VRING_ERR: > @@ -2667,7 +2667,7 @@ vhost_user_msg_handler(int vid, int fd) > } >=20 > ret =3D 0; > - request =3D msg.request.master; > + request =3D msg.request.server; > if (request > VHOST_USER_NONE && request < VHOST_USER_MAX && > vhost_message_str[request]) { > if (request !=3D VHOST_USER_IOTLB_MSG) > @@ -2710,7 +2710,7 @@ vhost_user_msg_handler(int vid, int fd) > case VHOST_USER_SET_VRING_ENABLE: > case VHOST_USER_SEND_RARP: > case VHOST_USER_NET_SET_MTU: > - case VHOST_USER_SET_SLAVE_REQ_FD: > + case VHOST_USER_SET_CLIENT_REQ_FD: > if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) { > vhost_user_lock_all_queue_pairs(dev); > unlock_required =3D 1; > @@ -2850,7 +2850,7 @@ vhost_user_msg_handler(int vid, int fd) > return 0; > } >=20 > -static int process_slave_message_reply(struct virtio_net *dev, > +static int process_client_message_reply(struct virtio_net *dev, > const struct VhostUserMsg *msg) > { > struct VhostUserMsg msg_reply; > @@ -2859,11 +2859,11 @@ static int process_slave_message_reply(struct > virtio_net *dev, > if ((msg->flags & VHOST_USER_NEED_REPLY) =3D=3D 0) > return 0; >=20 > - ret =3D read_vhost_message(dev->slave_req_fd, &msg_reply); > + ret =3D read_vhost_message(dev->client_req_fd, &msg_reply); > if (ret <=3D 0) { > if (ret < 0) > VHOST_LOG_CONFIG(ERR, > - "vhost read slave message reply failed\n"); > + "vhost read client message reply failed\n"); > else > VHOST_LOG_CONFIG(INFO, > "vhost peer closed\n"); > @@ -2872,10 +2872,10 @@ static int process_slave_message_reply(struct > virtio_net *dev, > } >=20 > ret =3D 0; > - if (msg_reply.request.slave !=3D msg->request.slave) { > + if (msg_reply.request.client !=3D msg->request.client) { > VHOST_LOG_CONFIG(ERR, > "Received unexpected msg type (%u), expected %u\n", > - msg_reply.request.slave, msg->request.slave); > + msg_reply.request.client, msg->request.client); > ret =3D -1; > goto out; > } > @@ -2883,7 +2883,7 @@ static int process_slave_message_reply(struct > virtio_net *dev, > ret =3D msg_reply.payload.u64 ? -1 : 0; >=20 > out: > - rte_spinlock_unlock(&dev->slave_req_lock); > + rte_spinlock_unlock(&dev->client_req_lock); > return ret; > } >=20 > @@ -2892,7 +2892,7 @@ vhost_user_iotlb_miss(struct virtio_net *dev, > uint64_t iova, uint8_t perm) > { > int ret; > struct VhostUserMsg msg =3D { > - .request.slave =3D VHOST_USER_SLAVE_IOTLB_MSG, > + .request.client =3D VHOST_USER_CLIENT_IOTLB_MSG, > .flags =3D VHOST_USER_VERSION, > .size =3D sizeof(msg.payload.iotlb), > .payload.iotlb =3D { > @@ -2902,7 +2902,7 @@ vhost_user_iotlb_miss(struct virtio_net *dev, > uint64_t iova, uint8_t perm) > }, > }; >=20 > - ret =3D send_vhost_message(dev->slave_req_fd, &msg); > + ret =3D send_vhost_message(dev->client_req_fd, &msg); > if (ret < 0) { > VHOST_LOG_CONFIG(ERR, > "Failed to send IOTLB miss message (%d)\n", > @@ -2914,11 +2914,11 @@ vhost_user_iotlb_miss(struct virtio_net *dev, > uint64_t iova, uint8_t perm) > } >=20 > static int > -vhost_user_slave_config_change(struct virtio_net *dev, bool need_reply) > +vhost_user_client_config_change(struct virtio_net *dev, bool need_reply) > { > int ret; > struct VhostUserMsg msg =3D { > - .request.slave =3D VHOST_USER_SLAVE_CONFIG_CHANGE_MSG, > + .request.client =3D VHOST_USER_CLIENT_CONFIG_CHANGE_MSG, > .flags =3D VHOST_USER_VERSION, > .size =3D 0, > }; > @@ -2926,7 +2926,7 @@ vhost_user_slave_config_change(struct virtio_net > *dev, bool need_reply) > if (need_reply) > msg.flags |=3D VHOST_USER_NEED_REPLY; >=20 > - ret =3D send_vhost_slave_message(dev, &msg); > + ret =3D send_vhost_client_message(dev, &msg); > if (ret < 0) { > VHOST_LOG_CONFIG(ERR, > "Failed to send config change (%d)\n", > @@ -2934,11 +2934,11 @@ vhost_user_slave_config_change(struct virtio_net > *dev, bool need_reply) > return ret; > } >=20 > - return process_slave_message_reply(dev, &msg); > + return process_client_message_reply(dev, &msg); > } >=20 > int > -rte_vhost_slave_config_change(int vid, bool need_reply) > +rte_vhost_client_config_change(int vid, bool need_reply) > { > struct virtio_net *dev; >=20 > @@ -2946,17 +2946,17 @@ rte_vhost_slave_config_change(int vid, bool > need_reply) > if (!dev) > return -ENODEV; >=20 > - return vhost_user_slave_config_change(dev, need_reply); > + return vhost_user_client_config_change(dev, need_reply); > } >=20 > -static int vhost_user_slave_set_vring_host_notifier(struct virtio_net *d= ev, > +static int vhost_user_client_set_vring_host_notifier(struct virtio_net *= dev, > int index, int fd, > uint64_t offset, > uint64_t size) > { > int ret; > struct VhostUserMsg msg =3D { > - .request.slave =3D > VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG, > + .request.client =3D > VHOST_USER_CLIENT_VRING_HOST_NOTIFIER_MSG, > .flags =3D VHOST_USER_VERSION | VHOST_USER_NEED_REPLY, > .size =3D sizeof(msg.payload.area), > .payload.area =3D { > @@ -2973,14 +2973,14 @@ static int > vhost_user_slave_set_vring_host_notifier(struct virtio_net *dev, > msg.fd_num =3D 1; > } >=20 > - ret =3D send_vhost_slave_message(dev, &msg); > + ret =3D send_vhost_client_message(dev, &msg); > if (ret < 0) { > VHOST_LOG_CONFIG(ERR, > "Failed to set host notifier (%d)\n", ret); > return ret; > } >=20 > - return process_slave_message_reply(dev, &msg); > + return process_client_message_reply(dev, &msg); > } >=20 > int rte_vhost_host_notifier_ctrl(int vid, uint16_t qid, bool enable) > @@ -3002,9 +3002,9 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t = qid, > bool enable) > if (!(dev->features & (1ULL << VIRTIO_F_VERSION_1)) || > !(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)) > || > !(dev->protocol_features & > - (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ)) || > + (1ULL << VHOST_USER_PROTOCOL_F_CLIENT_REQ)) || > !(dev->protocol_features & > - (1ULL << > VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD)) || > + (1ULL << > VHOST_USER_PROTOCOL_F_CLIENT_SEND_FD)) || > !(dev->protocol_features & > (1ULL << > VHOST_USER_PROTOCOL_F_HOST_NOTIFIER))) > return -ENOTSUP; > @@ -3034,7 +3034,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_client_set_vring_host_notifier(dev, i, > vfio_device_fd, offset, size) < 0) { > ret =3D -EFAULT; > goto disable; > @@ -3043,7 +3043,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_client_set_vring_host_notifier(dev, i, -1, > 0, 0); > } > } > diff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.= h > index 1f65efa4a935..91aa8e24ea48 100644 > --- a/lib/librte_vhost/vhost_user.h > +++ b/lib/librte_vhost/vhost_user.h > @@ -14,16 +14,17 @@ >=20 > #define VHOST_MEMORY_MAX_NREGIONS 8 >=20 > -#define VHOST_USER_PROTOCOL_FEATURES ((1ULL << > VHOST_USER_PROTOCOL_F_MQ) | \ > - (1ULL << > VHOST_USER_PROTOCOL_F_LOG_SHMFD) |\ > - (1ULL << > VHOST_USER_PROTOCOL_F_RARP) | \ > - (1ULL << > VHOST_USER_PROTOCOL_F_REPLY_ACK) | \ > - (1ULL << > VHOST_USER_PROTOCOL_F_NET_MTU) | \ > - (1ULL << > VHOST_USER_PROTOCOL_F_SLAVE_REQ) | \ > - (1ULL << > VHOST_USER_PROTOCOL_F_CRYPTO_SESSION) | \ > - (1ULL << > VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \ > - (1ULL << > VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \ > - (1ULL << > VHOST_USER_PROTOCOL_F_PAGEFAULT)) > +#define VHOST_USER_PROTOCOL_FEATURES \ > + ((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \ > + (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) | \ > + (1ULL << VHOST_USER_PROTOCOL_F_RARP) | \ > + (1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK) | \ > + (1ULL << VHOST_USER_PROTOCOL_F_NET_MTU) | \ > + (1ULL << VHOST_USER_PROTOCOL_F_CLIENT_REQ) | \ > + (1ULL << VHOST_USER_PROTOCOL_F_CRYPTO_SESSION) | \ > + (1ULL << VHOST_USER_PROTOCOL_F_CLIENT_SEND_FD) | \ > + (1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \ > + (1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT)) >=20 > typedef enum VhostUserRequest { > VHOST_USER_NONE =3D 0, > @@ -47,7 +48,7 @@ typedef enum VhostUserRequest { > VHOST_USER_SET_VRING_ENABLE =3D 18, > VHOST_USER_SEND_RARP =3D 19, > VHOST_USER_NET_SET_MTU =3D 20, > - VHOST_USER_SET_SLAVE_REQ_FD =3D 21, > + VHOST_USER_SET_CLIENT_REQ_FD =3D 21, > VHOST_USER_IOTLB_MSG =3D 22, > VHOST_USER_CRYPTO_CREATE_SESS =3D 26, > VHOST_USER_CRYPTO_CLOSE_SESS =3D 27, > @@ -59,13 +60,13 @@ typedef enum VhostUserRequest { > VHOST_USER_MAX =3D 33 > } VhostUserRequest; >=20 > -typedef enum VhostUserSlaveRequest { > - VHOST_USER_SLAVE_NONE =3D 0, > - VHOST_USER_SLAVE_IOTLB_MSG =3D 1, > - VHOST_USER_SLAVE_CONFIG_CHANGE_MSG =3D 2, > - VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG =3D 3, > - VHOST_USER_SLAVE_MAX > -} VhostUserSlaveRequest; > +typedef enum VhostUserClientRequest { > + VHOST_USER_CLIENT_NONE =3D 0, > + VHOST_USER_CLIENT_IOTLB_MSG =3D 1, > + VHOST_USER_CLIENT_CONFIG_CHANGE_MSG =3D 2, > + VHOST_USER_CLIENT_VRING_HOST_NOTIFIER_MSG =3D 3, > + VHOST_USER_CLIENT_MAX > +} VhostUserClientRequest; >=20 > typedef struct VhostUserMemoryRegion { > uint64_t guest_phys_addr; > @@ -124,8 +125,8 @@ typedef struct VhostUserInflight { >=20 > typedef struct VhostUserMsg { > union { > - uint32_t master; /* a VhostUserRequest value */ > - uint32_t slave; /* a VhostUserSlaveRequest value*/ > + uint32_t server; /* a VhostUserRequest value */ > + uint32_t client; /* a VhostUserClientRequest value*/ > } request; >=20 > #define VHOST_USER_VERSION_MASK 0x3 > -- > 2.26.2