]> git.baikalelectronics.ru Git - kernel.git/commit
bnx2x: Fix busy_poll vs netpoll
authorEric Dumazet <edumazet@google.com>
Wed, 15 Apr 2015 01:45:00 +0000 (18:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Apr 2015 21:25:02 +0000 (17:25 -0400)
commite11f90e8dafac83918e6d4ec8a0dd085953d3b6d
treea91d7441c8dbe9935b77bf2e5aca47f1c3726df9
parentec7814367f799caf57c920d91ce35b6df020f639
bnx2x: Fix busy_poll vs netpoll

Commit 8cb65cc91881b ("bnx2x: prevent WARN during driver unload")
switched the napi/busy_lock locking mechanism from spin_lock() into
spin_lock_bh(), breaking inter-operability with netconsole, as netpoll
disables interrupts prior to calling our napi mechanism.

This switches the driver into using atomic assignments instead of the
spinlock mechanisms previously employed.

Based on initial patch from Yuval Mintz & Ariel Elior

I basically added softirq starvation avoidance, and mixture
of atomic operations, plain writes and barriers.

Note this slightly reduces the overhead for this driver when no
busy_poll sockets are in use.

Fixes: 8cb65cc91881b ("bnx2x: prevent WARN during driver unload")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c