* virtio-net: why not always to set avail->flags to VRING_AVAIL_F_NO_INTERRUPT
@ 2015-06-03 6:32 Linhaifeng
2015-06-04 1:13 ` Rusty Russell
0 siblings, 1 reply; 4+ messages in thread
From: Linhaifeng @ 2015-06-03 6:32 UTC (permalink / raw)
To: netdev
Cc: virtualization, rusty@rustcorp.com.au >> Rusty Russell,
Michael S. Tsirkin
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: virtio-net: why not always to set avail->flags to VRING_AVAIL_F_NO_INTERRUPT
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
0 siblings, 1 reply; 4+ messages in thread
From: Rusty Russell @ 2015-06-04 1:13 UTC (permalink / raw)
To: Linhaifeng, netdev; +Cc: virtualization, Michael S. Tsirkin
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: virtio-net: why not always to set avail->flags to VRING_AVAIL_F_NO_INTERRUPT
2015-06-04 1:13 ` Rusty Russell
@ 2015-06-04 2:35 ` Linhaifeng
2015-06-04 19:52 ` Rusty Russell
0 siblings, 1 reply; 4+ messages in thread
From: Linhaifeng @ 2015-06-04 2:35 UTC (permalink / raw)
To: Rusty Russell, netdev; +Cc: virtualization, Michael S. Tsirkin
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.
Regards,
Haifeng
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: virtio-net: why not always to set avail->flags to VRING_AVAIL_F_NO_INTERRUPT
2015-06-04 2:35 ` Linhaifeng
@ 2015-06-04 19:52 ` Rusty Russell
0 siblings, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2015-06-04 19:52 UTC (permalink / raw)
To: Linhaifeng, netdev; +Cc: Michael S. Tsirkin, virtualization
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-06-04 19:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).