OSDN Git Service

fm10k: stop spurious link down messages when Tx FIFO is full
authorJacob Keller <jacob.e.keller@intel.com>
Mon, 10 Jul 2017 20:23:04 +0000 (13:23 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 2 Oct 2017 14:40:31 +0000 (07:40 -0700)
commit5c66d1251d67714e9f6e6b0af18ca989109b876f
treed4116aee6c83456db365db748c9ae7e263b1d844
parent95f49d4bdee34dd0f68446bb260ab537f62ed9b3
fm10k: stop spurious link down messages when Tx FIFO is full

In fm10k_get_host_state_generic, we check the mailbox tx_read() function
to ensure that the mailbox is still open. This function also checks to
make sure we have space to transmit another message. Unfortunately, if
we just recently sent a bunch of messages (such as enabling hundreds of
VLANs on a VF) this can result in a race where the watchdog task thinks
the link went down just because we haven't had time to process all these
messages yet.

Instead, lets just check whether the mailbox is still open. This ensures
that we don't race with the Tx FIFO, and we only link down once the
mailbox is not open.

This is safe, because if the FIFO fills up and we're unable to send
a message for too long, we'll end up triggering the timeout detection
which results in a reset. Additionally, since we still check to ensure
the mailbox state is OPEN, we'll transition to link down whenever the
mailbox closes as well.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/fm10k/fm10k_common.c