All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: "zhunxun@gmail.com" <zhunxun@gmail.com>
Cc: qemu <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] virtIO question
Date: Mon, 14 Nov 2016 14:06:03 +0000	[thread overview]
Message-ID: <20161114140603.GC26198@stefanha-x1.localdomain> (raw)
In-Reply-To: <201611121643189598926@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

On Sat, Nov 12, 2016 at 04:43:21PM +0800, zhunxun@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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2016-11-14 14:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-05 10:50 [Qemu-devel] virtIO question zhunxun
2016-11-05 14:46 ` jitendra kumar khasdev
2016-11-05 15:04   ` Peter Maydell
2016-11-05 15:11     ` jitendra kumar khasdev
2016-11-09 10:58       ` zhunxun
2016-11-10 10:32         ` Stefan Hajnoczi
2016-11-10 12:16           ` zhunxun
2016-11-11 12:03             ` Stefan Hajnoczi
2016-11-12  8:43               ` zhunxun
2016-11-14 14:06                 ` Stefan Hajnoczi [this message]
2016-11-14  7:14               ` zhunxun
2016-11-05 15:23 jack
2016-11-11 14:17 jack
2016-11-14 12:36 zhunxun
2016-11-14 16:36 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161114140603.GC26198@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhunxun@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.