virtio-crypto: enable retry for virtio-crypto-dev
authorlei he <helei.sig11@bytedance.com>
Fri, 6 May 2022 13:16:27 +0000 (21:16 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 31 May 2022 16:45:09 +0000 (12:45 -0400)
Enable retry for virtio-crypto-dev, so that crypto-engine
can process cipher-requests parallelly.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: lei he <helei.sig11@bytedance.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20220506131627.180784-6-pizhenwei@bytedance.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/crypto/virtio/virtio_crypto_core.c

index 60490ffa3df14b5c08bba14e77180a892d5fa170..1198bd3063655a87d7de886c7e9eecbd008d55ab 100644 (file)
@@ -144,7 +144,8 @@ static int virtcrypto_find_vqs(struct virtio_crypto *vi)
                spin_lock_init(&vi->data_vq[i].lock);
                vi->data_vq[i].vq = vqs[i];
                /* Initialize crypto engine */
-               vi->data_vq[i].engine = crypto_engine_alloc_init(dev, 1);
+               vi->data_vq[i].engine = crypto_engine_alloc_init_and_set(dev, true, NULL, true,
+                                               virtqueue_get_vring_size(vqs[i]));
                if (!vi->data_vq[i].engine) {
                        ret = -ENOMEM;
                        goto err_engine;