From nobody Tue Nov 11 04:58:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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=1561110368; cv=none; d=zoho.com; s=zohoarc; b=gAhvRnH3+wikgoxDX8pb9Bx+PyLNk/GzOKaDeyq8pDOcaUQ7DL+p1185cqF859LArQgrVQvZ/Q4lontGzQa+sTMRZj5x62PiDICJYGJFkZX4jN/o9/VrsN2nzyKRPG61cjeEU5RQVNhN2oUnMmfYjpgF9XS+kn4H5FWtOUDuhPk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561110368; h=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:ARC-Authentication-Results; bh=LsQFUaKhXvX++eTgRso1YX+mQy5XZMfjEm3CmCkt3rg=; b=Xs6srZoUGlDfkYrPWyWf5s/GwZxy22vhpuXnqK8KzmHsbbZG9rboGZT4Lv+tPXNCrrHcJPtOCa4aKUpVmG1yybCZ3U39C4qGYV6d1ggn2FmbuwTmQkcegAyOVurDP48DF24ABiEeCc80lnlGB3+70QMnB3nI/gwLnfE51f0+dCc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1561110368158733.5431287891797; Fri, 21 Jun 2019 02:46:08 -0700 (PDT) Received: from localhost ([::1]:57522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1heG7R-0000bI-5R for importer@patchew.org; Fri, 21 Jun 2019 05:46:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49518) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1heG2O-0004wj-VU for qemu-devel@nongnu.org; Fri, 21 Jun 2019 05:40:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1heG2L-0002Tg-TL for qemu-devel@nongnu.org; Fri, 21 Jun 2019 05:40:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39748) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1heG2L-0002TN-Os for qemu-devel@nongnu.org; Fri, 21 Jun 2019 05:40:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 17FBA30833BE; Fri, 21 Jun 2019 09:40:49 +0000 (UTC) Received: from localhost (ovpn-117-248.ams2.redhat.com [10.36.117.248]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCACE19C4F; Fri, 21 Jun 2019 09:40:39 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 21 Jun 2019 10:40:04 +0100 Message-Id: <20190621094005.4134-4-stefanha@redhat.com> In-Reply-To: <20190621094005.4134-1-stefanha@redhat.com> References: <20190621094005.4134-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 21 Jun 2019 09:40:49 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/4] libvhost-user: implement VHOST_USER_PROTOCOL_F_MQ 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: "Michael S. Tsirkin" , "Dr. David Alan Gilbert" , Sebastien Boeuf , Gerd Hoffmann , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Existing vhost-user device backends, including vhost-user-scsi and vhost-user-blk, support multiqueue but libvhost-user currently does not advertise this. VHOST_USER_PROTOCOL_F_MQ enables the VHOST_USER_GET_QUEUE_NUM request needed for a vhost-user master to query the number of queues. For example, QEMU's vhost-user-net master depends on VHOST_USER_PROTOCOL_F_MQ for multiqueue. If you're wondering how any device backend with more than one virtqueue functions today, it's because device types with a fixed number of virtqueues do not require querying the number of queues. Therefore the vhost-user master for vhost-user-input with 2 virtqueues, for example, doesn't actually depend on VHOST_USER_PROTOCOL_F_MQ. It just enables virtqueues 0 and 1 without asking. Let there be multiqueue! Suggested-by: Sebastien Boeuf Signed-off-by: Stefan Hajnoczi Reviewed-by: Marc-Andr=C3=A9 Lureau --- contrib/libvhost-user/libvhost-user.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/= libvhost-user.c index 0c88431e8f..312c54f260 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -1160,7 +1160,8 @@ vu_set_vring_err_exec(VuDev *dev, VhostUserMsg *vmsg) static bool vu_get_protocol_features_exec(VuDev *dev, VhostUserMsg *vmsg) { - uint64_t features =3D 1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD | + 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_HOST_NOTIFIER | 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD; @@ -1200,8 +1201,8 @@ vu_set_protocol_features_exec(VuDev *dev, VhostUserMs= g *vmsg) static bool vu_get_queue_num_exec(VuDev *dev, VhostUserMsg *vmsg) { - DPRINT("Function %s() not implemented yet.\n", __func__); - return false; + vmsg_set_reply_u64(vmsg, dev->max_queues); + return true; } =20 static bool --=20 2.21.0