[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 01/12] virtio-crypto: introduce virtio_crypto
From: |
Gonglei (Arei) |
Subject: |
Re: [Qemu-devel] [PATCH v6 01/12] virtio-crypto: introduce virtio_crypto.h |
Date: |
Tue, 11 Oct 2016 01:16:59 +0000 |
> -----Original Message-----
> From: Eric Blake [mailto:address@hidden
> Sent: Tuesday, October 11, 2016 3:58 AM
> Subject: Re: [PATCH v6 01/12] virtio-crypto: introduce virtio_crypto.h
>
> On 10/10/2016 03:43 AM, Gonglei wrote:
> > Introduce the virtio_crypto.h which follows
> > virtio-crypto specification.
> >
> > Signed-off-by: Gonglei <address@hidden>
> > ---
> > include/standard-headers/linux/virtio_crypto.h | 381
> +++++++++++++++++++++++++
> > 1 file changed, 381 insertions(+)
> > create mode 100644 include/standard-headers/linux/virtio_crypto.h
> >
> > diff --git a/include/standard-headers/linux/virtio_crypto.h
> b/include/standard-headers/linux/virtio_crypto.h
> > new file mode 100644
> > index 0000000..a62d192
> > --- /dev/null
> > +++ b/include/standard-headers/linux/virtio_crypto.h
> > @@ -0,0 +1,381 @@
> > +#ifndef _VIRTIO_CRYPTO_H
> > +#define _VIRTIO_CRYPTO_H
>
> Missing a copyright and license notice. Is this header copied from
> Linux, or is it new to qemu? At any rate, being explicit about your
> license is important (in qemu, files without a license are GPLv2+;
> whereas the Linux kernel tends to favor GPLv2-only).
>
It should be copied from Linux like other virtio devices do.
I'll add copyright for this in the next version.
> > +
> > +#include "standard-headers/linux/types.h"
> > +#include "standard-headers/linux/virtio_config.h"
> > +#include "standard-headers/linux/virtio_types.h"
> > +
> > +
> > +#define VIRTIO_CRYPTO_SERVICE_CIPHER (0)
> > +#define VIRTIO_CRYPTO_SERVICE_HASH (1)
> > +#define VIRTIO_CRYPTO_SERVICE_MAC (2)
> > +#define VIRTIO_CRYPTO_SERVICE_AEAD (3)
>
> Technically over-parenthesized, but doesn't hurt.
>
> > +
> > +#define VIRTIO_CRYPTO_OPCODE(service, op) ((service << 8) | (op))
>
> Under-parenthesized. You need more () around service.
>
So, the best definition is:
#define VIRTIO_CRYPTO_SERVICE_CIPHER 0
#define VIRTIO_CRYPTO_SERVICE_HASH 1
#define VIRTIO_CRYPTO_SERVICE_MAC 2
#define VIRTIO_CRYPTO_SERVICE_AEAD 3
#define VIRTIO_CRYPTO_OPCODE(service, op) (((service) << 8) | (op))
Will fix. Thanks~
Regards,
-Gonglei
- [Qemu-devel] [PATCH v6 00/12] virtio-crypto: introduce framework and device emulation, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 12/12] virtio-crypto-test: add qtest case for virtio-crypto, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 06/12] virtio-crypto: add control queue handler, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 10/12] virtio-crypto: perfect algorithms chainning support, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 01/12] virtio-crypto: introduce virtio_crypto.h, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 02/12] cryptodev: introduce a new cryptodev backend, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 08/12] cryptodev: introduce an unified wrapper for crypto operation, Gonglei, 2016/10/10
- Re: [Qemu-devel] [PATCH v6 00/12] virtio-crypto: introduce framework and device emulation, Gonglei (Arei), 2016/10/10
- [Qemu-devel] [PATCH v6 05/12] virtio-crypto: set capacity of algorithms supported, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 11/12] virtio-crypto: emulate virtio crypto as a legacy device by default, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 04/12] virtio-crypto-pci: add virtio crypto pci support, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 07/12] virtio-crypto: add data queue processing handler, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 03/12] virtio-crypto: add virtio crypto device emulation, Gonglei, 2016/10/10
- [Qemu-devel] [PATCH v6 09/12] virtio-crypto: add myself as virtio-crypto and cryptodev backends maintainer, Gonglei, 2016/10/10
- Re: [Qemu-devel] [PATCH v6 00/12] virtio-crypto: introduce framework and device emulation, Eric Blake, 2016/10/10