[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 03/10] virtio-crypto: remove queue_id field in ctrl he
From: |
Longpeng(Mike) |
Subject: |
[Qemu-devel] [RFC 03/10] virtio-crypto: remove queue_id field in ctrl header |
Date: |
Mon, 6 Nov 2017 14:56:55 +0800 |
The queue_id is needless bacause we can get the info from
VirtQueue->queue_index.
For existing frontend driver, this field is always zero,
so we can just mark this field as reserved and ingore its
value.
Signed-off-by: Longpeng(Mike) <address@hidden>
---
hw/virtio/virtio-crypto.c | 8 +++-----
include/standard-headers/linux/virtio_crypto.h | 3 +--
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
index 04c34d8..9ffe26d 100644
--- a/hw/virtio/virtio-crypto.c
+++ b/hw/virtio/virtio-crypto.c
@@ -221,7 +221,6 @@ static void virtio_crypto_handle_ctrl(VirtIODevice *vdev,
VirtQueue *vq)
struct iovec *out_iov;
unsigned in_num;
unsigned out_num;
- uint32_t queue_id;
uint32_t opcode;
struct virtio_crypto_session_input input;
int64_t session_id;
@@ -258,7 +257,6 @@ static void virtio_crypto_handle_ctrl(VirtIODevice *vdev,
VirtQueue *vq)
iov_discard_front(&out_iov, &out_num, s);
opcode = ldl_le_p(&hdr.opcode);
- queue_id = ldl_le_p(&hdr.queue_id);
switch (opcode) {
case VIRTIO_CRYPTO_CIPHER_CREATE_SESSION:
@@ -277,8 +275,8 @@ static void virtio_crypto_handle_ctrl(VirtIODevice *vdev,
VirtQueue *vq)
memset(&input, 0, sizeof(input));
session_id = virtio_crypto_create_sym_session(vcrypto,
- &req, queue_id, opcode,
- out_iov, out_num);
+ &req, virtio_get_queue_index(vq),
+ opcode, out_iov, out_num);
/* Serious errors, need to reset virtio crypto device */
if (session_id == -EFAULT) {
virtqueue_detach_element(vq, elem, 0);
@@ -321,7 +319,7 @@ static void virtio_crypto_handle_ctrl(VirtIODevice *vdev,
VirtQueue *vq)
}
status = virtio_crypto_handle_close_session(vcrypto,
- &req, queue_id);
+ &req, virtio_get_queue_index(vq));
/* The status only occupy one byte, we can directly use it */
s = iov_from_buf(in_iov, in_num, 0, &status, sizeof(status));
if (unlikely(s != sizeof(status))) {
diff --git a/include/standard-headers/linux/virtio_crypto.h
b/include/standard-headers/linux/virtio_crypto.h
index 8793be6..5e586e5 100644
--- a/include/standard-headers/linux/virtio_crypto.h
+++ b/include/standard-headers/linux/virtio_crypto.h
@@ -67,8 +67,7 @@ struct virtio_crypto_ctrl_header {
uint32_t opcode;
uint32_t algo;
uint32_t flag;
- /* data virtqueue id */
- uint32_t queue_id;
+ uint32_t reserved;
};
struct virtio_crypto_cipher_session_para {
--
1.8.3.1
- [Qemu-devel] [RFC 00/10] virtio-crypto: add multiplexing mode support, Longpeng(Mike), 2017/11/06
- [Qemu-devel] [RFC 03/10] virtio-crypto: remove queue_id field in ctrl header,
Longpeng(Mike) <=
- [Qemu-devel] [RFC 01/10] virtio-crypto: remove virtio_crypto_op_ctrl_req structure, Longpeng(Mike), 2017/11/06
- [Qemu-devel] [RFC 06/10] cryptodev: add stateless mode cipher support, Longpeng(Mike), 2017/11/06
- [Qemu-devel] [RFC 08/10] cryptodev: extract one util function, Longpeng(Mike), 2017/11/06
- [Qemu-devel] [RFC 07/10] virtio-crypto: add stateless crypto request handler, Longpeng(Mike), 2017/11/06
- [Qemu-devel] [RFC 10/10] virtio-crypto: add host feature bits support, Longpeng(Mike), 2017/11/06
- [Qemu-devel] [RFC 04/10] virtio-crypto: remove virtio_crypto_op_data_req structure, Longpeng(Mike), 2017/11/06
- [Qemu-devel] [RFC 09/10] cryptodev-builtin: add stateless cipher support, Longpeng(Mike), 2017/11/06
- [Qemu-devel] [RFC 02/10] virtio-crypto: add session creation logic for mux mode, Longpeng(Mike), 2017/11/06
- [Qemu-devel] [RFC 05/10] virtio-crypto: add dataq operation logic for mux mode, Longpeng(Mike), 2017/11/06
- Re: [Qemu-devel] [RFC 00/10] virtio-crypto: add multiplexing mode support, no-reply, 2017/11/06