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 C239341E34; Thu, 9 Mar 2023 03:07:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F1E240ED7; Thu, 9 Mar 2023 03:07:44 +0100 (CET) Received: from corp-ob07.yahoo-corp.jp (corp-ob07.yahoo-corp.jp [183.79.94.94]) by mails.dpdk.org (Postfix) with ESMTP id 730E1410EE for ; Thu, 9 Mar 2023 03:07:42 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01lp2177.outbound.protection.outlook.com [104.47.23.177]) by corp-ob07.yahoo-corp.jp (Postfix) with ESMTPS id 20CE619FB187; Thu, 9 Mar 2023 11:07:41 +0900 (JST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JB54cr5t5HQMowUtPRzqht9HXOBo/4PwWRn73eGigwX0znCN2WSMt0nkZ7c5Wx2ZzaUfD06SCHgQ55yV3/oReW/UQgIhzTBHtzp25hDPSgIVgLzWwhBhDUnK4xVrzh/4xMb5g3sCR/aJ8BAinlgs5FiLPdyo4LnhalniGgbDzQ57i1pJ92WvltE73MvtxvWXYq7eK7BLR6Zot2ArnnNxXng3LvPBROlPT6AuCKwMen8gpB3yHeUpymTsjsJIu63ldvKtyRLH8FoWjSYPt4xl8bNIHMBhdRipm8QNaQ6getRJmGtLyw6tRorq6Va5nGjKpwAK+YgvSKv69HKBka5Yrg== 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=90Ak4xau+rtlgLsW1hDPH4y9nE9FRfAX5xwLC7kHA3Q=; b=XsyIHsUhJw7360OOqxM17nG8N0sKqCe85YErtIqxJentPXdFKi6NPKMeeVqhY6mG+GJ8My7alifP4aYnkUqsQWZG/dvtACcI82+leeNW7WREK+PITz8GnQL7efaLaDIiC1WoSCywDWT4xdJ1y01OHD8w1qUzUKGjZt8pCNLnK1ORGLzNQbPos3RA27yRyVxrN646PN0MWj6miTlm9e+6fJZNrqQmBmx/V3gf4ygOXzjiigVVaBrcoYFBnhai6vQCBkepub8gIeW4L7o0aJV6rGDZMrtD+EuW1mCS5KxiojXA0ceTiVXSuXkwku3zbSfDnQihHJtHmitwDETbHr5RpQ== 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=90Ak4xau+rtlgLsW1hDPH4y9nE9FRfAX5xwLC7kHA3Q=; b=KYQEZzqEfZTCQdMMQfIzBoeqJbbAKI0UUscEsBni6G/p+EmHMocs6DEVggQYLs8+EDWL0tzjb7UPV8Pon0rL7N6/UvRA020SBSwWXIMctEowPYYPMnCs315PIQ40mLt//dICUS/8Yu0RHB1+PV9xHwb+cx11OZ0ePeaUFJhBum8= 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 OS3PR01MB9914.jpnprd01.prod.outlook.com (2603:1096:604:1ee::12) 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 02:07:39 +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 02:07:39 +0000 From: Nobuhiro MIKI To: maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: dev@dpdk.org, Nobuhiro MIKI Subject: [PATCH 2/2] vhost: refactor to follow new naming convention Date: Thu, 9 Mar 2023 11:07:21 +0900 Message-Id: <20230309020721.22164-3-nmiki@yahoo-corp.jp> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230309020721.22164-1-nmiki@yahoo-corp.jp> References: <20230309020721.22164-1-nmiki@yahoo-corp.jp> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYAPR01CA0080.jpnprd01.prod.outlook.com (2603:1096:404:2c::20) To TY2PR01MB4107.jpnprd01.prod.outlook.com (2603:1096:404:d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY2PR01MB4107:EE_|OS3PR01MB9914:EE_ X-MS-Office365-Filtering-Correlation-Id: 6114486d-4494-4a0b-97d9-08db20430f1e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qCxJ4r0y1HcATqvNksWXSMrSXmnfvXzE75zKY9fMZ9KjoN2rLLvMnCRg3PXBm4HKW08a3nUxoSSa716OYZLhpdTW6JK1C2XcDyI8h/6GexMIcZwl8DtXwegu+TH0qMtJt1mIUvxc5mZ/uVuW1jM8MJQlqEWk+ek0KYv96iMpJ7FA5WECT4r0EPpA7bNGntmnE3Wom6hgyS4Yn42ZckLeXwE7f2yKeniRIQizBdU/lRv8AvBv3ht7xste63OUWAsaI7LL4enxxE8HAoi7roQgQjM0wpauI9Azm0Ekvml3QucchRIJh5RSqFezInclbveozTU4Fi4hiwJ+tUvpJxb8nuNvfA6ebqqSVf++Hr/7jwLCzlt1N9kOW+hQDV1j0nk1caFvSyn1+nfmcRVTUbvjvFzA18NeIym0zRLreBM2xBPII8CW24ecygQGVi4rMG7fA928BZaIXvUd5X6WTIRd3Vdv7EXQrajKMwWQzSzqhfPe+dBaMEiafVFn6C4EjZxedFifMuEXv87nKOJ/9/qJm9dxBuHmygQcVZRYnP3LFKA4flmxsCxBFZuFt9Aq/hckIqP1gHxZeo0PQbF3R6gi5MD1XR6oL08lym0p3QPPTysQGscVI1N9ICU0/pc1mBm8zZS+hV9BS9iE83yVJRF8RMUlmC6jWskLJm+aRce6TRT7dd9c9lGozcZvbp+lzwd6VX/GdNrP3TV4gKQ9XJMvRNqULW5Ln7DWq1z4Rv1n3x+BF4Wa45bDOGqmE+QkSUYC 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)(39860400002)(366004)(346002)(136003)(396003)(376002)(451199018)(107886003)(6666004)(2616005)(4326008)(8676002)(66946007)(66556008)(66476007)(86362001)(6486002)(52116002)(5660300002)(316002)(36756003)(38350700002)(2906002)(38100700002)(83380400001)(82960400001)(8936002)(186003)(41300700001)(478600001)(1076003)(6506007)(6512007)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?EVDGNyDMeJNhQVzKIW7ZoFJgIAz0asMlbW/3xk7CdVjtob5OsdPs3Y/M+Wjx?= =?us-ascii?Q?U2cdRRe1UWhaVfv3yYCoZJPzdtXHzPsk/+Oy1E2tImiwLMXTWc8+wCm5f7dF?= =?us-ascii?Q?GRAj6XjlBF4ZA2WyrCC5y7u817VBzU/9SK1+eHImhZ6oP5C6l1DQrW8ZRKwT?= =?us-ascii?Q?gEo9BMNblELCxgsyq+v9+PR4RdiysULrsRDz9c7UqXSATixqB8f7djq11QaZ?= =?us-ascii?Q?yVvbpHsM7gYkiGDA/p+BDUOOSXaXebu9BNMbyoNBJPjGkVrfbzfTOxylj2P+?= =?us-ascii?Q?A5p8nPZ24H2oDju6hAqY9685swIHlNiIE2XU/f5ajTyG1iUUSaBmlz0W780M?= =?us-ascii?Q?KeNLhswpyZrLxfaeLBoqilkav2JvhcIwnzdi1DWV+xqrlLQAYLSQ8hpgCd2m?= =?us-ascii?Q?bsrIagkAzytsWqmdwFFK2rL02/+h8XBcFPs/suTsAo1KEsVOsuGL/6eXgObY?= =?us-ascii?Q?rx29KLva2LwOo3d+fBMS12Or+pUgRSQn9+poV+9nLwfzmYJJgD6iE8htRDkj?= =?us-ascii?Q?j/bU2nqqpTaFsHwUblnICOZuCKBpV+gBv2SFzGPuHC7LbuHzleFN52p0Cufp?= =?us-ascii?Q?jVkfUo8PVQsR2jyegM3JLqtu8MNH+eub43xoqQW31604DqZ8xM1rJlSSaUDh?= =?us-ascii?Q?2WR5E0ifNs6c1hW76q1TCCc12x0BFTfR3i7W9dqnM4vawhQxosN86Xx/u8aH?= =?us-ascii?Q?cIyw6MUGEvaxvIRT8C/BHO3uqh17sRlQYHe+6KVfvN/7AZ34VcEcya66amrv?= =?us-ascii?Q?ELCUrm+Eet1SC696HT9QhtMREF9jNv9c+/J2SmF0z7UJCqyROkO0u9G+q8q1?= =?us-ascii?Q?qel+gW1kN2SbDlzQ0OZYYBgD3ggFxQ95AgH7RtXRPNbw+2ZQDXfZGpoZl560?= =?us-ascii?Q?fwYx8fP/pXdI529xCImYVN7wBtHtj2mac7H00G9NQGcAIxNZnER0t6ST8Xie?= =?us-ascii?Q?Y7FpF4Xg+bWV8eBA6uBb2dHmdHKkeikoQbjtuWZc3NWLcWBEbMcGUK67Gh3G?= =?us-ascii?Q?s52kI+dUWzTcxaVTAQm01LTZuMVk3gWta18iPcLcR38a1WyQK9j4WbVIe5tL?= =?us-ascii?Q?NO9DMHDeRJUu1BiNZcvb+6lPlgnrXGTqhMwlp+pMWgIMhpzbyULjZBjDRxf0?= =?us-ascii?Q?v/n4hlaF0SmrSz3tuApRcIWO9zsP471JcIcxwJ95fxPcp6HF4PuRjE87DvQq?= =?us-ascii?Q?P8JWEPscGSSvS7kNP3I6xB/hB2c2E1NWipjTDn8Yy+Xa1v/bUNWnq24PG+a1?= =?us-ascii?Q?xK+FPM7rM8Je8B1PyyE9NJARdwDLmH+V7slkoGsEJTItY49zaLgO2Cmz4SdS?= =?us-ascii?Q?vbqCYkvQmHheI6hkGrYWefNNs6fEFypjjvCAKhLuOQrprKl+K6ZAgPKpJK8F?= =?us-ascii?Q?Anuex7lfZXCdatC5zvMehEOEJSJzZtzvMvYgOdOOvnkAxQGYM5QYUhTQ7uCK?= =?us-ascii?Q?I2/VCVmIGARRvhoiCoURln9iHI+2/EI97Z2i88c0nSyHYI6BmlYtlTzh3MVr?= =?us-ascii?Q?613//3SWsg9fHypO/26swbfKxBDINaA5BdHO/kKTyhKFTya/15zbSylJ7ApC?= =?us-ascii?Q?keSqAd5cauUoY54ytetOz7Iwx1rsdRqufAwQAzX5?= X-OriginatorOrg: yahoo-corp.jp X-MS-Exchange-CrossTenant-Network-Message-Id: 6114486d-4494-4a0b-97d9-08db20430f1e X-MS-Exchange-CrossTenant-AuthSource: TY2PR01MB4107.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 02:07:39.4586 (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: sf15yTkuYkunTqS5rn2CVIS6Q7npZEz5rjk8FFcZha2aKVZg7MYLNrXmRlyDPbgiX0KGJTzteFQiBoVNwP6VRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9914 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 '_slave_' with '_backend_'. Signed-off-by: Nobuhiro MIKI --- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- lib/vhost/rte_vhost.h | 2 +- lib/vhost/version.map | 2 +- lib/vhost/vhost.c | 4 +-- lib/vhost/vhost.h | 4 +-- lib/vhost/vhost_user.c | 62 +++++++++++++++++------------------ lib/vhost/vhost_user.h | 6 ++-- 7 files changed, 41 insertions(+), 41 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..cc2ec99c315c 100644 --- a/lib/vhost/rte_vhost.h +++ b/lib/vhost/rte_vhost.h @@ -1066,7 +1066,7 @@ rte_vhost_get_vdpa_device(int vid); */ __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_user.c b/lib/vhost/vhost_user.c index cd4104ea5ce0..1ce1a5924f74 100644 --- a/lib/vhost/vhost_user.c +++ b/lib/vhost/vhost_user.c @@ -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) { @@ -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; } @@ -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..cd8610129789 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; @@ -137,7 +137,7 @@ struct vhost_user_config { typedef struct VhostUserMsg { union { uint32_t master; /* a VhostUserRequest value */ - uint32_t slave; /* a VhostUserSlaveRequest value*/ + uint32_t backend; /* a VhostUserBackendRequest value*/ } request; #define VHOST_USER_VERSION_MASK 0x3 -- 2.31.1