···933 /* FIXME: Actually want DRIVER_ACTIVE here. */934 if (dev->desc->status & VIRTIO_CONFIG_S_DRIVER_OK)935 warn("network: no dma buffer!");00000936 /* We'll turn this back on if input buffers are registered. */937 return false;938 } else if (out_num)···972 add_device_fd(vq->dev->fd);973 /* Tell waker to listen to it again */974 write(waker_fd, &vq->dev->fd, sizeof(vq->dev->fd));0000000975}976977/* When the Guest tells us they updated the status field, we handle it. */···14381439 /* Network devices need a receive and a send queue, just like1440 * console. */1441- add_virtqueue(dev, VIRTQUEUE_NUM, enable_fd);1442 add_virtqueue(dev, VIRTQUEUE_NUM, handle_net_output);14431444 /* We need a socket to perform the magic network ioctls to bring up the
···933 /* FIXME: Actually want DRIVER_ACTIVE here. */934 if (dev->desc->status & VIRTIO_CONFIG_S_DRIVER_OK)935 warn("network: no dma buffer!");936+937+ /* Now tell it we want to know if new things appear. */938+ dev->vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY;939+ wmb();940+941 /* We'll turn this back on if input buffers are registered. */942 return false;943 } else if (out_num)···967 add_device_fd(vq->dev->fd);968 /* Tell waker to listen to it again */969 write(waker_fd, &vq->dev->fd, sizeof(vq->dev->fd));970+}971+972+static void net_enable_fd(int fd, struct virtqueue *vq)973+{974+ /* We don't need to know again when Guest refills receive buffer. */975+ vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY;976+ enable_fd(fd, vq);977}978979/* When the Guest tells us they updated the status field, we handle it. */···14261427 /* Network devices need a receive and a send queue, just like1428 * console. */1429+ add_virtqueue(dev, VIRTQUEUE_NUM, net_enable_fd);1430 add_virtqueue(dev, VIRTQUEUE_NUM, handle_net_output);14311432 /* We need a socket to perform the magic network ioctls to bring up the