From nobody Mon Feb 9 18:45:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615459028; cv=none; d=zohomail.com; s=zohoarc; b=imxP2jezR5ZJowd0xCa/50rX0pVo4+xPdBnuXUhLReybDQGN90nZrmAKWvQA7RxPIHW7GXHhe+WJHADScSEsOnhyvrAhmoIz6iuHdaA1mHOzeK630zUp0XXTkHsTL0DtfneATnLEomPArtu3vwnQFwtrNbGX/cMkGahmaO3Se1o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615459028; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ee/ei1R0l+B+WJ02Vfu6Jfsbjt7pu4p5m+kBDVjIUsI=; b=AC5G0sKXeeiYLF517uXcENAxQ5hVUGQGNznabXQUdKEJiuMLbTht/pvCYA8felwrr8CXW/PXDYG1SdlhFRiLSfC6nCxWz8j+/Vgwmi9Uuut6o0RZlUyqWnzST/LYH/yiXoiF93hkV+IJSEjB3y13WFEsZt8FARUawAjR5IxBqvg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615459028430155.51448312733726; Thu, 11 Mar 2021 02:37:08 -0800 (PST) Received: from localhost ([::1]:50688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKIgl-0000jC-D8 for importer@patchew.org; Thu, 11 Mar 2021 05:37:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKIcw-0002a2-Im for qemu-devel@nongnu.org; Thu, 11 Mar 2021 05:33:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:45315) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lKIcu-0005gV-Kn for qemu-devel@nongnu.org; Thu, 11 Mar 2021 05:33:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-362-k5_VQ9dKPyaJQiSwo0ekUA-1; Thu, 11 Mar 2021 05:33:05 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7A1E10866A5 for ; Thu, 11 Mar 2021 10:33:04 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81E951B5AD; Thu, 11 Mar 2021 10:33:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615458787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ee/ei1R0l+B+WJ02Vfu6Jfsbjt7pu4p5m+kBDVjIUsI=; b=TGAm0DGU2xbXzuFRjRNLzka3ig2s8B1Lx0j7qLIaj2g5O3p0z0z0H3KdHhfs0JWjQEUw5C BHZsvhmDmkaGStkdaY31dDRlrJPaFtwQR1XEb9CKCsA9pDEVcdFhJBRn9ZazZ5z8c26U16 iregThmLfxhtBR428bkEroATQWjMcvU= X-MC-Unique: k5_VQ9dKPyaJQiSwo0ekUA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 6/7] libvhost-user: rename message names from "SLAVE" to "BACKEND" Date: Thu, 11 Mar 2021 05:32:49 -0500 Message-Id: <20210311103250.532191-7-pbonzini@redhat.com> In-Reply-To: <20210311103250.532191-1-pbonzini@redhat.com> References: <20210311103250.532191-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.243, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UPPERCASE_50_75=0.008 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, stefanha@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Follow the terminology that is used in the specification. The old names are preserved for API compatibility. Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/libvhost-user.c | 20 ++++++------ subprojects/libvhost-user/libvhost-user.h | 39 ++++++++++++++++------- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvho= st-user/libvhost-user.c index fab7ca17ee..b7aef17e4e 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -125,7 +125,7 @@ vu_request_to_string(unsigned int req) REQ(VHOST_USER_SET_VRING_ENABLE), REQ(VHOST_USER_SEND_RARP), REQ(VHOST_USER_NET_SET_MTU), - REQ(VHOST_USER_SET_SLAVE_REQ_FD), + REQ(VHOST_USER_SET_BACKEND_REQ_FD), REQ(VHOST_USER_IOTLB_MSG), REQ(VHOST_USER_SET_VRING_ENDIAN), REQ(VHOST_USER_GET_CONFIG), @@ -1313,7 +1313,7 @@ bool vu_set_queue_host_notifier(VuDev *dev, VuVirtq *= vq, int fd, int qidx =3D vq - dev->vq; int fd_num =3D 0; VhostUserMsg vmsg =3D { - .request =3D VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG, + .request =3D VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG, .flags =3D VHOST_USER_VERSION | VHOST_USER_NEED_REPLY_MASK, .size =3D sizeof(vmsg.payload.area), .payload.area =3D { @@ -1331,7 +1331,7 @@ bool vu_set_queue_host_notifier(VuDev *dev, VuVirtq *= vq, int fd, =20 vmsg.fd_num =3D fd_num; =20 - if (!vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD)= ) { + if (!vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_BACKEND_SEND_F= D)) { return false; } =20 @@ -1409,9 +1409,9 @@ vu_get_protocol_features_exec(VuDev *dev, VhostUserMs= g *vmsg) */ uint64_t features =3D 1ULL << VHOST_USER_PROTOCOL_F_MQ | 1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD | - 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ | + 1ULL << VHOST_USER_PROTOCOL_F_BACKEND_REQ | 1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER | - 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD | + 1ULL << VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD | 1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK | 1ULL << VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS; =20 @@ -1442,7 +1442,7 @@ vu_set_protocol_features_exec(VuDev *dev, VhostUserMs= g *vmsg) =20 if (vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS= ) && - (!vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_SLAVE_REQ) || + (!vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_BACKEND_REQ) = || !vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_REPLY_ACK))) { /* * The use case for using messages for kick/call is simulation, to= make @@ -1455,7 +1455,7 @@ vu_set_protocol_features_exec(VuDev *dev, VhostUserMs= g *vmsg) * that actually enables the simulation case. */ vu_panic(dev, - "F_IN_BAND_NOTIFICATIONS requires F_SLAVE_REQ && F_REPLY_= ACK"); + "F_IN_BAND_NOTIFICATIONS requires F_BACKEND_REQ && F_REPL= Y_ACK"); return false; } =20 @@ -1864,7 +1864,7 @@ vu_process_message(VuDev *dev, VhostUserMsg *vmsg) return vu_get_queue_num_exec(dev, vmsg); case VHOST_USER_SET_VRING_ENABLE: return vu_set_vring_enable_exec(dev, vmsg); - case VHOST_USER_SET_SLAVE_REQ_FD: + case VHOST_USER_SET_BACKEND_REQ_FD: return vu_set_slave_req_fd(dev, vmsg); case VHOST_USER_GET_CONFIG: return vu_get_config(dev, vmsg); @@ -2370,9 +2370,9 @@ static void _vu_queue_notify(VuDev *dev, VuVirtq *vq,= bool sync) if (vq->call_fd < 0 && vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS= ) && - vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_SLAVE_REQ)) { + vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_BACKEND_REQ)) { VhostUserMsg vmsg =3D { - .request =3D VHOST_USER_SLAVE_VRING_CALL, + .request =3D VHOST_USER_BACKEND_VRING_CALL, .flags =3D VHOST_USER_VERSION, .size =3D sizeof(vmsg.payload.state), .payload.state =3D { diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvho= st-user/libvhost-user.h index 3d13dfadde..eba3e1fc05 100644 --- a/subprojects/libvhost-user/libvhost-user.h +++ b/subprojects/libvhost-user/libvhost-user.h @@ -54,18 +54,20 @@ enum VhostUserProtocolFeature { VHOST_USER_PROTOCOL_F_RARP =3D 2, VHOST_USER_PROTOCOL_F_REPLY_ACK =3D 3, VHOST_USER_PROTOCOL_F_NET_MTU =3D 4, - VHOST_USER_PROTOCOL_F_SLAVE_REQ =3D 5, + VHOST_USER_PROTOCOL_F_BACKEND_REQ =3D 5, VHOST_USER_PROTOCOL_F_CROSS_ENDIAN =3D 6, VHOST_USER_PROTOCOL_F_CRYPTO_SESSION =3D 7, VHOST_USER_PROTOCOL_F_PAGEFAULT =3D 8, VHOST_USER_PROTOCOL_F_CONFIG =3D 9, - VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD =3D 10, + VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD =3D 10, VHOST_USER_PROTOCOL_F_HOST_NOTIFIER =3D 11, VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD =3D 12, VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS =3D 14, VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS =3D 15, + VHOST_USER_PROTOCOL_F_MAX, =20 - VHOST_USER_PROTOCOL_F_MAX + VHOST_USER_PROTOCOL_F_SLAVE_REQ =3D VHOST_USER_PROTOCOL_F_BACKEND_REQ, + VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD =3D VHOST_USER_PROTOCOL_F_BACKEND_= SEND_FD }; =20 #define VHOST_USER_PROTOCOL_FEATURE_MASK ((1 << VHOST_USER_PROTOCOL_F_MAX)= - 1) @@ -92,7 +94,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_BACKEND_REQ_FD =3D 21, VHOST_USER_IOTLB_MSG =3D 22, VHOST_USER_SET_VRING_ENDIAN =3D 23, VHOST_USER_GET_CONFIG =3D 24, @@ -109,16 +111,29 @@ typedef enum VhostUserRequest { VHOST_USER_GET_MAX_MEM_SLOTS =3D 36, VHOST_USER_ADD_MEM_REG =3D 37, VHOST_USER_REM_MEM_REG =3D 38, - VHOST_USER_MAX + VHOST_USER_MAX, + + VHOST_USER_SET_SLAVE_REQ_FD =3D VHOST_USER_SET_BACKEND_REQ_FD, } VhostUserRequest; =20 +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, + VHOST_USER_BACKEND_VRING_CALL =3D 4, + VHOST_USER_BACKEND_VRING_ERR =3D 5, + VHOST_USER_BACKEND_MAX +} VhostUserBackendRequest; + + 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_VRING_CALL =3D 4, - VHOST_USER_SLAVE_VRING_ERR =3D 5, + VHOST_USER_SLAVE_NONE =3D VHOST_USER_BACKEND_NONE, + VHOST_USER_SLAVE_IOTLB_MSG =3D VHOST_USER_BACKEND_IOTLB_MSG, + VHOST_USER_SLAVE_CONFIG_CHANGE_MSG =3D VHOST_USER_BACKEND_CONFIG_CHANG= E_MSG, + VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG =3D VHOST_USER_BACKEND_VRING_= HOST_NOTIFIER_MSG, + VHOST_USER_SLAVE_VRING_CALL =3D VHOST_USER_BACKEND_VRING_CALL, + VHOST_USER_SLAVE_VRING_ERR =3D VHOST_USER_BACKEND_VRING_ERR, VHOST_USER_SLAVE_MAX } VhostUserSlaveRequest; =20 @@ -295,7 +310,7 @@ typedef struct VuVirtqInflight { uint16_t version; =20 /* The size of VuDescStateSplit array. It's equal to the virtqueue - * size. Slave could get it from queue size field of VhostUserInflight= . */ + * size. The backend could get it from queue size field of VhostUserIn= flight. */ uint16_t desc_num; =20 /* The head of list that track the last batch of used descriptors. */ --=20 2.26.2