All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gonglei (Arei)" <arei.gonglei@huawei.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>,
	Luonengjun <luonengjun@huawei.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"berrange@redhat.com" <berrange@redhat.com>,
	"Huangweidong (C)" <weidong.huang@huawei.com>,
	"Wubin (H)" <wu.wubin@huawei.com>,
	"mike.caraman@nxp.com" <mike.caraman@nxp.com>,
	"agraf@suse.de" <agraf@suse.de>,
	"xin.zeng@intel.com" <xin.zeng@intel.com>,
	Claudio Fontana <Claudio.Fontana@huawei.com>,
	"nmorey@kalray.eu" <nmorey@kalray.eu>,
	"vincent.jardin@6wind.com" <vincent.jardin@6wind.com>,
	"Zhoujian (jay, Euler)" <jianjay.zhou@huawei.com>,
	"Hanweidong (Randy)" <hanweidong@huawei.com>,
	"Huangpeng (Peter)" <peter.huangpeng@huawei.com>
Subject: Re: [Qemu-devel] [virtio-dev] Re: [PATCH v4 07/13] virtio-crypto: set capacity of algorithms supported
Date: Wed, 5 Oct 2016 03:30:42 +0000	[thread overview]
Message-ID: <33183CC9F5247A488A2544077AF19020B03E65A7@SZXEMA503-MBS.china.huawei.com> (raw)
In-Reply-To: <20161004094610.GF4587@stefanha-x1.localdomain>


> -----Original Message-----
> From: virtio-dev@lists.oasis-open.org [mailto:virtio-dev@lists.oasis-open.org]
> On Behalf Of Stefan Hajnoczi
> Sent: Tuesday, October 04, 2016 5:46 PM
> Subject: [virtio-dev] Re: [PATCH v4 07/13] virtio-crypto: set capacity of
> algorithms supported
> 
> On Wed, Sep 28, 2016 at 04:25:46PM +0800, Gonglei wrote:
> >  static void virtio_crypto_get_config(VirtIODevice *vdev, uint8_t *config)
> >  {
> > -
> > +    VirtIOCrypto *c = VIRTIO_CRYPTO(vdev);
> > +    struct virtio_crypto_config crypto_cfg;
> > +
> > +    crypto_cfg.status = c->status;
> > +    crypto_cfg.max_dataqueues = c->max_queues;
> > +    crypto_cfg.crypto_services = c->conf.crypto_services;
> > +    crypto_cfg.cipher_algo_l = c->conf.cipher_algo_l;
> > +    crypto_cfg.cipher_algo_h = c->conf.cipher_algo_h;
> > +    crypto_cfg.hash_algo = c->conf.hash_algo;
> > +    crypto_cfg.mac_algo_l = c->conf.mac_algo_l;
> > +    crypto_cfg.mac_algo_h = c->conf.mac_algo_h;
> > +    crypto_cfg.aead_algo = c->conf.aead_algo;
> > +
> > +    memcpy(config, &crypto_cfg, c->config_size);
> >  }
> 
> What about endianness?  For example, if the host is big-endian then this
> VIRTIO 1.0 device needs to byteswap multi-byte fields.  There is a
> family of functions to help with this: virtio_stl_p().

I did that in v1. Michael told me that Virtio-1.0 devices are always little-endian, so
I removed those helper functions in the following functions. But after this version,
the virtio-crypto device isn't virtio-1.0 device by default, so I should use them again.


Regards,
-Gonglei

  reply	other threads:[~2016-10-05  3:31 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28  8:25 [Qemu-devel] [PATCH v4 00/13] virtio-crypto: introduce framework and device emulation Gonglei
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 01/13] cryptodev: introduce cryptodev backend interface Gonglei
2016-10-03 16:10   ` Stefan Hajnoczi
2016-10-03 16:15     ` Daniel P. Berrange
2016-10-05  3:06     ` Gonglei (Arei)
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 02/13] cryptodev: add symmetric algorithm operation stuff Gonglei
2016-10-03 16:13   ` Stefan Hajnoczi
2016-10-05  3:07     ` [Qemu-devel] [virtio-dev] " Gonglei (Arei)
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 03/13] virtio-crypto: introduce virtio_crypto.h Gonglei
2016-10-03 16:14   ` Stefan Hajnoczi
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 04/13] cryptodev: introduce a new cryptodev backend Gonglei
2016-10-03 16:31   ` Stefan Hajnoczi
2016-10-05  3:19     ` Gonglei (Arei)
2016-10-05 12:53       ` Stefan Hajnoczi
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 05/13] virtio-crypto: add virtio crypto device emulation Gonglei
2016-10-04  9:38   ` Stefan Hajnoczi
2016-10-05  3:26     ` Gonglei (Arei)
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 06/13] virtio-crypto-pci: add virtio crypto pci support Gonglei
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 07/13] virtio-crypto: set capacity of algorithms supported Gonglei
2016-10-04  9:46   ` Stefan Hajnoczi
2016-10-05  3:30     ` Gonglei (Arei) [this message]
2016-10-05 12:55       ` [Qemu-devel] [virtio-dev] " Stefan Hajnoczi
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 08/13] virtio-crypto: add control queue handler Gonglei
2016-10-04 10:09   ` Stefan Hajnoczi
2016-10-05  3:38     ` Gonglei (Arei)
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 09/13] virtio-crypto: add data queue processing handler Gonglei
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 10/13] cryptodev: introduce an unified wrapper for crypto operation Gonglei
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 11/13] virtio-crypto: emulate virtio crypto as a legacy device by default Gonglei
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 12/13] virtio-crypto-test: add qtest case for virtio-crypto Gonglei
2016-09-28  8:25 ` [Qemu-devel] [PATCH v4 13/13] virtio-crypto: add myself as virtio-crypto and cryptodev backends maintainer Gonglei
2016-09-28  9:14 ` [Qemu-devel] [PATCH v4 00/13] virtio-crypto: introduce framework and device emulation no-reply
2016-09-28  9:18   ` Gonglei (Arei)
2016-10-03 12:02 ` Gonglei (Arei)
2016-10-04 10:13 ` Stefan Hajnoczi
2016-10-05  3:42   ` [Qemu-devel] [virtio-dev] " 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=33183CC9F5247A488A2544077AF19020B03E65A7@SZXEMA503-MBS.china.huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=Claudio.Fontana@huawei.com \
    --cc=agraf@suse.de \
    --cc=berrange@redhat.com \
    --cc=hanweidong@huawei.com \
    --cc=jianjay.zhou@huawei.com \
    --cc=luonengjun@huawei.com \
    --cc=mike.caraman@nxp.com \
    --cc=mst@redhat.com \
    --cc=nmorey@kalray.eu \
    --cc=pbonzini@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.