linux/drivers/net/ethernet/intel/fm10k
Jacob Keller 4b09728e9d fm10k: drop transmitted messages in Tx FIFO as part of reset_work
This patch fixes a corner case issue with the PF/VF mailbox code.
Currently, fm10k_mbx_reset_work clears various state about the mailbox.
However, it does not clear the Tx FIFO head/tail pointers. We can't
simply clear these pointers as we unintentionally drop untransmitted
messages without error.

Doing nothing results in a possible phantom re-transmission of messages,
since we leave tx.head and tx.tail intact, but clear the tx_pulled and
tail_len values. This means that the PF could continuously re-send a
message which triggers a reset in the VF. Upon reset, the VF will
re-receive the same message after a reconnect.

If we reset the tx.head and tx.tail pointers completely, we end up
dropping some messages that were pending before connect. This results in
missing LPORT_MSG_READY bits, and VFs will end up reporting no link.

However, we can resolve both issues by simply incrementing head to
account for the already transmitted messages, before we reset tx_pulled.
We do this via the same logic as fm10k_mbx_head_pull.

We account for the tail_len which includes all data not yet transmitted,
once we account for the acked data which means re-reading the HEAD
variable from the message header. Then, we drop messages until we've
dropped more than the new tx_pulled value. At this point, resetting
tail_len and tx_pulled, but not tx.head and tx.tail will result in
prevention of the phantom message. It also prevents us from dropping
untransmitted messages upon attempting to Tx into a connect or
disconnect header.

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>
2015-09-22 15:58:27 -07:00
..
fm10k_common.c fm10k: Resolve various spelling errors and checkpatch warnings 2015-03-03 01:07:23 -08:00
fm10k_common.h fm10k: Add support for ptp to hw specific files 2014-09-23 03:59:22 -07:00
fm10k_dcbnl.c fm10k: fix unused warnings 2015-04-14 15:23:36 -07:00
fm10k_debugfs.c fm10k: TRIVIAL fix up ordering of __always_unused and style 2015-09-15 17:06:00 -07:00
fm10k_ethtool.c fm10k: Fix missing braces after if statement 2015-06-17 14:21:41 -07:00
fm10k_iov.c fm10k: don't store sw_vid at reset 2015-09-15 17:05:51 -07:00
fm10k_main.c fm10k: send traffic on default VID to VLAN device if we have one 2015-09-15 17:06:04 -07:00
fm10k_mbx.c fm10k: drop transmitted messages in Tx FIFO as part of reset_work 2015-09-22 15:58:27 -07:00
fm10k_mbx.h fm10k: Add support for PF <-> VF mailbox 2014-09-23 03:59:20 -07:00
fm10k_netdev.c fm10k: TRIVIAL fix typo in fm10k_netdev.c 2015-09-15 17:06:09 -07:00
fm10k_pci.c fm10k: remove comment about rtnl_lock around mbx operations 2015-09-22 15:58:26 -07:00
fm10k_pf.c fm10k: fix iov_msg_mac_vlan_pf VID checks 2015-09-15 17:06:23 -07:00
fm10k_pf.h fm10k: pack TLV overlay structures 2015-06-17 14:21:22 -07:00
fm10k_ptp.c fm10k: fix incorrect free on skb in ts_tx_enqueue 2015-06-17 14:20:36 -07:00
fm10k_tlv.c fm10k: Resolve various spelling errors and checkpatch warnings 2015-03-03 01:07:23 -08:00
fm10k_tlv.h fm10k: Add support for mailbox 2014-09-23 03:59:14 -07:00
fm10k_type.h fm10k: remove is_slot_appropriate 2015-09-15 17:05:55 -07:00
fm10k_vf.c fm10k: remove is_slot_appropriate 2015-09-15 17:05:55 -07:00
fm10k_vf.h fm10k: Add support for ptp to hw specific files 2014-09-23 03:59:22 -07:00
fm10k.h fm10k: use separate workqueue for fm10k driver 2015-04-14 15:38:06 -07:00
Makefile fm10k: Add support for PTP 2014-09-23 03:59:23 -07:00