qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 06/13] tap: Drop tap_can_send


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v3 06/13] tap: Drop tap_can_send
Date: Tue, 2 Jun 2015 17:21:34 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, May 19, 2015 at 10:51:03AM +0000, Fam Zheng wrote:
> -    while (qemu_can_send_packet(&s->nc)) {
> +    while (true) {
> +        bool can_send;
>          uint8_t *buf = s->buf;
>  
> +        can_send = qemu_can_send_packet(&s->nc);
> +
>          size = tap_read_packet(s->fd, s->buf, sizeof(s->buf));
>          if (size <= 0) {
>              break;
> @@ -204,8 +198,12 @@ static void tap_send(void *opaque)
>              size -= s->host_vnet_hdr_len;
>          }
>  
> +        /* If !can_send, we will want to disable the read poll, but we still
> +         * need the send completion callback to enable it again, which is a
> +         * sign of peer becoming ready.  So call the send function anyway.
> +         */
>          size = qemu_send_packet_async(&s->nc, buf, size, tap_send_completed);
> -        if (size == 0) {
> +        if (size == 0 || !can_send) {
>              tap_read_poll(s, false);
>              break;
>          } else if (size < 0) {

Why is can_send necessary here but not for the other netdevs that you
converted?  I thought relying on size == 0 is enough.

Attachment: pgpHRDSPo44rI.pgp
Description: PGP signature


reply via email to

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