* [RFC] NAPI behavior when (work < weight)
@ 2015-02-04 13:22 Vladimir Kondratiev
2015-02-04 13:37 ` Eric Dumazet
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Kondratiev @ 2015-02-04 13:22 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Herbert Xu, Eric Dumazet, Tom Herbert,
Vlad Yasevich, Jiri Pirko, John Fastabend, Joe Perches
Hi
I am observing that if driver does not calls napi_complete() when
less than full budget consumed, various strange things happen.
For example, if driver going to napi_disable(), it may wait forever
in the loop:
while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
msleep(1);
if last NAPI consumed less then full budget, because bit
NAPI_STATE_SCHED never cleared.
Is it expected that driver calls napi_complete() when less than full
budget consumed? Documentation does not say so.
What is intended behavior in case above?
Thanks, Vladimir
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC] NAPI behavior when (work < weight)
2015-02-04 13:22 [RFC] NAPI behavior when (work < weight) Vladimir Kondratiev
@ 2015-02-04 13:37 ` Eric Dumazet
0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2015-02-04 13:37 UTC (permalink / raw)
To: Vladimir Kondratiev
Cc: netdev, David S. Miller, Herbert Xu, Eric Dumazet, Tom Herbert,
Vlad Yasevich, Jiri Pirko, John Fastabend, Joe Perches
On Wed, 2015-02-04 at 15:22 +0200, Vladimir Kondratiev wrote:
> Hi
>
> I am observing that if driver does not calls napi_complete() when
> less than full budget consumed, various strange things happen.
>
> For example, if driver going to napi_disable(), it may wait forever
> in the loop:
>
> while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
> msleep(1);
>
> if last NAPI consumed less then full budget, because bit
> NAPI_STATE_SCHED never cleared.
>
> Is it expected that driver calls napi_complete() when less than full
> budget consumed? Documentation does not say so.
>
> What is intended behavior in case above?
A driver must call napi_complete() (or better : napi_complete_done() )
when/if returning work_done < budget
Thats because of the way we have to rearm interrupts in the driver,
_after_ calling napi_complete()
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-04 13:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-04 13:22 [RFC] NAPI behavior when (work < weight) Vladimir Kondratiev
2015-02-04 13:37 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox