Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4654923pxv; Tue, 6 Jul 2021 06:16:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiF1N3oQEpJ0Kz4CWJqFNcNXsiJL+898j7bEW6Nl1Y6KR8bXME++rVPG8csD9fZZ0YZkNu X-Received: by 2002:a05:6000:88:: with SMTP id m8mr22003653wrx.222.1625577380738; Tue, 06 Jul 2021 06:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625577380; cv=none; d=google.com; s=arc-20160816; b=vu5Hf2s2NXIuE/D6/+2Nacn/RafL861IF6lWDXpTIN0+HU5z4n4O952LqbY+QQ19Hf PLhA7aek2KAaHrAfNXsGTE5b4fGUPzMHImokHJCP+Htbe55WMuazw26/DEX2pDSk7K+/ iSqrVHA3J6OG7FJj/0J/U+QL2V2COEqwQrIj2uEhzad8jK7zaaLAkYLjxwe9dpdxfZBL aD1gzy3LIRKLmpXZ4rwrCLUu5xouA9LqBJj6SsoKwqg1vT3l1OCHj9BNM/PJwzIs0SoA 42tnKvF6iavbyHS505uYU3KleuhsIrc7qE3Sq2zaVoAoAizRPVIOVrHDnWh32T5nH5mj qJAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=A+vURWiwExzHKQ1zqn329GpoJ8uorhaLWw889D3KLCk=; b=CFp70GiQBs7/nYLBUbr19ylnsmX+TFmJCpd3c2oHPQTyZIelN5nhe49AThfFCazz9x 69RqRpO4Y8dfawenIxvh31btsWXijxDGKAJ1qqYnhrzIHFU422r3xNj3rB0ESwqIemY/ tl4Rj5wMx0PQV2THv6DUl3UPGZPmHHTIJkPHubm2Tzej0izEfjTH4HYLZg23yZanrirM VQ09ZsJMP2A5YBv+3rKtasA3n260bay/EwmSxQpgDAMK9PxmeAfktfdXG8srpeIJ9oE/ TWnz7N/bcmQQIJGOUC7i1ebQS1fuilQMbseMz8SWBpUWRIkm9A3aqoD/uJAkJoWk1mbH LHsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DdhISsDm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id en10si14770214ejc.604.2021.07.06.06.15.57; Tue, 06 Jul 2021 06:16:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DdhISsDm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231640AbhGFNQ7 (ORCPT + 99 others); Tue, 6 Jul 2021 09:16:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57472 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231520AbhGFNQ4 (ORCPT ); Tue, 6 Jul 2021 09:16:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625577257; 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: in-reply-to:in-reply-to:references:references; bh=A+vURWiwExzHKQ1zqn329GpoJ8uorhaLWw889D3KLCk=; b=DdhISsDmqFxYpwO5yBG7fob0cpK7FQ7/65EDlr7eka7+bN/s6kxJk0osoOOH2lk1dyE+Kz mmgk7La+dS9CvanJEN4BsnXlgBRHKBKpLFpxtIbBOXGc0uxmXSu2l6G7jxaeLkoIxvOa1M dB8lhOfreEry1su4Iqzvq7j5/AM7eWw= 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-382-Rm8scm4zMfycpyJd6ld4yQ-1; Tue, 06 Jul 2021 09:14:15 -0400 X-MC-Unique: Rm8scm4zMfycpyJd6ld4yQ-1 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 90CE7824F98; Tue, 6 Jul 2021 13:14:14 +0000 (UTC) Received: from localhost (ovpn-115-23.ams2.redhat.com [10.36.115.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F3BF5DA60; Tue, 6 Jul 2021 13:14:10 +0000 (UTC) Date: Tue, 6 Jul 2021 14:14:09 +0100 From: Stefan Hajnoczi To: Jason Wang Cc: mst@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, netdev@vger.kernel.org, xieyongji@bytedance.com Subject: Re: [PATCH 1/2] vdpa: support per virtqueue max queue size Message-ID: References: <20210705071910.31965-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LaXrVM2vNYxuaCd2" Content-Disposition: inline In-Reply-To: <20210705071910.31965-1-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --LaXrVM2vNYxuaCd2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 05, 2021 at 03:19:09PM +0800, Jason Wang wrote: > Virtio spec allows the device to specify the per virtqueue max queue > size. vDPA needs to adapt to this flexibility. E.g Qemu advertise a > small control virtqueue for virtio-net. >=20 > So this patch adds a index parameter to get_vq_num_max bus operations > for the device to report its per virtqueue max queue size. >=20 > Both VHOST_VDPA_GET_VRING_NUM and VDPA_ATTR_DEV_MAX_VQ_SIZE assume a > global maximum size. So we iterate all the virtqueues to return the > minimal size in this case. Actually, the VHOST_VDPA_GET_VRING_NUM is > not a must for the userspace. Userspace may choose to check the > VHOST_SET_VRING_NUM for proving or validating the maximum virtqueue > size. Anyway, we can invent a per vq version of > VHOST_VDPA_GET_VRING_NUM in the future if it's necessary. >=20 > Signed-off-by: Jason Wang > --- > drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- > drivers/vdpa/vdpa.c | 22 +++++++++++++++++++++- > drivers/vdpa/vdpa_sim/vdpa_sim.c | 2 +- > drivers/vdpa/virtio_pci/vp_vdpa.c | 2 +- > drivers/vhost/vdpa.c | 9 ++++++--- > drivers/virtio/virtio_vdpa.c | 2 +- > include/linux/vdpa.h | 5 ++++- > 8 files changed, 36 insertions(+), 10 deletions(-) Reviewed-by: Stefan Hajnoczi --LaXrVM2vNYxuaCd2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmDkVyEACgkQnKSrs4Gr c8hTKggAp8tSQbbf8/pQa6Bi9ldcTpa4FzjzvITQFELFg45XJ9q4WDx+eNMxRTpe IuvanLQoWiiQL2pYcUZCi/+PCGsj+bu44yJ24Uk9/cIWUbg+s8T+GLMxaNdEP8WO 52McfMT5MK+waHfnbhZ2jaNEGAdo5EVRBIF1Q/7vdg9Lfr0YxRtVuZ6EVuuncW5y jETFKnKb0YdHpbO//gK/a7L6jLJEABTm0QQNK9OZnxnlbEuduUfeu8saUZSdDbWL G/7TR55TF+CFd27T7gTA7WLcQszFk1tg1fTbdnDUpU/588L6Gy5+6CoCb+5+a6Ts vdBRToz2iTg0KTFP/gYhTTQcxq7wmA== =eXQg -----END PGP SIGNATURE----- --LaXrVM2vNYxuaCd2--