From: Rusty Russell <rusty@rustcorp•com.au>
To: Linhaifeng <haifeng.lin@huawei•com>, netdev@vger•kernel.org
Cc: "Michael S. Tsirkin" <mst@redhat•com>,
virtualization@lists•linux-foundation.org
Subject: Re: virtio-net: why not always to set avail->flags to VRING_AVAIL_F_NO_INTERRUPT
Date: Fri, 05 Jun 2015 05:22:01 +0930 [thread overview]
Message-ID: <876173uu8u.fsf@rustcorp.com.au> (raw)
In-Reply-To: <556FB967.6010103@huawei.com>
Linhaifeng <haifeng.lin@huawei•com> writes:
> On 2015/6/4 9:13, Rusty Russell wrote:
>> Linhaifeng <haifeng.lin@huawei•com> writes:
>>> Hi,
>>>
>>> I'm a newbie and have a question about vring_new_virtqueue function.
>>>
>>> Why we set avail->flags to VRING_AVAIL_F_NO_INTERRUPT when no callbacks?
>>> I think we should set avail->flags to VRING_AVAIL_F_NO_INTERRUPT even if no callbacks.
>>
>> Hi Linhaifeng,
>>
>> Not sure I understand your question, but I'll try to answer.
>>
>> We don't set VRING_AVAIL_F_NO_INTERRUPT if there's a callback because we
>> want that callback called. Otherwise callback will never be used.
>>
>> Cheers,
>> Rusty.
>>
>>
>
> Hi Rusty,
>
> Thank you for your response.
>
> I mean should we set VRING_AVAIL_F_NO_INTERRUPT when virtqueue is initialized whether there is callback or not?
> As it would be set in function virtqueue_disable_cb and virtqueue_enable_cb_prepare later.
You're right, the callers could virtqueue_enable() specifically, but
I think most callers will want the virtqueue enabled immediately.
And remember, the VRING_AVAIL_F_NO_INTERRUPT is just a *hint*: the
device is allows to ignore it (this can happen due to race conditions,
for example).
Thanks,
Rusty.
prev parent reply other threads:[~2015-06-04 19:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 6:32 virtio-net: why not always to set avail->flags to VRING_AVAIL_F_NO_INTERRUPT Linhaifeng
2015-06-04 1:13 ` Rusty Russell
2015-06-04 2:35 ` Linhaifeng
2015-06-04 19:52 ` Rusty Russell [this message]
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=876173uu8u.fsf@rustcorp.com.au \
--to=rusty@rustcorp$(echo .)com.au \
--cc=haifeng.lin@huawei$(echo .)com \
--cc=mst@redhat$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=virtualization@lists$(echo .)linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox