On Sat, Nov 12, 2016 at 04:43:21PM +0800, zhun...@gmail.com 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
signature.asc
Description: PGP signature