DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost/crypto: fix desc moving for copy mode
@ 2018-04-11 10:09 Fan Zhang
  2018-04-11 14:38 ` Maxime Coquelin
  2018-04-11 14:41 ` Maxime Coquelin
  0 siblings, 2 replies; 4+ messages in thread
From: Fan Zhang @ 2018-04-11 10:09 UTC (permalink / raw)
  To: dev; +Cc: roy.fan.zhang, maxime.coquelin, ferruh.yigit

Fixes: cd39f8e4fd2a ("vhost/crypto: add request handler")

This patch fixes the descriptor moving for copy mode by adding
the missing moving step after destination data parsing.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 lib/librte_vhost/vhost_crypto.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_crypto.c
index ab75db0b1..363a034cb 100644
--- a/lib/librte_vhost/vhost_crypto.c
+++ b/lib/librte_vhost/vhost_crypto.c
@@ -694,6 +694,10 @@ prepare_sym_cipher_op(struct vhost_crypto *vcrypto, struct rte_crypto_op *op,
 	case RTE_VHOST_CRYPTO_ZERO_COPY_DISABLE:
 		vc_req->wb_desc = desc;
 		vc_req->wb_len = cipher->para.dst_data_len;
+		if (unlikely(move_desc(head, &desc, vc_req->wb_len) < 0)) {
+			ret = VIRTIO_CRYPTO_ERR;
+			goto error_exit;
+		}
 		break;
 	default:
 		ret = VIRTIO_CRYPTO_BADMSG;
@@ -840,6 +844,11 @@ prepare_sym_chain_op(struct vhost_crypto *vcrypto, struct rte_crypto_op *op,
 		op->sym->auth.digest.data = digest_addr;
 		op->sym->auth.digest.phys_addr = rte_pktmbuf_iova_offset(m_dst,
 				digest_offset);
+		if (unlikely(move_desc(head, &desc,
+				chain->para.hash_result_len) < 0)) {
+			ret = VIRTIO_CRYPTO_ERR;
+			goto error_exit;
+		}
 		break;
 	default:
 		ret = VIRTIO_CRYPTO_BADMSG;
-- 
2.13.6

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] vhost/crypto: fix desc moving for copy mode
  2018-04-11 10:09 [dpdk-dev] [PATCH] vhost/crypto: fix desc moving for copy mode Fan Zhang
@ 2018-04-11 14:38 ` Maxime Coquelin
  2018-04-11 14:41 ` Maxime Coquelin
  1 sibling, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2018-04-11 14:38 UTC (permalink / raw)
  To: Fan Zhang, dev; +Cc: ferruh.yigit



On 04/11/2018 12:09 PM, Fan Zhang wrote:
> Fixes: cd39f8e4fd2a ("vhost/crypto: add request handler")
> 
> This patch fixes the descriptor moving for copy mode by adding
> the missing moving step after destination data parsing.
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---
>   lib/librte_vhost/vhost_crypto.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] vhost/crypto: fix desc moving for copy mode
  2018-04-11 10:09 [dpdk-dev] [PATCH] vhost/crypto: fix desc moving for copy mode Fan Zhang
  2018-04-11 14:38 ` Maxime Coquelin
@ 2018-04-11 14:41 ` Maxime Coquelin
  2018-04-11 17:36   ` Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: Maxime Coquelin @ 2018-04-11 14:41 UTC (permalink / raw)
  To: Fan Zhang, dev; +Cc: ferruh.yigit



On 04/11/2018 12:09 PM, Fan Zhang wrote:
> Fixes: cd39f8e4fd2a ("vhost/crypto: add request handler")
> 
> This patch fixes the descriptor moving for copy mode by adding
> the missing moving step after destination data parsing.
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---
>   lib/librte_vhost/vhost_crypto.c | 9 +++++++++
>   1 file changed, 9 insertions(+)

Applied to dpdk-next-virtio/master

thanks,
Maxime

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] vhost/crypto: fix desc moving for copy mode
  2018-04-11 14:41 ` Maxime Coquelin
@ 2018-04-11 17:36   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-04-11 17:36 UTC (permalink / raw)
  To: Maxime Coquelin, Fan Zhang, dev

On 4/11/2018 3:41 PM, Maxime Coquelin wrote:
> 
> 
> On 04/11/2018 12:09 PM, Fan Zhang wrote:
>> Fixes: cd39f8e4fd2a ("vhost/crypto: add request handler")
>>
>> This patch fixes the descriptor moving for copy mode by adding
>> the missing moving step after destination data parsing.
>>
>> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
>> ---
>>   lib/librte_vhost/vhost_crypto.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
> 
> Applied to dpdk-next-virtio/master

Squashed into relevant commit in next-net, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-11 17:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-11 10:09 [dpdk-dev] [PATCH] vhost/crypto: fix desc moving for copy mode Fan Zhang
2018-04-11 14:38 ` Maxime Coquelin
2018-04-11 14:41 ` Maxime Coquelin
2018-04-11 17:36   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).