• Eric Dumazet's avatar
    bnx2x: Fix busy_poll vs netpoll · 63f49b7f
    Eric Dumazet authored
    [ Upstream commit 074975d0 ]
    
    Commit 9a2620c8 ("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: 9a2620c8 ("bnx2x: prevent WARN during driver unload")
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    63f49b7f
bnx2x_cmn.c 133 KB