From nobody Sun Nov 24 14:27:03 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=1722516390; cv=none; d=zohomail.com; s=zohoarc; b=Yc6jZXuCjl09TrBVjqJg0sUGq+PJoDQ6+moK4t1Safqjf2lPErhA2jPirNVVt2VwohKrgLxg1FhgqNz0ylO2vnvQVI08NYEi8HHJzu1o/GBUDKSZLZRExl3gnKjR4vZhgJJIG1N3tAuPo2W5vRgujZWatJolvFI+oKmoaseauA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722516390; 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=qQPQSCLdpGd+ZkKO2i/qo4nGvPM3halWZA8Mlxztrqs=; b=dMlNK9Lp6m1xRNNsAnOO387KY9wi6BeGheXics4v4MJWBcg4Z00CXEszoun5SdYUmYI2WGYfNuGWDGF4Le69mQEvOpS8n6ok+VkKLeJTsSZ8d4eeLCvkTM1+599LKweSk+zDf4NA5qivvGVDCTAadylD8zavfhIu8y+7mGd3CUg= 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 172251639000371.00118323961851; Thu, 1 Aug 2024 05:46:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZVCF-00026T-Kk; Thu, 01 Aug 2024 08:46:19 -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 1sZVC8-0001si-H9 for qemu-devel@nongnu.org; Thu, 01 Aug 2024 08:46:12 -0400 Received: from va-2-32.ptr.blmpb.com ([209.127.231.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sZVC2-0004wr-MY for qemu-devel@nongnu.org; Thu, 01 Aug 2024 08:46:12 -0400 Received: from localhost.localdomain ([124.64.23.165]) by smtp.feishu.cn with ESMTPS; Thu, 01 Aug 2024 20:45:56 +0800 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=dayudpu-com.20200927.dkim.feishu.cn; t=1722516357; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=qQPQSCLdpGd+ZkKO2i/qo4nGvPM3halWZA8Mlxztrqs=; b=esnkDK2tjlps1IQGEHGwTnbENCzXKeMbuOqSAZytcHHO0izv9qR3LeIdQM3x5AjYHQtrt9 SJHrOIy7TBAC/NBy4ymOTUONMBUlCn667zV9cLJIdd5JLgq1kXpMA/DJszIWq8QlF3Hx1d p5Fav1uQdxz2lg4tpjQpl5rIFhJR2qM250dpMyseSIrG5WfixVSepRTSZZylHbyhigFQb5 AwqR4n0dmZzvE/YBeg+C+LEDITVqLt//uPEOwQv6M9jWi7Vw8XPsXM4bsGcGLRnORJ+MJE yhhVioC5j8LgT4iNRU3fbDPAzGFus8I8rDyOfyZf4CrXipLpwahwqdD8YRuDaw== To: Subject: [PATCH v3] vhost-user: Do not wait for reply for not sent VHOST_USER_SET_LOG_BASE Content-Transfer-Encoding: quoted-printable Message-Id: <20240801124540.38774-1-xiangwencheng@dayudpu.com> X-Mailer: git-send-email 2.30.0 Date: Thu, 1 Aug 2024 20:45:40 +0800 Cc: , "BillXiang" From: "BillXiang" Mime-Version: 1.0 X-Original-From: xiangwencheng@dayudpu.com X-Lms-Return-Path: 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.231.32; envelope-from=xiangwencheng@dayudpu.com; helo=va-2-32.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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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: 1722516391912116600 Content-Type: text/plain; charset="utf-8" From: BillXiang Currently, we have added VHOST_USER_SET_LOG_BASE to=20 vhost_user_per_device_request in commit 7c211eb078c4=20 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests"= ),=20 as a result, VHOST_USER_SET_LOG_BASE will be sent only once=20 when 'vq_index =3D=3D 0'. In this patch we add the check of 'vq_index =3D=3D 0' before=20 vhost_user_read, such that we do not wait for reply for not sent VHOST_USER_SET_LOG_BASE. Signed-off-by: BillXiang --- hw/virtio/vhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 00561daa06..fd12992d15 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -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 && (dev->vq_index =3D=3D 0)) { msg.hdr.size =3D 0; ret =3D vhost_user_read(dev, &msg); if (ret < 0) { --=20 2.30.0