qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/10] tests/vhost-user-bridge: workaround stale


From: Victor Kaplansky
Subject: Re: [Qemu-devel] [PATCH 03/10] tests/vhost-user-bridge: workaround stale vring base
Date: Thu, 9 Jun 2016 13:07:42 +0300

On Mon, Jun 06, 2016 at 06:45:01PM +0200, address@hidden wrote:
> From: Marc-André Lureau <address@hidden>
> 
> This patch is a similar solution to what Yuanhan Liu/Huawei Xie have
> suggested for DPDK. When vubr quits (killed or crashed), a restart of
> vubr would get stale vring base from QEMU. That would break the kernel
> virtio net completely, making it non-work any more, unless a driver
> reset is done.
> 
> So, instead of getting the stale vring base from QEMU, Huawei suggested
> we could get a proper one from used->idx. This works because the queues
> packets are processed in order.
> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> Tested-by: Yuanhan Liu <address@hidden>
> Reviewed-by: Yuanhan Liu <address@hidden>
> ---
>  tests/vhost-user-bridge.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
> index f907ce7..38963e4 100644
> --- a/tests/vhost-user-bridge.c
> +++ b/tests/vhost-user-bridge.c
> @@ -946,6 +946,13 @@ vubr_set_vring_addr_exec(VubrDev *dev, VhostUserMsg 
> *vmsg)
>      DPRINT("    vring_avail at %p\n", vq->avail);
>  
>      vq->last_used_index = vq->used->idx;
> +
> +    if (vq->last_avail_index != vq->used->idx) {
> +        DPRINT("Last avail index != used index: %d != %d, resuming",
> +               vq->last_avail_index, vq->used->idx);
> +        vq->last_avail_index = vq->used->idx;
> +    }
> +

What if set_vring_base is called after set_vring_addr?
Maybe it is worth to add the fixup to the set_vring_base as well?

>      return 0;
>  }
>  
> -- 
> 2.7.4
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]