[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+U0gVizSTd0ynJUQD7FwrpeTJyc8RttauT_eZk=xuOfuBgtvw@mail.gmail.com>
Date: Fri, 9 Jan 2015 10:28:51 +0800
From: Dennis Chen <kernel.org.gnu@...il.com>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc: netdev <netdev@...r.kernel.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
Miller <davem@...emloft.net>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH] net: Prevent multiple NAPI instances co-existing in the list
hello,
On Thu, Jan 8, 2015 at 9:04 PM, Sergei Shtylyov
<sergei.shtylyov@...entembedded.com> wrote:
> Hello.
>
> On 1/8/2015 11:22 AM, Dennis Chen wrote:
>
>> Some drivers may clear the NAPI_STATE_SCHED bit upon the state of the
>> NAPI instance after exhaust the budget in the poll function, which
>> will open a window for next device interrupt handler to insert a same
>> instance to the list after calling list_add_tail(&n->poll_list,
>> repoll) if we don't set this bit.
>
>
>> Signed-off-by: Dennis Chen <kernel.org.gnu@...il.com>
>> ---
>> net/core/dev.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>
>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 683d493..b3107ac 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -4619,6 +4619,14 @@ static int napi_poll(struct napi_struct *n,
>> struct list_head *repoll)
>> n->dev ? n->dev->name : "backlog");
>> goto out_unlock;
>> }
>> +
>> + /* Some drivers may exit the polling mode when exhaust the
>
>
> s/exhaust/exhausting/.
>
>> + * budget. Set the NAPI_STATE_SCHED bit to prevent multiple NAPI
>> + * instances in the list in case of next device interrupt raised.
>> + */
>> + if (unlikely(!test_and_set_bit(NAPI_STATE_SCHED, &n->state)))
>> + pr_warn_once("%s: exit polling mode after exhaust the
>> budget\n",
>
>
> Likewise. And s/exit/exiting/.
>
> WBR, Sergei
>
will be updated if applied :-)
--
Den
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists