[dpdk-dev] lib_vhost:reset secure_len when rte_atomic16_cmpset failed

Message ID 4ebbd24d-333e-4cc8-8c16-a4c6cc9dd85c@liw0310-PC.local (mailing list archive)
State Superseded, archived
Headers

Commit Message

Wei li June 1, 2015, 3 a.m. UTC
  ---
 lib/librte_vhost/vhost_rxtx.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Ouyang Changchun June 1, 2015, 4:49 a.m. UTC | #1
> -----Original Message-----
> From: Wei li [mailto:liw@dtdream.com]
> Sent: Monday, June 1, 2015 11:00 AM
> To: dev@dpdk.org
> Cc: Ouyang, Changchun
> Subject: [PATCH] lib_vhost:reset secure_len when rte_atomic16_cmpset
> failed
> 

The one line change is ok, but need more description.

> ---
>  lib/librte_vhost/vhost_rxtx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c
> index 4809d32..fb3e72a 100644
> --- a/lib/librte_vhost/vhost_rxtx.c
> +++ b/lib/librte_vhost/vhost_rxtx.c
> @@ -431,6 +431,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t
> queue_id,
>  			 */
>  			res_base_idx = vq->last_used_idx_res;
>  			res_cur_idx = res_base_idx;
> +			secure_len = 0;
> 
>  			do {
>  				avail_idx = *((volatile uint16_t *)&vq->avail-
> >idx);
> --
> 1.9.5.msysgit.1
>
  

Patch

diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c
index 4809d32..fb3e72a 100644
--- a/lib/librte_vhost/vhost_rxtx.c
+++ b/lib/librte_vhost/vhost_rxtx.c
@@ -431,6 +431,7 @@  virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id,
 			 */
 			res_base_idx = vq->last_used_idx_res;
 			res_cur_idx = res_base_idx;
+			secure_len = 0;
 
 			do {
 				avail_idx = *((volatile uint16_t *)&vq->avail->idx);