qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] virtIO question


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] virtIO question
Date: Mon, 14 Nov 2016 14:06:03 +0000
User-agent: Mutt/1.7.1 (2016-10-04)

On Sat, Nov 12, 2016 at 04:43:21PM +0800, address@hidden wrote:
> Thanks,the expression is not the key problem,I just write it wrong,the key 
> problem is that what I get from the code is everytime dirver add a sg ,it 
> will call virtqueue_kick,such as network driver,in start_xmit function ,it 
> called xmit_skb generate a sg list and add it to the queue,then called 
> virtqueue_kick ,why it handle like this??can you explain it to me??thank you 
> very much!!!

I can see there *are* cases in Linux 4.9-rc1 virtio_net.c:start_xmit()
where virtqueue_kick() is skipped so that multiple tx packets can be
added to the virtqueue in a single kick.

static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
{
        ...
        bool kick = !skb->xmit_more;

        ...
        if (kick || netif_xmit_stopped(txq))
                virtqueue_kick(sq->vq);
        ...
}

Also keep in mind that the virtio driver APIs in Linux are used by
multiple device drivers (virtio_net.ko, virtio_blk.ko, etc).
virtio_net.ko does not use all features offered by the API.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

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