• Eric Dumazet's avatar
    netpoll: make ndo_poll_controller() optional · ac3d9dd0
    Eric Dumazet authored
    As diagnosed by Song Liu, ndo_poll_controller() can
    be very dangerous on loaded hosts, since the cpu
    calling ndo_poll_controller() might steal all NAPI
    contexts (for all RX/TX queues of the NIC). This capture
    can last for unlimited amount of time, since one
    cpu is generally not able to drain all the queues under load.
    
    It seems that all networking drivers that do use NAPI
    for their TX completions, should not provide a ndo_poll_controller().
    
    NAPI drivers have netpoll support already handled
    in core networking stack, since netpoll_poll_dev()
    uses poll_napi(dev) to iterate through registered
    NAPI contexts for a device.
    
    This patch allows netpoll_poll_dev() to process NAPI
    contexts even for drivers not providing ndo_poll_controller(),
    allowing for following patches in NAPI drivers.
    
    Also we export netpoll_poll_dev() so that it can be called
    by bonding/team drivers in following patches.
    Reported-by: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Tested-by: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ac3d9dd0
netpoll.c 19.6 KB