aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-04-03 16:27:13 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-04-14 18:56:22 -0400
commit78288e3750c568f0f95db235a06475db3b1a122a (patch)
tree9f9aaf8c51491fbca0a417de0cf1d9a176850590 /drivers/net/ethernet/intel
parent750c607e303971e1746f98bfeec17bf45cbf228d (diff)
fm10k: reset head instead of calling update_max_size
When we forcefully shutdown the mailbox, we then go about resetting max size to 0, and clearing all messages in the FIFO. Instead, we should just reset the head pointer so that the FIFO becomes empty, rather than changing the max size to 0. This helps prevent increment in tx_dropped counter during mailbox negotiation, which is confusing to viewers of Linux ethtool statistics output. Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Acked-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_mbx.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c
index e9ecfb422db2..27f82791e39a 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c
@@ -126,6 +126,18 @@ static u16 fm10k_fifo_head_drop(struct fm10k_mbx_fifo *fifo)
126} 126}
127 127
128/** 128/**
129 * fm10k_fifo_drop_all - Drop all messages in FIFO
130 * @fifo: pointer to FIFO
131 *
132 * This function resets the head pointer to drop all messages in the FIFO,
133 * and ensure the FIFO is empty.
134 **/
135static void fm10k_fifo_drop_all(struct fm10k_mbx_fifo *fifo)
136{
137 fifo->head = fifo->tail;
138}
139
140/**
129 * fm10k_mbx_index_len - Convert a head/tail index into a length value 141 * fm10k_mbx_index_len - Convert a head/tail index into a length value
130 * @mbx: pointer to mailbox 142 * @mbx: pointer to mailbox
131 * @head: head index 143 * @head: head index
@@ -1370,9 +1382,11 @@ static void fm10k_mbx_disconnect(struct fm10k_hw *hw,
1370 timeout -= FM10K_MBX_POLL_DELAY; 1382 timeout -= FM10K_MBX_POLL_DELAY;
1371 } while ((timeout > 0) && (mbx->state != FM10K_STATE_CLOSED)); 1383 } while ((timeout > 0) && (mbx->state != FM10K_STATE_CLOSED));
1372 1384
1373 /* in case we didn't close just force the mailbox into shutdown */ 1385 /* in case we didn't close, just force the mailbox into shutdown and
1386 * drop all left over messages in the FIFO.
1387 */
1374 fm10k_mbx_connect_reset(mbx); 1388 fm10k_mbx_connect_reset(mbx);
1375 fm10k_mbx_update_max_size(mbx, 0); 1389 fm10k_fifo_drop_all(&mbx->tx);
1376 1390
1377 fm10k_write_reg(hw, mbx->mbmem_reg, 0); 1391 fm10k_write_reg(hw, mbx->mbmem_reg, 0);
1378} 1392}