From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1br5a2-0003FP-Ab for qemu-devel@nongnu.org; Mon, 03 Oct 2016 11:55:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1br5Zy-0007Jz-7I for qemu-devel@nongnu.org; Mon, 03 Oct 2016 11:55:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1br5Zx-0007Ji-T6 for qemu-devel@nongnu.org; Mon, 03 Oct 2016 11:54:58 -0400 Date: Mon, 3 Oct 2016 16:54:53 +0100 From: Stefan Hajnoczi Message-ID: <20161003155453.GT10245@stefanha-x1.localdomain> References: <1475053705-400172-1-git-send-email-arei.gonglei@huawei.com> <1475053705-400172-2-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lpUp1egui7PDlNtH" Content-Disposition: inline In-Reply-To: <1475053705-400172-2-git-send-email-arei.gonglei@huawei.com> Subject: Re: [Qemu-devel] [PATCH v11 1/2] virtio-crypto: Add virtio crypto device specification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gonglei Cc: qemu-devel@nongnu.org, virtio-dev@lists.oasis-open.org, peter.huangpeng@huawei.com, luonengjun@huawei.com, mst@redhat.com, cornelia.huck@de.ibm.com, denglingli@chinamobile.com, Jani.Kokkonen@huawei.com, Ola.Liljedahl@arm.com, Varun.Sethi@freescale.com, xin.zeng@intel.com, brian.a.keating@intel.com, liang.j.ma@intel.com, john.griffin@intel.com, hanweidong@huawei.com, weidong.huang@huawei.com, mike.caraman@nxp.com, agraf@suse.de, claudio.fontana@huawei.com, jianjay.zhou@huawei.com, nmorey@kalray.eu, vincent.jardin@6wind.com, wu.wubin@huawei.com, Shiqing.Fan@huawei.com --lpUp1egui7PDlNtH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Sep 28, 2016 at 05:08:24PM +0800, Gonglei wrote: > +For scatter/gather list support, a buffer can be represented by virtio_crypto_iovec structure. > + > +The structure is defined as follows: > + > +\begin{lstlisting} > +struct virtio_crypto_iovec { > + /* Guest physical address */ > + le64 addr; > + /* Length of guest physical address */ > + le32 len; > +/* This marks a buffer as continuing via the next field */ > +#define VIRTIO_CRYPTO_IOVEC_F_NEXT 1 > + /* The flags as indicated above VIRTIO_CRYPTO_IOVEC_F_*. */ > + le32 flags; > + /* Pointer to next struct virtio_crypto_iovec if flags & NEXT */ > + le64 next_iovec; > +}; > +\end{lstlisting} The vring already provides scatter-gather I/O. It is usually not necessary to define scatter-gather I/O at the device level. Addresses can be translated by the virtio transport (PCI, MMIO, CCW). For example PCI bus addresses with IO-MMU. Therefore it's messy to use guest physical addresses in the device specification. > +Each data request uses virtio_crypto_hash_data_req structure to store information > +used to run the HASH operations. The request only occupies one entry > +in the Vring Descriptor Table in the virtio crypto device's dataq, which improves > +the throughput of data transmitted for the HASH service, so that the virtio crypto > +device can be better accelerated. Indirect vrings also only require one entry in the descriptor table. I don't understand why you are reinventing scatter-gather I/O. Am I missing something? Stefan --lpUp1egui7PDlNtH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJX8n9NAAoJEJykq7OBq3PIg68H/iQrSvPbbYHqgGlROYADwG3H yx7luOKjeU2loSkWCze2GtRGtabRT4zBu9iWu2EKlURTz8/7zFdnVQT0P5snwGgF NHL3aJZVIAHV1wRHImeKsOP8fHLAVmV57pLn1nFRMv7hvpp3i1lLRpWG0ePjOF3u l1N6wPOaEeH/EEM93KeC0HFAAHnlNOS4zDPACMw5M+4NJO6yyq2/F/KraprVujas tI6YDjUF4pa5HtZt6kzJ0XugISaE7vYGBO+gMBUhQTVT9JDXLQvd8YFiKIgAL5kW hOWW64Zilw3Kl3oKakH1Q4hfSY5iHHGNwlm9R6ayQn/BVw5UiORGzBULIcK4x5w= =wSvD -----END PGP SIGNATURE----- --lpUp1egui7PDlNtH--