From patchwork Thu Mar 9 05:16:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro MIKI X-Patchwork-Id: 124886 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C5A0641E30; Thu, 9 Mar 2023 06:17:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5BDBB410EE; Thu, 9 Mar 2023 06:17:14 +0100 (CET) Received: from corp-ob08.yahoo-corp.jp (corp-ob08.yahoo-corp.jp [183.79.94.93]) by mails.dpdk.org (Postfix) with ESMTP id F2A1740ED7 for ; Thu, 9 Mar 2023 06:17:09 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01lp2170.outbound.protection.outlook.com [104.47.23.170]) by corp-ob08.yahoo-corp.jp (Postfix) with ESMTPS id 6CA9B19FB18B; Thu, 9 Mar 2023 14:17:08 +0900 (JST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=en6tyOpLMjASuMktPOQex+L63mGPb68b+RAP4/KMgG3fXqnHsBdmTiGIyjTSWFt5HAapPpuR0tub+beoGACHBxi+KxHTKja3dbd/QuO95aClitxEwVjUvq1qUaW1+i0vEHmeSqte7BwGB7ysqC1ZFWnCLSY6CZstaU4HsgE9jLc8ScE3MaU7gH2cgOcNXzT3uyvbJlEsfSb1jUnYFeSJIQZjS7HYfW8lSsiZt2SFisCaFbo5EXyX6KMModMJP1U2GqGMoAzyQlXy+yvIQXKKyrW+iw+55Co9xXKY7SnoFIBGIVvHHKrVdPAaZJXym4LlAqFVsFJW4Ev0F4O+CzwYbQ== 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=gGnaU00KEv6IGen3O6KE99lR10xYWKYFQXybtKef+io=; b=i4Sl/4KPUU5rw0LSWLJ/wDDXjtjLgr+98T7arsn3mrQkT+LmqoNf4sBpRAg/z/qPBk5RZDasXhVB/fh5NOgOxr6r2l5xG6xAIgDrgT2F/NVe4AE34Hyhyrvb1vqDvBgFduIuR67vdQMSX38Wmv24RWOKYH/d9ngXjqigiFmgYh7lVsh6I98/ue1+aOF2STbv4CYAieGGFimjM60yEVnCRyU/evK5vLQyaL3rewxXuSlS9xFzhB4HyweHSXhiGLlZVLQ2rdtUhdwj+aH2fE/+nJxWLt8+kXrPHXS6qn38EKzvIRYogm+HchjOvPzLMe0kSrLFM7hUBm0ZrS48lz6JFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=yahoo-corp.jp; dmarc=pass action=none header.from=yahoo-corp.jp; dkim=pass header.d=yahoo-corp.jp; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo-corp.jp; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gGnaU00KEv6IGen3O6KE99lR10xYWKYFQXybtKef+io=; b=e1rfn7uQJeGpbRtW0MLx6i9FKF6QoWvjdl2xPWPBa2McabzDxVAuIzv4AO/uuXEZs16aYKeZJIXjQVf8vES7yCONqFzmoghK4X/btHGMkR7KNYjvxZA3OJGs4KD+4KaOqe4YThhDCB5q6PFDEWQSxWESuwWWrhzCYnU39Zz9lF0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=yahoo-corp.jp; Received: from TY2PR01MB4107.jpnprd01.prod.outlook.com (2603:1096:404:d8::23) by TYVPR01MB11358.jpnprd01.prod.outlook.com (2603:1096:400:366::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Thu, 9 Mar 2023 05:17:06 +0000 Received: from TY2PR01MB4107.jpnprd01.prod.outlook.com ([fe80::61fe:e4c3:a819:6ce6]) by TY2PR01MB4107.jpnprd01.prod.outlook.com ([fe80::61fe:e4c3:a819:6ce6%7]) with mapi id 15.20.6178.019; Thu, 9 Mar 2023 05:17:06 +0000 From: Nobuhiro MIKI To: maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: dev@dpdk.org, stephen@networkplumber.org, Nobuhiro MIKI Subject: [PATCH v2 1/2] vhost: fix constants to follow new naming convention Date: Thu, 9 Mar 2023 14:16:42 +0900 Message-Id: <20230309051643.70171-2-nmiki@yahoo-corp.jp> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230309051643.70171-1-nmiki@yahoo-corp.jp> References: <20230309051643.70171-1-nmiki@yahoo-corp.jp> X-ClientProxiedBy: TYCPR01CA0114.jpnprd01.prod.outlook.com (2603:1096:405:4::30) To TY2PR01MB4107.jpnprd01.prod.outlook.com (2603:1096:404:d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY2PR01MB4107:EE_|TYVPR01MB11358:EE_ X-MS-Office365-Filtering-Correlation-Id: e84ad91a-e948-44d1-2aff-08db205d8681 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2onkrdVpXtZKbLn4XsNQwGbJaLSYHTJs2Lq4pO4y/Im4fAQv6msRxx/ut8cFhPURfjuEKfBlo3S/Aq7F0Fu00mjhqqOggxiAh1moA5B3G/aLxcqm0GITy1jW+xEPpzj0u+o0hzL+eyhNY+89fVtqkRHXd+RH+zBXgdg12jfdYgce3QDOV1MQS0qKZw+X9RMqNb+WYaM7qEzq2tPht9XoqiC+7wDF40STMAq8nk2AUSxK+2jJR+2gQdFZUgm6JI9hEfmfJbwXiHHb/SsJh2mCmcna9+obZYYBb83/uOZU69cKmcDavH/b1pwlETQiD+Gj7kiHjYEbqWqhMWSCUjU2l1LRKDuFzs2jPv3xrR+83bCDSyixfX0/O9sJMVt7YDdv5Nb+OJnxQw4mCR19rK39YmmL6gqifl2PNF/zG6U8/4IQjMBm1QBPsDu+3k1lzG/8FVRhgK5jdk2/9kDhTiAf2QLF6cVpkt470YYiTDJ6dzTN5LNOH5qGkRN2oSWs+woleBKqOfAX1GkCncRvyrtmP+Si/Is/P0wRk2ExB+hT5e/mOU35rlJNYPOb+qngSofnAcR8QfN+9eHSRj/Gf1zj/uCVsSHM2kXt4K+ZlpxoGQoiWpQHIXG8vIi/GFqfIoHN/qqYjJ94cs7limNMJOiQpw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TY2PR01MB4107.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(366004)(346002)(39860400002)(136003)(396003)(376002)(451199018)(36756003)(6486002)(478600001)(966005)(316002)(52116002)(5660300002)(41300700001)(2906002)(8936002)(8676002)(66946007)(66556008)(66476007)(4326008)(107886003)(82960400001)(38100700002)(38350700002)(86362001)(186003)(6666004)(2616005)(1076003)(26005)(6512007)(6506007)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: on58qM7jJQfc4e9uacDseYOZsw45wM8Tq6frVyMgA4B28TzrTrlYv45zaFhQ9q26GrKJ+amiKudxU+eIgtyP5j4vFAnJF/o2ynIJs7BbBzMq48zRRutNRHVzzYqu+fddaY2mD48R7nGU0xWhhz70UmHrMYeDNlv8gZpwuGYHZyxUxnIoPkLwdWvETLz79xuzcTBsGsY4sIDjteigKZYfZENRhUakgrS0PCUyLDBVEHni0xbb7rfhiLB2Ru2urcl0rm0lFPrkudXn9foaZ8snvgkx2b/etlsdjXYboK5o7jCvBuxMOYRi51ZfRTjnuO+nAYo0++9UjQM4wcuv7FlH/C21BjFdnMgBeUIMBKuuyyce0QKGD5EufTY7SjCeUPQ+DOBpnksV7rs+WFsCHqs4C5bnqdbUQPTCqdm4B8YXS0fbo008D6Ig8SGoQO0DpKiG4fNQfBwjT0zi5N7gq6Go2ZmahN1U7CVh06LAxh3wZ6kfirSdxDKLQJpsE2RDHfis6XBGusCZwRRVM4CNISPHT1NqgBJW+ts7Mj00UJUG/J4Mlcb3ClKz0A3JgbhfvWKy6Id6o2rfpz/Fzv+4c8hVcQxEGUOC/j6lg7dhD/Fm8rcHIZRJorI5rLY96EOUJXqAxEEuHa2o0wlhQhk6ytvRJmZf3aAivtaBy4td9j07shbkcZg1+fDOOt566/p/Z8SSVrPVQ2+HlZWdREY/nE+/7s1QZSeOu4sIq64A5i9sovZqLrQkBm69qf//ASuNd2KnOtKKCPjmZ/RulJTwLnOTgeTH8RlzMhioFTjpfwdbHnPzc4mHTabjkzgYiMKtcn8vOa4V0wE/W9v7ooExeUfBXHwF/LjsbrpfzOh6uDlmpcR49BlbYXT4X/fIDhpxIyE5/tc0mmxfnuREwELMf1KgQ7OTX7Lioo6E9sXC6+As9PpwhmXfzUv14iWN1eCHyZPucBZXrDrBqiSyReWG0Md7mV/WM5uge0SPLlcqu96TqWv8EChFC/CTOr6voP4wqXQd8pKubOgIsfAPm4V9NFhlMAK679u1GhDCynTGeuhBEXGtgbj3s8hV6dAgITVUNhHFcku09gdGHLaim/DB2Upu1wQqWj6J4t+GpXvAFs7mcTy9hJP668LjuC13qO/M8M+rnHIzUSwtEVXlbgLapI48e5m2q9pNNFRB5KccSMWZYy2kxp5rXSJnZXWhemq2+BdtU/7GXM/13TkSCO0EpT5/aYH2ydz06CBorX6GdPUAzeBkXjpbao7oXLdfwh5o9CN7TXwUHG/WfiUSH3vRJaP1vXvkTjudMI3NMZyrRntCKsghuESi0P5+3rhNGDK7YZoeSQ6j27+mtrLGXGqh1VnHU5RyOMjBvVWJPNsnPOoTHZ0jUg6gqUFpmAww/HKiXMrMvfVSe04THqUXeTf6/WDiH4auKC9jTiB+kDV+FbwDkSTD02u2vTh8iyOmXanpPbucsttLlUzQvcwBmC7vH4lY1DTfYMMti/+docJ3UPjdsFkHIgDkrpHph5gM9zMpT73qnyKAoJCiQr20PBcc0vUEiL5WZPwUOXs2YUNzvnw8xOW5y8k/ZffSL8OhZCAJ+1WA X-OriginatorOrg: yahoo-corp.jp X-MS-Exchange-CrossTenant-Network-Message-Id: e84ad91a-e948-44d1-2aff-08db205d8681 X-MS-Exchange-CrossTenant-AuthSource: TY2PR01MB4107.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 05:17:06.5435 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a208d369-cd4e-4f87-b119-98eaf31df2c3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ugqd+jV4NEasTrgLTOxezdjfB4TfyRfwapeBvCAc4C6GEvYYr6Eosg/i+FtjEeBS9p7Y8S5XQslorxK/q+6vfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYVPR01MB11358 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 DPDK apps (e.g. dpdk-skeleton) output this name during negotiation. But, it is not consistent when debugging using QEMU as a front-end, for example. This is because QEMU already follows new naming convention [1]. Some type names and variable names, such as VhostUserSlaveRequest, are still in old naming convention. But, in this patch we only focus on constants. [1] https://qemu-project.gitlab.io/qemu/interop/vhost-user.html Signed-off-by: Nobuhiro MIKI Acked-by: Stephen Hemminger Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- .mailmap | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 4 ++-- drivers/vdpa/mlx5/mlx5_vdpa.c | 4 ++-- drivers/vdpa/sfc/sfc_vdpa_ops.c | 4 ++-- lib/vhost/rte_vhost.h | 8 ++++---- lib/vhost/vhost_user.c | 14 +++++++------- lib/vhost/vhost_user.h | 14 +++++++------- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.mailmap b/.mailmap index 8e7d78f37eef..3400241a6908 100644 --- a/.mailmap +++ b/.mailmap @@ -980,7 +980,7 @@ Nithin Dabilpuram Nitzan Weller Noa Ezra -Nobuhiro Miki +Nobuhiro MIKI Norbert Ciosek Odi Assli Ognjen Joldzic diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 4a87673682fc..fe4d278c5380 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -1315,8 +1315,8 @@ ifcvf_get_vdpa_features(struct rte_vdpa_device *vdev, uint64_t *features) #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_BACKEND_REQ | \ + 1ULL << VHOST_USER_PROTOCOL_F_BACKEND_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/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c index f8dfa9513311..f1737f82a8ae 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c @@ -37,8 +37,8 @@ (1ULL << VIRTIO_NET_F_MTU)) #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_BACKEND_REQ) | \ + (1ULL << VHOST_USER_PROTOCOL_F_BACKEND_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/drivers/vdpa/sfc/sfc_vdpa_ops.c b/drivers/vdpa/sfc/sfc_vdpa_ops.c index 6401d4e16f25..e88c7eeaa609 100644 --- a/drivers/vdpa/sfc/sfc_vdpa_ops.c +++ b/drivers/vdpa/sfc/sfc_vdpa_ops.c @@ -21,8 +21,8 @@ /* These protocol features are needed to enable notifier ctrl */ #define SFC_VDPA_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_BACKEND_REQ) | \ + (1ULL << VHOST_USER_PROTOCOL_F_BACKEND_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/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h index a395843fe96d..ed255fc6c51f 100644 --- a/lib/vhost/rte_vhost.h +++ b/lib/vhost/rte_vhost.h @@ -80,8 +80,8 @@ extern "C" { #define VHOST_USER_PROTOCOL_F_NET_MTU 4 #endif -#ifndef VHOST_USER_PROTOCOL_F_SLAVE_REQ -#define VHOST_USER_PROTOCOL_F_SLAVE_REQ 5 +#ifndef VHOST_USER_PROTOCOL_F_BACKEND_REQ +#define VHOST_USER_PROTOCOL_F_BACKEND_REQ 5 #endif #ifndef VHOST_USER_PROTOCOL_F_CRYPTO_SESSION @@ -96,8 +96,8 @@ extern "C" { #define VHOST_USER_PROTOCOL_F_CONFIG 9 #endif -#ifndef VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD -#define VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD 10 +#ifndef VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD +#define VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD 10 #endif #ifndef VHOST_USER_PROTOCOL_F_HOST_NOTIFIER diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index 9e361082dc9b..cd4104ea5ce0 100644 --- a/lib/vhost/vhost_user.c +++ b/lib/vhost/vhost_user.c @@ -2846,7 +2846,7 @@ VHOST_MESSAGE_HANDLER(VHOST_USER_GET_QUEUE_NUM, vhost_user_get_queue_num, false) VHOST_MESSAGE_HANDLER(VHOST_USER_SET_VRING_ENABLE, vhost_user_set_vring_enable, false) \ VHOST_MESSAGE_HANDLER(VHOST_USER_SEND_RARP, vhost_user_send_rarp, false) \ VHOST_MESSAGE_HANDLER(VHOST_USER_NET_SET_MTU, vhost_user_net_set_mtu, false) \ -VHOST_MESSAGE_HANDLER(VHOST_USER_SET_SLAVE_REQ_FD, vhost_user_set_req_fd, true) \ +VHOST_MESSAGE_HANDLER(VHOST_USER_SET_BACKEND_REQ_FD, vhost_user_set_req_fd, true) \ VHOST_MESSAGE_HANDLER(VHOST_USER_IOTLB_MSG, vhost_user_iotlb_msg, false) \ VHOST_MESSAGE_HANDLER(VHOST_USER_GET_CONFIG, vhost_user_get_config, false) \ VHOST_MESSAGE_HANDLER(VHOST_USER_SET_CONFIG, vhost_user_set_config, false) \ @@ -3143,7 +3143,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_BACKEND_REQ_FD: if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) { vhost_user_lock_all_queue_pairs(dev); unlock_required = 1; @@ -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 = { .msg = { - .request.slave = VHOST_USER_SLAVE_IOTLB_MSG, + .request.slave = VHOST_USER_BACKEND_IOTLB_MSG, .flags = VHOST_USER_VERSION, .size = sizeof(ctx.msg.payload.iotlb), .payload.iotlb = { @@ -3334,7 +3334,7 @@ rte_vhost_slave_config_change(int vid, bool need_reply) { struct vhu_msg_context ctx = { .msg = { - .request.slave = VHOST_USER_SLAVE_CONFIG_CHANGE_MSG, + .request.slave = VHOST_USER_BACKEND_CONFIG_CHANGE_MSG, .flags = VHOST_USER_VERSION, .size = 0, } @@ -3366,7 +3366,7 @@ static int vhost_user_slave_set_vring_host_notifier(struct virtio_net *dev, int ret; struct vhu_msg_context ctx = { .msg = { - .request.slave = VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG, + .request.slave = VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG, .flags = VHOST_USER_VERSION | VHOST_USER_NEED_REPLY, .size = sizeof(ctx.msg.payload.area), .payload.area = { @@ -3410,9 +3410,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_BACKEND_REQ)) || !(dev->protocol_features & - (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD)) || + (1ULL << VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD)) || !(dev->protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER))) return -ENOTSUP; diff --git a/lib/vhost/vhost_user.h b/lib/vhost/vhost_user.h index 8ecca6859707..8e418414ba94 100644 --- a/lib/vhost/vhost_user.h +++ b/lib/vhost/vhost_user.h @@ -18,9 +18,9 @@ (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_BACKEND_REQ) | \ (1ULL << VHOST_USER_PROTOCOL_F_CRYPTO_SESSION) | \ - (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \ + (1ULL << VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD) | \ (1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \ (1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT) | \ (1ULL << VHOST_USER_PROTOCOL_F_STATUS)) @@ -47,7 +47,7 @@ typedef enum VhostUserRequest { VHOST_USER_SET_VRING_ENABLE = 18, VHOST_USER_SEND_RARP = 19, VHOST_USER_NET_SET_MTU = 20, - VHOST_USER_SET_SLAVE_REQ_FD = 21, + VHOST_USER_SET_BACKEND_REQ_FD = 21, VHOST_USER_IOTLB_MSG = 22, VHOST_USER_GET_CONFIG = 24, VHOST_USER_SET_CONFIG = 25, @@ -63,10 +63,10 @@ typedef enum VhostUserRequest { } VhostUserRequest; typedef enum VhostUserSlaveRequest { - VHOST_USER_SLAVE_NONE = 0, - VHOST_USER_SLAVE_IOTLB_MSG = 1, - VHOST_USER_SLAVE_CONFIG_CHANGE_MSG = 2, - VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG = 3, + VHOST_USER_BACKEND_NONE = 0, + VHOST_USER_BACKEND_IOTLB_MSG = 1, + VHOST_USER_BACKEND_CONFIG_CHANGE_MSG = 2, + VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG = 3, } VhostUserSlaveRequest; typedef struct VhostUserMemoryRegion { From patchwork Thu Mar 9 05:16:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro MIKI X-Patchwork-Id: 124888 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 137F041E30; Thu, 9 Mar 2023 06:17:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD78242B8E; Thu, 9 Mar 2023 06:17:16 +0100 (CET) Received: from corp-ob09.yahoo-corp.jp (corp-ob09.yahoo-corp.jp [182.22.125.216]) by mails.dpdk.org (Postfix) with ESMTP id 2AC6F4111C for ; Thu, 9 Mar 2023 06:17:09 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01lp2175.outbound.protection.outlook.com [104.47.23.175]) by corp-ob09.yahoo-corp.jp (Postfix) with ESMTPS id 9F55619FB187; Thu, 9 Mar 2023 14:17:08 +0900 (JST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tlr7O/YfnnEMrEX0qsidu5Jmuyd5Ryt5Bdlh15Cr/U6QMYpGQI6x3x0Lnmhakz2CuKfavOfNI+QCElDYd87s+npAB9P+x0JSWfRHf7lVo/LzLa0XwxPizfFFRU3IwhAQWYGWImQZa5qFKf1KAC28iYGA2ylz8MLpOglJlEzUjZnYhNHE7rdSGIjWzgd3gOGbXSF8jtDd/lNB62hWL9IUeExqns19vL0yCyse7KOO4Y+xflh+yJEVjKk0YKv7d1e9s0vKBpPadcmdwhlNYdF6Llji5+4BcTLQ1c75AaLSH1+TQHsKkUvCKkcfLEwTgJxY2x+6oWcUqBXKxmj4lEbmQQ== 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=8INzdGptvH0pQRBaCuJeCEqNb1ANm3zuWrOeMQNphd0=; b=WEQvaASqGYnjyUK8iZXYoC9YNK/+fJTFJuj7snY5oaVgE3XR/htO+fWPMPKnIxB/eotoLYRCWyJluitXprm/9yWCNUTfKebmGpSCploUOYxm+TXl1maBMshQLvRwvXXK7a2gMNsLx3fsafOQg/q01QrWsdEdHG0dIe8nq/+A1dC4uJb9ge1RL7FYA4W9ejn3h6bwjHWZrtOcFoi6vUrELFMpHHEmKq7ivVhvCFuQtQRskrE+zgxFXXq9tXgPiZt7FanaTgWy24do9mA/GuYZ+5zWV+u2YIVSvhOOrKITFmm/V2GurMdc7Y6EKyItyCZztFambw6VnnwIcqef3vpNBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=yahoo-corp.jp; dmarc=pass action=none header.from=yahoo-corp.jp; dkim=pass header.d=yahoo-corp.jp; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo-corp.jp; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8INzdGptvH0pQRBaCuJeCEqNb1ANm3zuWrOeMQNphd0=; b=LPcvkaUo+tdvGWUJfrjmGzudRscNnUVwy95oEEpmmoknA9r6xxzpfj3g3mMr3FVufB9qWAVANCB6zoMnWY5hCnImmNzlAEGdBzYDymoTD9eWkbGZI1QaSCoC68RdRZiQuDWl7rhgwcB3UL26+m1/4zZoatq1QN4WTn1aUWEQhkI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=yahoo-corp.jp; Received: from TY2PR01MB4107.jpnprd01.prod.outlook.com (2603:1096:404:d8::23) by TYTPR01MB10990.jpnprd01.prod.outlook.com (2603:1096:400:3a2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Thu, 9 Mar 2023 05:17:07 +0000 Received: from TY2PR01MB4107.jpnprd01.prod.outlook.com ([fe80::61fe:e4c3:a819:6ce6]) by TY2PR01MB4107.jpnprd01.prod.outlook.com ([fe80::61fe:e4c3:a819:6ce6%7]) with mapi id 15.20.6178.019; Thu, 9 Mar 2023 05:17:07 +0000 From: Nobuhiro MIKI To: maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: dev@dpdk.org, stephen@networkplumber.org, Nobuhiro MIKI Subject: [PATCH v2 2/2] vhost: refactor to follow new naming convention Date: Thu, 9 Mar 2023 14:16:43 +0900 Message-Id: <20230309051643.70171-3-nmiki@yahoo-corp.jp> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230309051643.70171-1-nmiki@yahoo-corp.jp> References: <20230309051643.70171-1-nmiki@yahoo-corp.jp> X-ClientProxiedBy: TYCPR01CA0114.jpnprd01.prod.outlook.com (2603:1096:405:4::30) To TY2PR01MB4107.jpnprd01.prod.outlook.com (2603:1096:404:d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY2PR01MB4107:EE_|TYTPR01MB10990:EE_ X-MS-Office365-Filtering-Correlation-Id: a5bfe017-0d1c-4633-607f-08db205d86d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v7WZkv7bvmxH65JioWy2+ol1oF0KWJzw0dHA/uDKN5i69Dcwnb4JI3RvSAc1ut1EKZ4EhCwuySq2y4c47ugbNq/jmWFK4ZhQxe3hOfJpfcmDiwumYYR96AqY6iIFeGsSW+HKQR1WexqkfdPtBTriWwRcwx1ufOQprAyPMW8vaqN4F5oIdqoStBS4uh9hmr3IKaHJ/VFNC/tsM0Ie0eNettUfEYT1sXlOHtG8nDi0WsrOe8zfqP2DgXHcN7NYos9fx+yqdL80LAmEJXxXbGK83udUBCrUyJ7aXbk1DZZaJlHwtis+snoNwuUuk2MFaiDqkR7RPSDaSMojionP7cl3ENRCaZ82Wk/rQ4eYPJzmsXj/sC4HkGTgpo3maIQMcKu4zbtV/CUvSb5F4dhbBfzEuPIqmvzJyIFjJPt35pyZiYFVdcauZHZydZ9LoTZET8JDQQNFfUV2mA/lKJbraMmmPBW+ysN/b1qBURc5pdRO9qqbWyfnI+3wthMViqBUO66U5oa1++iEicSFYxRZyw/nwZ8HRAACeN7UskTq0eBR5N47Svt8ISrgObJrd3KHDfvIfzNFycongFtE4fRLjmchM/tzJOUOS4XXI2Bqu7ao320F9ulbudjPdQzKfq/9HKdB+XCv26MlFYR3z7f5uSaUkax3V7ddzoGTj+tvB+cbJAb9bBP/DIsxYLjDMwTwWj2GADwrOv2H0fy9HY3gJucXzg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TY2PR01MB4107.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(39860400002)(346002)(396003)(366004)(376002)(451199018)(36756003)(38350700002)(38100700002)(86362001)(82960400001)(6512007)(6506007)(1076003)(26005)(83380400001)(186003)(6666004)(2616005)(316002)(52116002)(5660300002)(478600001)(6486002)(41300700001)(4326008)(107886003)(8936002)(30864003)(2906002)(66946007)(66556008)(66476007)(8676002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qtr6iduzODrM4sp7UIecZdYgVinOds8wh6IRk53uK2XqQH0BH4KBWLmQqa+G0bcLrzOc/n9/Ub4MvR2G8sPT+01QdECahnk2kf+nrFD2aOORJoB3Lpqlbv88D+Gx2vOxbtRFl/Jvndbdymkz2yVgD9Y7ypqPGceZVZdIeWFXv/LSV6p+ovnYiOJ2OD5iANm7w+PFdmE6vrp5wGf8HztkcKv1zJr/rG/csiJQ2Sslr+EOpHlwW50lMMAjQLchXavGJ+mpuFSBN5XyxiFqQ07zn++oMmoXhtwnKtArhwU+A4USLdkHvsRs4P/8sJcEymY2MNwCJwe3vBXDKVcyMzuGFUCSto8YJIKMkZXoyTL8FDwSUxygzxjV7sLWkzhxBSfcxM0GvYDta7uZ6hOA9c8BJ8EDfXZDDWPoPoLNm+wVVLthJ+j0EaL4lOy7slJqLDgRrRLSFaRijhkf3mJh5BWJ0oWOAt5qdLHQcaRchFiHMq93VGX+QWEZ0QI0/fIcG3ijaulZcql5g31uTYxID+eWQ6HWg9aZtu2tbwvfuh8hyaFuhm3ZS3VS21JqmfJ5TfyYx37Jh0PonDN/snCD+kUr8rR3+h9532ztV/bEPnZ9Q2Oau3KwQkBt+2xPT0DlzDhaiqL/MKfA5RKYzykjJAj9uStkJ1YpOJB2BY0UjT99sh3bUNheNTjcI8rOgBnePlBpK71wtJc9IdQHJrdfYOCsy+ctg7eadj6BxFNszrv/DROKiV2zEXwIjC+y1v2GoCJkJMoO9OGoH7hVqyPT9WhIuze+S8zDkqPudqOfxtw/h6iIzTRUVz6BCo7kpGtbviw2vCWOY7uFwGiiaModXBCq72k99b0PC8VqjP6R+AzpRg4mjm4p9ZcIFTbkdLBPx0hGtsAkM2Ib6ciIcKAml+4E+4Y38w9XTPa9HtID8HEJyj/iPkQZqgfO/Fyw0Z36SLsytb5CtwvIXo/S08t68ospcd0m/4gdUcNyw7Xuvi8PVp0c3P/lJfBcWYIjzndPIpdEiewhEygytJUNn3zEO71PHVMV4Epe34VxAmObndVbsz08BOGahy5bUA6H+Z8nkzPrCYBCFzETsne18yHruIdOTi6onZXiDlIVGPZVqap8WoSjLndACG0tj8/Mcnhm49MSF7HmpT7dJKKzJIyLBX525SCgt3L+T1sA94juGrYMHijBtNBhxT4pYGfQdT+7AD5cnFNVJXAd7i1O5V+ednqz8i2aIE1AszmCmZgGPhYOpFTs2cFnisaAeTOhm/wq6pT1iCab5hRnLUY4i3xGZp+WUOmLuJZPdpBeN9oYfEfLWoOwWmEXMMQ1GhyIRnrdCUorN+B0IEau1IgESeaFGU94tnWoY6c5AuD92Kqurs2yVE0T9m8kHuX/LWUkLDYsGp1LKgdz8mMlpR2V9EBjhXufMxrf3l2urj03jMjamEeTuvXYB6KmbyYbeHBZVELvRmhIagtuTy46K+WmB8xUJ4w/l/pJx2hkNp22DWtC0WrJdMFO93c4dMl/EfGk+v6MhulTCYBmTt86gLEGwS6HoIIStikl1N3K6CtpHnYcqYPnIVnWSsggUp79DOu96+IjQnHm X-OriginatorOrg: yahoo-corp.jp X-MS-Exchange-CrossTenant-Network-Message-Id: a5bfe017-0d1c-4633-607f-08db205d86d9 X-MS-Exchange-CrossTenant-AuthSource: TY2PR01MB4107.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 05:17:07.1372 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a208d369-cd4e-4f87-b119-98eaf31df2c3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PoV3oPY0e/v/rNZXlQhwjQGdYe0LUdJPhbHecWptMtpcQP2lMaG+QPU7TMFbjyRSfNyKDn+TqyejvK4z5phgGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYTPR01MB10990 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 Simply replace 'master' with 'frontend' and 'slave' with 'backend'. Signed-off-by: Nobuhiro MIKI Acked-by: Stephen Hemminger Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- 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(-) 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 = internal->vid; int ret; - ret = rte_vhost_slave_config_change(vid, 1); + ret = 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; }; @@ -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); /** * 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: 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) dev->vid = i; dev->flags = VIRTIO_DEV_BUILTIN_VIRTIO_NET; - dev->slave_req_fd = -1; + dev->backend_req_fd = -1; dev->postcopy_ufd = -1; - rte_spinlock_init(&dev->slave_req_lock); + rte_spinlock_init(&dev->backend_req_lock); 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; - int slave_req_fd; - rte_spinlock_t slave_req_lock; + int backend_req_fd; + rte_spinlock_t backend_req_lock; 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; } - 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 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); close_msg_fds(ctx); @@ -226,9 +226,9 @@ vhost_backend_cleanup(struct virtio_net *dev) dev->inflight_info = NULL; } - if (dev->slave_req_fd >= 0) { - close(dev->slave_req_fd); - dev->slave_req_fd = -1; + if (dev->backend_req_fd >= 0) { + close(dev->backend_req_fd); + dev->backend_req_fd = -1; } if (dev->postcopy_ufd >= 0) { @@ -349,7 +349,7 @@ vhost_user_set_features(struct virtio_net **pdev, return RTE_VHOST_MSG_RESULT_OK; /* - * 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) != 0) return -1; - if (ack_ctx.msg.request.master != VHOST_USER_SET_MEM_TABLE) { + if (ack_ctx.msg.request.frontend != 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; } @@ -2257,11 +2257,11 @@ vhost_user_set_protocol_features(struct virtio_net **pdev, { struct virtio_net *dev = *pdev; uint64_t protocol_features = ctx->msg.payload.u64; - uint64_t slave_protocol_features = 0; + uint64_t backend_protocol_features = 0; 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, 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; } - if (dev->slave_req_fd >= 0) - close(dev->slave_req_fd); + if (dev->backend_req_fd >= 0) + close(dev->backend_req_fd); - dev->slave_req_fd = fd; + dev->backend_req_fd = fd; return RTE_VHOST_MSG_RESULT_OK; } @@ -2931,46 +2931,46 @@ send_vhost_reply(struct virtio_net *dev, int sockfd, struct vhu_msg_context *ctx } 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_context *ctx) { - return send_vhost_message(dev, dev->slave_req_fd, ctx); + return send_vhost_message(dev, dev->backend_req_fd, ctx); } 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; - rte_spinlock_lock(&dev->slave_req_lock); - ret = send_vhost_slave_message(dev, ctx); + rte_spinlock_lock(&dev->backend_req_lock); + ret = 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; } - ret = read_vhost_message(dev, dev->slave_req_fd, &msg_reply); + ret = read_vhost_message(dev, dev->backend_req_fd, &msg_reply); if (ret <= 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 = -1; goto out; } - if (msg_reply.msg.request.slave != ctx->msg.request.slave) { + if (msg_reply.msg.request.backend != 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 = -1; goto out; } ret = msg_reply.msg.payload.u64 ? -1 : 0; out: - rte_spinlock_unlock(&dev->slave_req_lock); + rte_spinlock_unlock(&dev->backend_req_lock); return ret; } @@ -2983,7 +2983,7 @@ vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev, { uint32_t vring_idx; - 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) } } - ctx.msg.request.master = VHOST_USER_NONE; + ctx.msg.request.frontend = VHOST_USER_NONE; ret = read_vhost_message(dev, fd, &ctx); if (ret == 0) { VHOST_LOG_CONFIG(dev->ifname, INFO, "vhost peer closed\n"); return -1; } - request = ctx.msg.request.master; + request = ctx.msg.request.frontend; if (request > VHOST_USER_NONE && request < RTE_DIM(vhost_message_handlers)) msg_handler = &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 = { .msg = { - .request.slave = VHOST_USER_BACKEND_IOTLB_MSG, + .request.backend = VHOST_USER_BACKEND_IOTLB_MSG, .flags = VHOST_USER_VERSION, .size = sizeof(ctx.msg.payload.iotlb), .payload.iotlb = { @@ -3318,7 +3318,7 @@ vhost_user_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm) }, }; - ret = send_vhost_message(dev, dev->slave_req_fd, &ctx); + ret = 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) } 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 = { .msg = { - .request.slave = VHOST_USER_BACKEND_CONFIG_CHANGE_MSG, + .request.backend = VHOST_USER_BACKEND_CONFIG_CHANGE_MSG, .flags = VHOST_USER_VERSION, .size = 0, } @@ -3347,10 +3347,10 @@ rte_vhost_slave_config_change(int vid, bool need_reply) return -ENODEV; if (!need_reply) { - ret = send_vhost_slave_message(dev, &ctx); + ret = send_vhost_backend_message(dev, &ctx); } else { ctx.msg.flags |= VHOST_USER_NEED_REPLY; - ret = send_vhost_slave_message_process_reply(dev, &ctx); + ret = send_vhost_backend_message_process_reply(dev, &ctx); } if (ret < 0) @@ -3358,7 +3358,7 @@ rte_vhost_slave_config_change(int vid, bool need_reply) return ret; } -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 = { .msg = { - .request.slave = VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG, + .request.backend = VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG, .flags = VHOST_USER_VERSION | VHOST_USER_NEED_REPLY, .size = sizeof(ctx.msg.payload.area), .payload.area = { @@ -3384,7 +3384,7 @@ static int vhost_user_slave_set_vring_host_notifier(struct virtio_net *dev, ctx.fd_num = 1; } - ret = send_vhost_slave_message_process_reply(dev, &ctx); + ret = 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); @@ -3444,7 +3444,7 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t qid, bool enable) goto disable; } - 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 = -EFAULT; goto disable; @@ -3453,7 +3453,7 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t qid, bool enable) } else { disable: for (i = q_start; i <= 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 = 40, } VhostUserRequest; -typedef enum VhostUserSlaveRequest { +typedef enum VhostUserBackendRequest { VHOST_USER_BACKEND_NONE = 0, VHOST_USER_BACKEND_IOTLB_MSG = 1, VHOST_USER_BACKEND_CONFIG_CHANGE_MSG = 2, VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG = 3, -} VhostUserSlaveRequest; +} VhostUserBackendRequest; typedef struct VhostUserMemoryRegion { uint64_t guest_phys_addr; @@ -136,8 +136,8 @@ struct vhost_user_config { 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; #define VHOST_USER_VERSION_MASK 0x3