• Sebastian Andrzej Siewior's avatar
    net: dev: Make rps_lock() disable interrupts. · e722db8d
    Sebastian Andrzej Siewior authored
    Disabling interrupts and in the RPS case locking input_pkt_queue is
    split into local_irq_disable() and optional spin_lock().
    
    This breaks on PREEMPT_RT because the spinlock_t typed lock can not be
    acquired with disabled interrupts.
    The sections in which the lock is acquired is usually short in a sense that it
    is not causing long und unbounded latiencies. One exception is the
    skb_flow_limit() invocation which may invoke a BPF program (and may
    require sleeping locks).
    
    By moving local_irq_disable() + spin_lock() into rps_lock(), we can keep
    interrupts disabled on !PREEMPT_RT and enabled on PREEMPT_RT kernels.
    Without RPS on a PREEMPT_RT kernel, the needed synchronisation happens
    as part of local_bh_disable() on the local CPU.
    ____napi_schedule() is only invoked if sd is from the local CPU. Replace
    it with __napi_schedule_irqoff() which already disables interrupts on
    PREEMPT_RT as needed. Move this call to rps_ipi_queued() and rename the
    function to napi_schedule_rps as suggested by Jakub.
    Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
    Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    e722db8d
dev.c 276 KB