Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp171890pxv; Wed, 30 Jun 2021 02:53:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjAzcsFsZ/pT1LIAm4Q/I6h0kOefViipg9gkFWcKqSYNVAIjZKdALc5VJP042TW21pavsI X-Received: by 2002:a05:6638:3d3:: with SMTP id r19mr8250340jaq.78.1625046823239; Wed, 30 Jun 2021 02:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625046823; cv=none; d=google.com; s=arc-20160816; b=0tFtoGueoqOaFdpWZjzY2IaEZpZvW8/AZxLCOK0tA9U+gj7zIZXPgVG4mzSkJUkxIb u0yvUNbn83/sEAiyQCGUma2fvY9g/wvRBm0aMTAF8MDDGkxqhxAGCbzs8d75KO21wmy3 6TU/3ccdxBSOwIdM5sofaoiaEz3zcoqyDhgJne0WleN1NGl8pN9VswIduSkneBhz+kyN pcjzvdOc1oDMmrUB8ZwkDAhz3jRv/eGIO5XBRgpxCE9DiNVqmYHy+NWsza4WcPzlkaR1 047W8pa3Qp2rn4Rf3LOLAjFecp3KwB+bfT+39Q6gDU0AZli3Wm3KGrIIPp2MhMifzOrI rqOw== 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=QLDSo2Z7zKdGrAmZB3cGG4Cv4LLSWVrxocNgHWfsXbw=; b=MCyUcKzX6D+A3LC/Pc85Md5N3oIbxtO2+Y0Z3j53gHpU5Tkpc3yS/jzaBZx0+jMxTV emHejV0QbYrOX4ZbP9KAGcn/P9KA56bTKuJv4zNZzknjhx+UXYNLA/N+GGJo0pIjtF9Q cejWyZNajcEe9ycTpRKNXbHweuRslfvd1+CjprRHivJzs25ubXOYlTGBVHSR/UUtI+A7 MYubXs9r9nyhQsWxKeoim+KwodBLtYuw57PX9sxswJffLu0ro2xzq4KhF1SRrE49AEiz HDWCpx6zpRwTO5wh6+LPJgm6kK8oXOnxfXLTmb2LScNDEmpNQkOvVtf/DsoqSG/RQst+ IIcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O48PEsgZ; 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 f12si19553247iow.49.2021.06.30.02.53.31; Wed, 30 Jun 2021 02:53:43 -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=O48PEsgZ; 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 S234064AbhF3JyY (ORCPT + 99 others); Wed, 30 Jun 2021 05:54:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26130 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233983AbhF3JyX (ORCPT ); Wed, 30 Jun 2021 05:54:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625046714; 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=QLDSo2Z7zKdGrAmZB3cGG4Cv4LLSWVrxocNgHWfsXbw=; b=O48PEsgZoeO56/BWKb0WwitiV4I3AmVVKZIC99zw39RgteLkwrC0l0CnSOozHN11JibvQV T7JFCDxfNB9JK/A2S0mpgphfQZkgADJNSVenRrNMacDYRFJKMy9vRLnjYZ/1DW0ZkC358/ ADyD+KaARMzeJo50PGfABl8s2t2pUYk= 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-121-Oc54HgY3P36dWKvzQqTIHA-1; Wed, 30 Jun 2021 05:51:52 -0400 X-MC-Unique: Oc54HgY3P36dWKvzQqTIHA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 241B31023F44; Wed, 30 Jun 2021 09:51:49 +0000 (UTC) Received: from localhost (ovpn-113-77.ams2.redhat.com [10.36.113.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6063060C17; Wed, 30 Jun 2021 09:51:40 +0000 (UTC) Date: Wed, 30 Jun 2021 10:51:39 +0100 From: Stefan Hajnoczi To: Yongji Xie Cc: "Michael S. Tsirkin" , Jason Wang , Stefano Garzarella , Parav Pandit , Christoph Hellwig , Christian Brauner , Randy Dunlap , Matthew Wilcox , Al Viro , Jens Axboe , bcrl@kvack.org, Jonathan Corbet , Mika =?iso-8859-1?Q?Penttil=E4?= , Dan Carpenter , joro@8bytes.org, Greg KH , songmuchun@bytedance.com, virtualization , netdev@vger.kernel.org, kvm , linux-fsdevel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel Subject: Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace Message-ID: References: <20210615141331.407-1-xieyongji@bytedance.com> <20210615141331.407-10-xieyongji@bytedance.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3lbE45OiRHDOxQny" Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3lbE45OiRHDOxQny Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 29, 2021 at 10:59:51AM +0800, Yongji Xie wrote: > On Mon, Jun 28, 2021 at 9:02 PM Stefan Hajnoczi wro= te: > > > > On Tue, Jun 15, 2021 at 10:13:30PM +0800, Xie Yongji wrote: > > > +/* ioctls */ > > > + > > > +struct vduse_dev_config { > > > + char name[VDUSE_NAME_MAX]; /* vduse device name */ > > > + __u32 vendor_id; /* virtio vendor id */ > > > + __u32 device_id; /* virtio device id */ > > > + __u64 features; /* device features */ > > > + __u64 bounce_size; /* bounce buffer size for iommu */ > > > + __u16 vq_size_max; /* the max size of virtqueue */ > > > > The VIRTIO specification allows per-virtqueue sizes. A device can have > > two virtqueues, where the first one allows up to 1024 descriptors and > > the second one allows only 128 descriptors, for example. > > >=20 > Good point! But it looks like virtio-vdpa/virtio-pci doesn't support > that now. All virtqueues have the same maximum size. I see struct vpda_config_ops only supports a per-device max vq size: u16 (*get_vq_num_max)(struct vdpa_device *vdev); virtio-pci supports per-virtqueue sizes because the struct virtio_pci_common_cfg->queue_size register is per-queue (controlled by queue_select). I guess this is a question for Jason: will vdpa will keep this limitation? If yes, then VDUSE can stick to it too without running into problems in the future. > > > + __u16 padding; /* padding */ > > > + __u32 vq_num; /* the number of virtqueues */ > > > + __u32 vq_align; /* the allocation alignment of virtqueue's meta= data */ > > > > I'm not sure what this is? > > >=20 > This will be used by vring_create_virtqueue() too. If there is no official definition for the meaning of this value then "/* same as vring_create_virtqueue()'s vring_align parameter */" would be clearer. That way the reader knows what to research in order to understand how this field works. I don't remember but maybe it was used to support vrings when the host/guest have non-4KB page sizes. I wonder if anyone has an official definition for this value? --3lbE45OiRHDOxQny Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmDcPqsACgkQnKSrs4Gr c8gDoggAyGvIGHHs1axRrEGCyXosmMHq1Gwk1Dsg+k0v8U5j732fua4fJO5b2bGG pzNxnV9FTNjogQfNxCplXlHf7caNNcC3DP+ICiJHaltNBj4xyNF+DB4DiUUgzX+b 5OnyW39vt7baCjK8ArMUXRW7FAWMPyws++y74Gagc5jIG7ZBaXUQDXr00eIgOYo7 ltAOLwHViZ7uNrXo7ohWRZpsBQkm2P8Hk7JNlxoQTjTKAp3kQ9eRdVR9/TrU0srE vZ6KxlGFgDlyd1lzWOh19y/MS2uhN2guJXrhqsF/2lOMh6v8qcHGKgdFCYJNctFq M0jd7vfZKILkd4ychd1eColy0HVSNw== =3k6c -----END PGP SIGNATURE----- --3lbE45OiRHDOxQny--