qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Gonglei <arei.gonglei@huawei.com>
Cc: qemu-devel@nongnu.org, virtio-dev@lists.oasis-open.org,
	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,
	weidong.huang@huawei.com, mike.caraman@nxp.com, agraf@suse.de,
	jasowang@redhat.com, nmorey@kalray.eu, vincent.jardin@6wind.com,
	wu.wubin@huawei.com, arei.gonglei@hotmail.com,
	pasic@linux.vnet.ibm.com, linqiangmin@huawei.com,
	zhbzg@huawei.com, eety.chen@huawei.com,
	amy.zhanghuimin@huawei.com, lixiao91@huawei.com
Subject: Re: [Qemu-devel] [virtio-dev] [PATCH v18 1/2] virtio-crypto: Add virtio crypto device specification
Date: Tue, 16 May 2017 16:33:48 +0100	[thread overview]
Message-ID: <20170516153348.GR8498@stefanha-x1.localdomain> (raw)
In-Reply-To: <1492842231-223720-2-git-send-email-arei.gonglei@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 2547 bytes --]

On Sat, Apr 22, 2017 at 02:23:50PM +0800, Gonglei wrote:
> +Dataq requests for both session and stateless modes are as follows:
> +
> +\begin{lstlisting}
> +struct virtio_crypto_op_data_req_mux {
> +    struct virtio_crypto_op_header header;
> +
> +    union {
> +        struct virtio_crypto_sym_data_req   sym_req;
> +        struct virtio_crypto_hash_data_req  hash_req;
> +        struct virtio_crypto_mac_data_req   mac_req;
> +        struct virtio_crypto_aead_data_req  aead_req;
> +        struct virtio_crypto_sym_data_req_stateless   sym_stateless_req;
> +        struct virtio_crypto_hash_data_req_stateless  hash_stateless_req;
> +        struct virtio_crypto_mac_data_req_stateless   mac_stateless_req;
> +        struct virtio_crypto_aead_data_req_stateless  aead_stateless_req;
> +    } u;
> +};
> +\end{lstlisting}

Halil touched on this in the discussion: this spec uses a C-like struct
syntax but does not define whether unions really affect sizeof(mystruct)
like they would in C or whether you just mean that any of the union
fields can be used.  This distinction is important so device and driver
authors understand the exact memory layout of requests and responses.

Please include an explanation about the meaning of "union" in the text.

> +Session mode MAC service requests are as follows:
> +
> +\begin{lstlisting}
> +struct virtio_crypto_mac_para {
> +    struct virtio_crypto_hash_para hash;
> +};
> +
> +struct virtio_crypto_mac_data_req {
> +    /* Device-readable part */
> +    struct virtio_crypto_mac_para para;
> +    /* Source data */
> +    u8 src_data[src_data_len];
> +
> +    /* Device-writable part */
> +    /* Hash result data */
> +    u8 hash_result[hash_result_len];
> +    struct virtio_crypto_inhdr inhdr;
> +};
> +\end{lstlisting}
> +
> +Each data request uses virtio_crypto_mac_data_req structure to store information

"Each request uses the virtio_crypto_mac_data_req structure to store
information"

> +Session mode requests of symmetric algorithm are as follows:
> +
> +\begin{lstlisting}
> +struct virtio_crypto_sym_data_req {
> +    union {
> +        struct virtio_crypto_cipher_data_req cipher;
> +        struct virtio_crypto_alg_chain_data_req chain;
> +    } u;
> +
> +    /* Device-readable part */
> +
> +    /* See above VIRTIO_CRYPTO_SYM_OP_* */
> +    le32 op_type;
> +    le32 padding;
> +};
> +\end{lstlisting}
> +
> +Each data request uses virtio_crypto_sym_data_req structure to store information

s/virtio_crypto_sym_data_req structure/the virtio_crypto_sym_data_req structure/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  parent reply	other threads:[~2017-05-16 15:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-22  6:23 [Qemu-devel] [PATCH v18 0/2] virtio-crypto: virtio crypto device specification Gonglei
2017-04-22  6:23 ` [Qemu-devel] [PATCH v18 1/2] virtio-crypto: Add " Gonglei
2017-05-03 17:11   ` Halil Pasic
2017-05-04 13:33     ` Gonglei (Arei)
2017-05-04 13:55       ` Halil Pasic
2017-05-04 14:13         ` Gonglei (Arei)
2017-05-04 16:10           ` Halil Pasic
2017-05-05  3:39             ` Gonglei (Arei)
2017-05-05 13:52               ` [Qemu-devel] [virtio-dev] " Halil Pasic
2017-05-06  1:30                 ` Gonglei (Arei)
2017-05-04 17:32       ` Halil Pasic
2017-05-04 13:53     ` [Qemu-devel] " Gonglei (Arei)
2017-05-04 16:19       ` [Qemu-devel] [virtio-dev] " Halil Pasic
2017-05-05  5:56         ` Gonglei (Arei)
2017-05-05 14:32           ` Halil Pasic
2017-05-06  1:50             ` Gonglei (Arei)
2017-05-10 18:02   ` [Qemu-devel] " Halil Pasic
2017-05-15 17:02     ` [Qemu-devel] [virtio-dev] " Halil Pasic
2017-05-16  3:48     ` [Qemu-devel] " Gonglei (Arei)
2017-05-16 11:00       ` Halil Pasic
2017-05-16 15:33   ` Stefan Hajnoczi [this message]
2017-05-16 22:40     ` [Qemu-devel] [virtio-dev] " Halil Pasic
2017-05-17  9:18     ` Gonglei (Arei)
2017-04-22  6:23 ` [Qemu-devel] [PATCH v18 2/2] virtio-crypto: Add conformance clauses Gonglei
2017-05-02 21:55 ` [Qemu-devel] [virtio-dev] [PATCH v18 0/2] virtio-crypto: virtio crypto device specification Halil Pasic
2017-05-03  6:29   ` Gonglei (Arei)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170516153348.GR8498@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=Jani.Kokkonen@huawei.com \
    --cc=Ola.Liljedahl@arm.com \
    --cc=Varun.Sethi@freescale.com \
    --cc=agraf@suse.de \
    --cc=amy.zhanghuimin@huawei.com \
    --cc=arei.gonglei@hotmail.com \
    --cc=arei.gonglei@huawei.com \
    --cc=brian.a.keating@intel.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=denglingli@chinamobile.com \
    --cc=eety.chen@huawei.com \
    --cc=jasowang@redhat.com \
    --cc=john.griffin@intel.com \
    --cc=liang.j.ma@intel.com \
    --cc=linqiangmin@huawei.com \
    --cc=lixiao91@huawei.com \
    --cc=luonengjun@huawei.com \
    --cc=mike.caraman@nxp.com \
    --cc=mst@redhat.com \
    --cc=nmorey@kalray.eu \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vincent.jardin@6wind.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=weidong.huang@huawei.com \
    --cc=wu.wubin@huawei.com \
    --cc=xin.zeng@intel.com \
    --cc=zhbzg@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).