Re: [PATCH v2] netpoll: Close race condition between poll_one_napi and napi_disable

2015-09-23 Thread David Miller
From: Neil Horman Date: Tue, 22 Sep 2015 16:01:36 -0400 > - set_bit(NAPI_STATE_NPSVC, &napi->state); > + /* > + * If we set this bit but see that it has already been set, > + * that indicates that napi has been disabled and we need > + * to abort this operation > + */

Re: [PATCH v2] netpoll: Close race condition between poll_one_napi and napi_disable

2015-09-23 Thread Neil Horman
On Tue, Sep 22, 2015 at 03:09:20PM -0700, Stephen Hemminger wrote: > On Tue, 22 Sep 2015 16:01:36 -0400 > Neil Horman wrote: > > > + clear_bit(NAPI_STATE_NPSVC, &n->state); > > + > > } > why introduce extra line here? > > > + /* > > +* If we set this bit but see that it has already been

Re: [PATCH v2] netpoll: Close race condition between poll_one_napi and napi_disable

2015-09-22 Thread Stephen Hemminger
On Tue, 22 Sep 2015 16:01:36 -0400 Neil Horman wrote: > + clear_bit(NAPI_STATE_NPSVC, &n->state); > + > } why introduce extra line here? > + /* > + * If we set this bit but see that it has already been set, > + * that indicates that napi has been disabled and we need > +

[PATCH v2] netpoll: Close race condition between poll_one_napi and napi_disable

2015-09-22 Thread Neil Horman
Drivers might call napi_disable while not holding the napi instance poll_lock. In those instances, its possible for a race condition to exist between poll_one_napi and napi_disable. That is to say, poll_one_napi only tests the NAPI_STATE_SCHED bit to see if there is work to do during a poll, and a