• Jacob Keller's avatar
    fm10k: introduce a message queue for MAC/VLAN messages · fc917368
    Jacob Keller authored
    Under some circumstances, when dealing with a large number of MAC
    address or VLAN updates at once, the fm10k driver, particularly the VFs
    can overload the mailbox with too many messages at once.
    
    This results in a mailbox timeout, which causes the driver to initiate
    a reset. During the reset, we re-send all the same messages that
    originally caused the timeout. This results in a cycle of resets each
    triggering a future reset.
    
    To fix or avoid this, we introduce a workqueue item which monitors
    a queue of MAC and VLAN requests. These requests are queued to the end
    of the list, and we process as a FIFO periodically.
    
    Initially we only handle requests for the netdev, but we do handle
    unicast MAC addresses, multicast MAC addresses, and update VLAN
    requests.
    
    A future patch will add support to use this queue for handling MAC
    update requests from the VF<->PF mailbox.
    
    The MAC/VLAN work item will keep checking to make sure that each request
    does not overflow the mailbox and cause a timeout. If it might, then the
    work item will reschedule itself a short time later. This avoids any
    reset cycle, since we never send the message if the mailbox is not
    ready.
    
    As an alternative, we tried increasing the mailbox message FIFO, but
    this just delays the problem and results in needless memory waste on the
    system. Our new message queue is dynamically allocated so only uses as
    much memory as it needs. Additionally, it need not be contiguous like
    the Tx and Rx FIFOs.
    
    Note that this patch chose to only create a queue for MAC and VLAN
    messages, since these are the only messages sent in a large enough
    volume to cause the reset loop. Other messages are very unlikely to
    overflow the mailbox Tx FIFO so easily.
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: default avatarKrishneil Singh <krishneil.k.singh@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    fc917368
fm10k_pci.c 74 KB