From: "Gonglei (Arei)" <arei.gonglei@huawei.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"virtio-dev@lists.oasis-open.org"
<virtio-dev@lists.oasis-open.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
"Huangweidong (C)" <weidong.huang@huawei.com>,
Claudio Fontana <Claudio.Fontana@huawei.com>,
Luonengjun <luonengjun@huawei.com>,
"Hanweidong (Randy)" <hanweidong@huawei.com>,
"Xuquan (Quan Xu)" <xuquan8@huawei.com>,
"Wanzongshun (Vincent)" <wanzongshun@huawei.com>,
"stefanha@redhat.com" <stefanha@redhat.com>,
"Zhoujian (jay, Euler)" <
Subject: RE: [PATCH v8 1/1] crypto: add virtio-crypto driver
Date: Fri, 13 Jan 2017 01:56:03 +0000 [thread overview]
Message-ID: <33183CC9F5247A488A2544077AF19020DA18F954@DGGEMA505-MBX.china.huawei.com> (raw)
In-Reply-To: <20170112161729-mutt-send-email-mst@kernel.org>
>
> On Thu, Jan 12, 2017 at 03:10:25PM +0100, Christian Borntraeger wrote:
> > On 01/10/2017 01:56 PM, Christian Borntraeger wrote:
> > > On 01/10/2017 01:36 PM, Gonglei (Arei) wrote:
> > >> Hi,
> > >>
> > >>>
> > >>> On 12/15/2016 03:03 AM, Gonglei wrote:
> > >>> [...]
> > >>>> +
> > >>>> +static struct crypto_alg virtio_crypto_algs[] = { {
> > >>>> + .cra_name = "cbc(aes)",
> > >>>> + .cra_driver_name = "virtio_crypto_aes_cbc",
> > >>>> + .cra_priority = 501,
> > >>>
> > >>>
> > >>> This is still higher than the hardware-accelerators (like intel aesni or the
> > >>> s390 cpacf functions or the arm hw). aesni and s390/cpacf are supported
> by the
> > >>> hardware virtualization and available to the guests. I do not see a way
> how
> > >>> virtio
> > >>> crypto can be faster than that (in the end it might be cpacf/aesni +
> overhead)
> > >>> instead it will very likely be slower.
> > >>> So we should use a number that is higher than software implementations
> but
> > >>> lower than the hw ones.
> > >>>
> > >>> Just grepping around, the software ones seem be be around 100 and the
> > >>> hardware
> > >>> ones around 200-400. So why was 150 not enough?
> > >>>
> > >> I didn't find a documentation about how we use the priority, and I assumed
> > >> people use virtio-crypto will configure hardware accelerators in the
> > >> host. So I choosed the number which bigger than aesni's priority.
> > >
> > > Yes, but the aesni driver will only bind if there is HW support in the guest.
> > > And if aesni is available in the guest (or the s390 aes function from cpacf)
> > > it will always be faster than the same in the host via virtio.So your priority
> > > should be smaller.
> >
> >
> > any opinion on this?
>
> Going forward, we might add an emulated aesni device and that might
> become slower than virtio. OTOH if or when this happens, we can solve it
> by adding a priority or a feature flag to virtio to raise its priority.
>
> So I think I agree with Christian here, let's lower the priority.
> Gonglei, could you send a patch like this?
>
OK, will do.
Thanks,
-Gonglei
prev parent reply other threads:[~2017-01-13 1:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-15 2:03 [PATCH v8 0/1] virtio-crypto: add Linux driver Gonglei
2016-12-15 2:03 ` [PATCH v8 1/1] crypto: add virtio-crypto driver Gonglei
2017-01-10 12:27 ` Christian Borntraeger
2017-01-10 12:36 ` Gonglei (Arei)
2017-01-10 12:56 ` Christian Borntraeger
2017-01-12 14:10 ` Christian Borntraeger
2017-01-12 14:23 ` Michael S. Tsirkin
2017-01-13 1:56 ` Gonglei (Arei) [this message]
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=33183CC9F5247A488A2544077AF19020DA18F954@DGGEMA505-MBX.china.huawei.com \
--to=arei.gonglei@huawei.com \
--cc=Claudio.Fontana@huawei.com \
--cc=borntraeger@de.ibm.com \
--cc=davem@davemloft.net \
--cc=hanweidong@huawei.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luonengjun@huawei.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=virtio-dev@lists.oasis-open.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=wanzongshun@huawei.com \
--cc=weidong.huang@huawei.com \
--cc=xuquan8@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).