cryptodev-vhost-user: add crypto session handler

Introduce two vhost-user meassges: VHOST_USER_CREATE_CRYPTO_SESSION
and VHOST_USER_CLOSE_CRYPTO_SESSION. At this point, the QEMU side
support crypto operation in cryptodev host-user backend.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Gonglei 2018-03-01 21:46:30 +08:00 committed by Michael S. Tsirkin
parent 5da73dabe8
commit efbfeb8180
4 changed files with 174 additions and 10 deletions

View file

@ -368,6 +368,7 @@ Protocol features
#define VHOST_USER_PROTOCOL_F_MTU 4
#define VHOST_USER_PROTOCOL_F_SLAVE_REQ 5
#define VHOST_USER_PROTOCOL_F_CROSS_ENDIAN 6
#define VHOST_USER_PROTOCOL_F_CRYPTO_SESSION 7
Master message types
--------------------
@ -663,6 +664,31 @@ Master message types
field, and slaves MUST NOT accept SET_CONFIG for read-only
configuration space fields unless the live migration bit is set.
* VHOST_USER_CREATE_CRYPTO_SESSION
Id: 26
Equivalent ioctl: N/A
Master payload: crypto session description
Slave payload: crypto session description
Create a session for crypto operation. The server side must return the
session id, 0 or positive for success, negative for failure.
This request should be sent only when VHOST_USER_PROTOCOL_F_CRYPTO_SESSION
feature has been successfully negotiated.
It's a required feature for crypto devices.
* VHOST_USER_CLOSE_CRYPTO_SESSION
Id: 27
Equivalent ioctl: N/A
Master payload: u64
Close a session for crypto operation which was previously
created by VHOST_USER_CREATE_CRYPTO_SESSION.
This request should be sent only when VHOST_USER_PROTOCOL_F_CRYPTO_SESSION
feature has been successfully negotiated.
It's a required feature for crypto devices.
Slave message types
-------------------