From nobody Sun Nov 24 19:36:25 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 ARC-Seal: i=1; a=rsa-sha256; t=1720414466; cv=none; d=zohomail.com; s=zohoarc; b=cPoTJVFSh/uyD7AvGc3eCxlEUwP3ZmSfy9x1o8bk6VBTPoB2P3AEiamQDL80QyOGwHGRjm4BJVKbSFowha2B2avtDQPlZbGTqPvgrFwnMH5Dm0d5QRw9eP9GdKyI232p+E/noCAAuu/dNzE+Kllh94u8zXhjr3xzL6ccNCxiT6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720414466; h=Content-Type: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=IjebSU2V/HBvnzPP+7/jsXjfRTnXczB2Xne9UyY+2iE=; b=jsgkpzHLkzbk33r6GL26tyvrcTIbg1Fp4GqzUNsm1aayM/sGiaVVfRf8p+Rrsn4A6TuAUkTOBYY6E0PXMXyXKyoRUVg0RuBua5YAta9v8/TBOfbRr+N52Z8BN8Gwbm3g605C75k8h7Q7+CdO5do28pg52lgzlQTYEHp6lVrHYl0= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720414466206978.5164418528834; Sun, 7 Jul 2024 21:54:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQgNv-0002aX-Kb; Mon, 08 Jul 2024 00:53:55 -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 1sQgNs-0002Zv-N5 for qemu-devel@nongnu.org; Mon, 08 Jul 2024 00:53:52 -0400 Received: from va-1-19.ptr.blmpb.com ([209.127.230.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sQgNo-00061u-LV for qemu-devel@nongnu.org; Mon, 08 Jul 2024 00:53:52 -0400 Received: from localhost.localdomain ([221.216.117.144]) by smtp.feishu.cn with ESMTPS; Mon, 08 Jul 2024 12:53:32 +0800 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=dayudpu-com.20200927.dkim.feishu.cn; t=1720414413; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=IjebSU2V/HBvnzPP+7/jsXjfRTnXczB2Xne9UyY+2iE=; b=q7UVTbLtu4syFkWqZIPRo/tVWai/zAiZ//oT8K4GZK+myry5/RLCK8OYJVkS2ukMMtqoea 8WAHnex/iKqLqJR6rr0NMPNhGpAuVmrykgK+7yFvxVUcVMSq3iCxXCSIdAuLmndXhsQ4aB 7q1OWmvnwa7rLeP9gnOx5OjwEjobCsaWJXEITDp9LF9d0WRnnRhBLBRv4DXpF6b96OZGeH PpcgAW3x7Dit3XmEAHw9uOGmFh3i4pNB25PJQWUUssA3gQY8ilYFFWO8RFG+56JgMfFwAt HKADhtwYKnFLUBjk0UaLDftf6eBQyKzfWD5GxCBRRZaibj2UM1fsBKVw89wqHQ== X-Mailer: git-send-email 2.30.0 To: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [PATCH] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE X-Lms-Return-Path: Date: Mon, 8 Jul 2024 12:50:54 +0800 Message-Id: <20240708045054.65040-1-xiangwencheng@dayudpu.com> Cc: , , "BillXiang" From: "BillXiang" X-Original-From: xiangwencheng@dayudpu.com 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=209.127.230.19; envelope-from=xiangwencheng@dayudpu.com; helo=va-1-19.ptr.blmpb.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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 @dayudpu-com.20200927.dkim.feishu.cn) X-ZM-MESSAGEID: 1720414467539100001 Content-Type: text/plain; charset="utf-8" From: BillXiang Hello, there are some code that must be added to my last commit 7c211eb078c42146ee9a441cc028fbc4c378ef5a of 'Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests'. We can not wait for replies from those duplicated VHOST_USER_SET_LOG_BASE t= hat not really sent. Signed-off-by: BillXiang --- hw/virtio/vhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 00561daa06..8451d9019a 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -440,7 +440,7 @@ static int vhost_user_set_log_base(struct vhost_dev *de= v, uint64_t base, int ret; VhostUserMsg msg =3D { .hdr.request =3D VHOST_USER_SET_LOG_BASE, - .hdr.flags =3D VHOST_USER_VERSION, + .hdr.flags =3D VHOST_USER_VERSION | VHOST_USER_NEED_REPLY_MASK, .payload.log.mmap_size =3D log->size * sizeof(*(log->log)), .payload.log.mmap_offset =3D 0, .hdr.size =3D sizeof(msg.payload.log), @@ -460,7 +460,7 @@ static int vhost_user_set_log_base(struct vhost_dev *de= v, uint64_t base, return ret; } =20 - if (shmfd) { + if (shmfd && (msg.hdr.flags & VHOST_USER_NEED_REPLY_MASK)) { msg.hdr.size =3D 0; ret =3D vhost_user_read(dev, &msg); if (ret < 0) { --=20 2.30.0