From nobody Sun Nov 24 12:11:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1722786667; cv=none; d=zohomail.com; s=zohoarc; b=Tm1PXDgeHwAwq1Qoy0IrXQIe81jf3omc0glBtT151+ndA93WZBsmz4A98b+kROPPx9PipuQfOq14prqKdqlyhDsS0BKYH4LnseUi7K5LeZjLjhqJ+rW5tcSwof9igo0A0aAFWNqFb3fBiI1UfO1jLqpqx0BpIQiT4kUrSFnvukE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722786667; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5wMP4WTzU0xCZQ55XMOPYDIvPMxtBsKQOe0XlHntDvA=; b=a5ePIDWzcn39/0WeLA7c6omRfqNm0Vuo+Sh811Lc09162UWU5X/t90R+u8ke+WkyCKXONxEUHRBVEPSUL/dBSr4XaKq55ebSeqRP7NUzbx3eTim0ZI0N6nFbtsPzoO2YQSMs8yLYfMnJ+6rid7f2BY0C29bZOy17tu9zouKPqIM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722786667116453.51223424132183; Sun, 4 Aug 2024 08:51:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sadV0-0001fx-1z; Sun, 04 Aug 2024 11:50:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sadUx-0001f0-NY for qemu-devel@nongnu.org; Sun, 04 Aug 2024 11:50:19 -0400 Received: from mail-oa1-x41.google.com ([2001:4860:4864:20::41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sadUw-0006Zh-6X for qemu-devel@nongnu.org; Sun, 04 Aug 2024 11:50:19 -0400 Received: by mail-oa1-x41.google.com with SMTP id 586e51a60fabf-25e3d8d9f70so5931451fac.2 for ; Sun, 04 Aug 2024 08:50:17 -0700 (PDT) Received: from localhost.localdomain ([223.104.134.101]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7106ed30840sm4056724b3a.210.2024.08.04.08.50.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 08:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722786616; x=1723391416; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5wMP4WTzU0xCZQ55XMOPYDIvPMxtBsKQOe0XlHntDvA=; b=G0bHL0j4zIW5R2hXhwQqo+Qefu44KzozAWH8jtyoVtWgs9sJ+MLEzLfdOa8/nNnqTm FVJmHYRjFckczLT1QtSUjBT6/cjoXh+Xqj0xy+sHwhlFK0hgtQJqVdCxSo/TURD6ML3Q 04VO0dBaFxiapYf8CMEs9YqeoTnvLiX1jYZFTTNxNrhKaDeL3s+q+7S84l1APvAE7r3L BfHrx4kEJZuyYrztueXHSyeRPbR6Y+F/+L1BGBSt9hiKZpP02EBEn6oRtKSz0CfCw8M1 PPGQIOsZzlvb36NMMxLaU2s+cfiVcgDbx+TV7OWWf/ngrlZk9AFR68TeK0U24WFJnyat g58g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722786616; x=1723391416; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5wMP4WTzU0xCZQ55XMOPYDIvPMxtBsKQOe0XlHntDvA=; b=EV5wI1hAfuzyrpp06XH7aBaQC3OGVdMbYW/k+JHAdLD7LqDY3CxhUUj/4uTuBe5prM +1hgU+hR5APsokyD2aU4dp7MtAmVtDVMij4Wnm7DyhWPnlQoM6GwFCcPiAMabjq/HYFD bEAC74JjQ+HU4Gmx4YtIP0pp/0xjKtijOn/MrZHkruGne4+eHtvxTei8ghSTzaPukacg JM/Dp9lJnKJKXdSzFQE4vFBUN9GBHkvYvAr1lDO+brC2NUPu4tjRXqWMPIHLTx5kz53+ TC9WcBnrsQMFoNaaJkZNaCLTOzOm82FMRQgMPBIHnkja9608pn5ho0bxa2/HNwQcBDEI YS0A== X-Gm-Message-State: AOJu0YwJ32jEvLwXNwdYhVbWxh7zJF5w8GBaMnzi9YaUtMYNCoBsooDJ JPe6Rum+cJBTtjbkiyP7t+h8p1U5dxThW9QNKi5gfypundJVep2IpgtDES914Ic= X-Google-Smtp-Source: AGHT+IEKlrZ/vD3R2AUzU0t8bCw+QNJXUwilfniBvHhX5mCBt+3C090cXHOyVhxigZ2Jcpawf+unEQ== X-Received: by 2002:a05:6871:5a16:b0:268:ada1:5eba with SMTP id 586e51a60fabf-268ada172bdmr5509176fac.19.1722786616504; Sun, 04 Aug 2024 08:50:16 -0700 (PDT) From: luzhixing12345 To: qemu-devel@nongnu.org Cc: luzhixing12345 , "Michael S. Tsirkin" , Stefano Garzarella Subject: [PATCH] vhost-user: add NEED_REPLY flag Date: Sun, 4 Aug 2024 23:48:59 +0800 Message-Id: <20240804154859.28342-1-luzhixing12345@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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=2001:4860:4864:20::41; envelope-from=luzhixing12345@gmail.com; helo=mail-oa1-x41.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1722786668778116600 Content-Type: text/plain; charset="utf-8" Front-end message requests which need reply should set NEED_REPLY_MASK in flag, and response from slave need clear NEED_REPLY_MASK flag. --- hw/virtio/vhost-user.c | 2 +- subprojects/libvhost-user/libvhost-user.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 00561daa06..edf2271e0a 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1082,7 +1082,7 @@ static int vhost_user_get_u64(struct vhost_dev *dev, = int request, uint64_t *u64) int ret; VhostUserMsg msg =3D { .hdr.request =3D request, - .hdr.flags =3D VHOST_USER_VERSION, + .hdr.flags =3D VHOST_USER_VERSION | VHOST_USER_NEED_REPLY_MASK, }; =20 if (vhost_user_per_device_request(request) && dev->vq_index !=3D 0) { diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvho= st-user/libvhost-user.c index 9c630c2170..40f665bd7f 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -667,6 +667,7 @@ vu_send_reply(VuDev *dev, int conn_fd, VhostUserMsg *vm= sg) { /* Set the version in the flags when sending the reply */ vmsg->flags &=3D ~VHOST_USER_VERSION_MASK; + vmsg->flags &=3D ~VHOST_USER_NEED_REPLY_MASK; vmsg->flags |=3D VHOST_USER_VERSION; vmsg->flags |=3D VHOST_USER_REPLY_MASK; =20 --=20 2.34.1