[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v4 04/15] net: resolve race of tap backend a
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC PATCH v4 04/15] net: resolve race of tap backend and its peer |
Date: |
Thu, 18 Apr 2013 16:11:44 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Apr 17, 2013 at 04:39:13PM +0800, Liu Ping Fan wrote:
> From: Liu Ping Fan <address@hidden>
>
> When vhost net enabled, we should be sure that the user space
> fd handler is not in flight
>
> Signed-off-by: Liu Ping Fan <address@hidden>
> ---
> net/tap.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/net/tap.c b/net/tap.c
> index 35cbb6e..b5629e3 100644
> --- a/net/tap.c
> +++ b/net/tap.c
> @@ -41,6 +41,7 @@
> #include "qemu/error-report.h"
>
> #include "net/tap.h"
> +#include "util/event_gsource.h"
>
> #include "hw/vhost_net.h"
>
> @@ -327,6 +328,10 @@ static void tap_poll(NetClientState *nc, bool enable)
> tap_read_poll(s, enable);
> tap_write_poll(s, enable);
>
> + if (!enable) {
> + /* need sync so vhost can take over polling */
> + g_source_remove_poll(&s->nsrc->source, &s->nsrc->gfd);
> + }
We must also re-enable it when .poll(nc, true) is called.
Please drop the comments the previous patch added. In fact, this patch
can be squashed.
I think there was another vhost sync comment which you haven't addressed
here. See the previous patch.
Stefan
[Qemu-devel] [RFC PATCH v4 02/15] net: introduce bind_ctx to NetClientInfo, Liu Ping Fan, 2013/04/17
[Qemu-devel] [RFC PATCH v4 03/15] net: port tap onto GSource, Liu Ping Fan, 2013/04/17
[Qemu-devel] [RFC PATCH v4 04/15] net: resolve race of tap backend and its peer, Liu Ping Fan, 2013/04/17
- Re: [Qemu-devel] [RFC PATCH v4 04/15] net: resolve race of tap backend and its peer,
Stefan Hajnoczi <=
[Qemu-devel] [RFC PATCH v4 05/15] net: port vde onto GSource, Liu Ping Fan, 2013/04/17
[Qemu-devel] [RFC PATCH v4 06/15] net: port socket to GSource, Liu Ping Fan, 2013/04/17
[Qemu-devel] [RFC PATCH v4 07/15] net: port tap-win32 onto GSource, Liu Ping Fan, 2013/04/17
[Qemu-devel] [RFC PATCH v4 08/15] net: hub use lock to protect ports list, Liu Ping Fan, 2013/04/17
[Qemu-devel] [RFC PATCH v4 09/15] net: introduce lock to protect NetQueue, Liu Ping Fan, 2013/04/17