Skip to content

Commit

Permalink
netpoll: do not test NAPI_STATE_SCHED in poll_one_napi()
Browse files Browse the repository at this point in the history
Since we do no longer require NAPI drivers to provide
an ndo_poll_controller(), napi_schedule() has not been done
before poll_one_napi() invocation.

So testing NAPI_STATE_SCHED is likely to cause early returns.

While we are at it, remove outdated comment.

Note to future bisections : This change might surface prior
bugs in drivers. See commit 73f21c6 ("bnxt_en: Fix TX
timeout during netpoll.") for one occurrence.

Fixes: ac3d9dd ("netpoll: make ndo_poll_controller() optional")
Signed-off-by: Eric Dumazet <[email protected]>
Tested-by: Song Liu <[email protected]>
Cc: Michael Chan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Sep 28, 2018
1 parent 05c5e9f commit c24498c
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,27 +135,9 @@ static void queue_process(struct work_struct *work)
}
}

/*
* Check whether delayed processing was scheduled for our NIC. If so,
* we attempt to grab the poll lock and use ->poll() to pump the card.
* If this fails, either we've recursed in ->poll() or it's already
* running on another CPU.
*
* Note: we don't mask interrupts with this lock because we're using
* trylock here and interrupts are already disabled in the softirq
* case. Further, we test the poll_owner to avoid recursion on UP
* systems where the lock doesn't exist.
*/
static void poll_one_napi(struct napi_struct *napi)
{
int work = 0;

/* net_rx_action's ->poll() invocations and our's are
* synchronized by this test which is only made while
* holding the napi->poll_lock.
*/
if (!test_bit(NAPI_STATE_SCHED, &napi->state))
return;
int work;

/* If we set this bit but see that it has already been set,
* that indicates that napi has been disabled and we need
Expand Down

0 comments on commit c24498c

Please sign in to comment.