Commit Graph

11 Commits

Author SHA1 Message Date
Dan Gora
9f976204f5 vhost/crypto: use function to access mbuf private area
Use rte_mbuf_to_priv() to access the private data area in the mbuf.

Signed-off-by: Dan Gora <dg@adax.com>
2018-07-13 23:14:41 +02:00
Fan Zhang
3c79609fda vhost/crypto: handle virtually non-contiguous buffers
This patch enables the handling of buffers non-contiguous in
virtual address space in the vhost_crypto. Instead of using
rte_vhost_va_from_guest_pa(), the host virtual address is
converted by vhost_iova_to_vva() for wider use cases.

For copy mode, the copy length is limited to the chunk size,
next chunks VAs being fetched afterward.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-05-17 12:29:05 +02:00
Fan Zhang
2017bc3356 vhost/crypto: fix descriptor move
This patch fixes the redundant descriptor move in the copy mode
of vhost crypto. Originally the redundant descriptor move will
cause the message parsing error.

Fixes: 3bb595ecd6 ("vhost/crypto: add request handler")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-05-17 12:29:05 +02:00
Fan Zhang
dc3530ec0d vhost/crypto: fix symmetric ciphering
A bracket was misplaced in a condition check, this patch
fixes it.

Coverity issue: 277232, 277237
Fixes: 3bb595ecd6 ("vhost/crypto: add request handler")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-05-14 22:31:03 +01:00
Fan Zhang
613e827fb2 vhost/crypto: fix checks while moving descriptors
This patch fix final condition check while moving virtqueue
descriptors.

Fixes: 3bb595ecd6 ("vhost/crypto: add request handler")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-04-27 19:49:20 +02:00
Fan Zhang
d4cc4c65df vhost/crypto: fix missing head correction
This patch fixes the missing head descriptor correction for
indirect descriptors.

Fixes: 0aee242841 ("vhost/crypto: move to safe GPA translation API")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-04-27 19:49:07 +02:00
Maxime Coquelin
996096e629 vhost/crypto: fix build with gcc 4.7.2
Build error has been reported by Intel build system:
SUSE12SP3_64 / Linux 3.7.10-1 / GCC 4.7.2
lib/librte_vhost/vhost_crypto.c: In function ‘rte_vhost_crypto_set_zero_copy’:
lib/librte_vhost/vhost_crypto.c:1192:2: error:
comparison of unsigned expression < 0 is always false

As enums can be either signed or unsigned, this patch removes
the negative check and cast to unsigned the upper limit check.

Fixes: 939066d965 ("vhost/crypto: add public function implementation")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-04-27 11:31:39 +02:00
Maxime Coquelin
0aee242841 vhost/crypto: move to safe GPA translation API
This patch uses the new rte_vhost_va_from_guest_pa() API
to ensure all the descriptor buffer is mapped contiguously
in the application virtual address space.

It does not handle buffers discontiguous in host virtual
address space, but only return an error.

This issue has been assigned CVE-2018-1059.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-04-23 17:12:13 +02:00
Fan Zhang
939066d965 vhost/crypto: add public function implementation
This patch adds public API implementation to vhost crypto.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-04-14 00:43:30 +02:00
Fan Zhang
3bb595ecd6 vhost/crypto: add request handler
This patch adds the implementation that parses virtio crypto request
to dpdk crypto operation.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-04-14 00:43:30 +02:00
Fan Zhang
e80a987081 vhost/crypto: add session message handler
This patch adds session message handler to vhost crypto.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-04-14 00:43:30 +02:00