From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033008AbdAJM1Z (ORCPT ); Tue, 10 Jan 2017 07:27:25 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58445 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032458AbdAJM1T (ORCPT ); Tue, 10 Jan 2017 07:27:19 -0500 Subject: Re: [PATCH v8 1/1] crypto: add virtio-crypto driver To: Gonglei , linux-kernel@vger.kernel.org, qemu-devel@nongnu.org, virtio-dev@lists.oasis-open.org, virtualization@lists.linux-foundation.org, linux-crypto@vger.kernel.org References: <1481767396-187748-1-git-send-email-arei.gonglei@huawei.com> <1481767396-187748-2-git-send-email-arei.gonglei@huawei.com> Cc: weidong.huang@huawei.com, claudio.fontana@huawei.com, mst@redhat.com, luonengjun@huawei.com, hanweidong@huawei.com, xuquan8@huawei.com, wanzongshun@huawei.com, stefanha@redhat.com, jianjay.zhou@huawei.com, longpeng2@huawei.com, arei.gonglei@hotmail.com, davem@davemloft.net, wu.wubin@huawei.com, herbert@gondor.apana.org.au From: Christian Borntraeger Date: Tue, 10 Jan 2017 13:27:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1481767396-187748-2-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17011012-0024-0000-0000-000015A9FAF4 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006407; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000199; SDB=6.00805646; UDB=6.00391967; IPR=6.00582981; BA=6.00005041; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013876; XFM=3.00000011; UTC=2017-01-10 12:27:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17011012-0025-0000-0000-000047D1E9AD Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-10_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701100181 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Christian