Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752189AbcLOAsh convert rfc822-to-8bit (ORCPT ); Wed, 14 Dec 2016 19:48:37 -0500 Received: from szxga03-in.huawei.com ([45.249.212.189]:2437 "EHLO dggrg03-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754763AbcLOAse (ORCPT ); Wed, 14 Dec 2016 19:48:34 -0500 From: "Gonglei (Arei)" To: Halil Pasic , "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" CC: "Huangweidong (C)" , Claudio Fontana , "mst@redhat.com" , Luonengjun , "Hanweidong (Randy)" , "xin.zeng@intel.com" , "Xuquan (Quan Xu)" , "Wanzongshun (Vincent)" , "stefanha@redhat.com" , "Zhoujian (jay, Euler)" , "cornelia.huck@de.ibm.com" , longpeng , "arei.gonglei@hotmail.com" , "davem@davemloft.net" , "Wubin (H)" , "herbert@gondor.apana.org.au" Subject: RE: [Qemu-devel] [PATCH v7 1/1] crypto: add virtio-crypto driver Thread-Topic: [Qemu-devel] [PATCH v7 1/1] crypto: add virtio-crypto driver Thread-Index: AQHSVgBfNG80gdQzpE2MFBOShpv6DqEHDiOAgAEeUkA= Date: Thu, 15 Dec 2016 00:45:27 +0000 Message-ID: <33183CC9F5247A488A2544077AF19020DA163033@DGGEMA505-MBX.china.huawei.com> References: <1481716249-185392-1-git-send-email-arei.gonglei@huawei.com> <1481716249-185392-2-git-send-email-arei.gonglei@huawei.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.177.18.62] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.5851E7B5.02DE,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=169.254.1.226, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 3996d80fe16652c96ce52687852c22e0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 983 Lines: 34 > > > On 12/14/2016 12:50 PM, Gonglei wrote: > > diff --git a/drivers/crypto/virtio/virtio_crypto_core.c > b/drivers/crypto/virtio/virtio_crypto_core.c > > new file mode 100644 > > index 0000000..c0854a1 > > --- /dev/null > > +++ b/drivers/crypto/virtio/virtio_crypto_core.c > > @@ -0,0 +1,474 @@ > [..] > > + > > +static void virtcrypto_dataq_callback(struct virtqueue *vq) > > +{ > > + struct virtio_crypto *vcrypto = vq->vdev->priv; > > + struct virtio_crypto_request *vc_req; > > + unsigned long flags; > > + unsigned int len; > > + struct ablkcipher_request *ablk_req; > > + int error; > > + > > + spin_lock_irqsave(&vcrypto->lock, flags); > > Would it make sense to use a per virtqueue lock > like in virtio_blk for example instead of locking on the whole > device? OK, it seems you use only one dataqueue, so it > may not be that relevant. > Currently yes, both the backend device (cryptodev-backend-builtin) and the frontend driver use one dataqueue. Regards, -Gonglei