diff options
author | Brett Creeley <brett.creeley@intel.com> | 2018-10-26 13:41:00 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2018-11-13 12:09:25 -0500 |
commit | 807bc98d31097bfe22fbf8236413db5490932456 (patch) | |
tree | 36ce112564a29a70a7fba8e8af7a99e7b2895b01 /drivers/net/ethernet/intel/ice/ice_main.c | |
parent | 3e536cff34244959c81575733c9ca60633f74e1b (diff) |
ice: Fix debug print in ice_tx_timeout
Currently the debug print in ice_tx_timeout is printing useless and
duplicate values. First, head is being assigned to tx_ring->next_to_clean
and we are printing both of those values, but naming them HWB and NTC
respectively. Also, reading tail always returns 0 so remove that as well.
Instead of assigning the SW head (NTC) read to head, use the actual head
register and change the debug print to note that this is HW_HEAD. Also
reduce the scope of a couple variables.
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_main.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 333312a1d595..8584061e1bc6 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c | |||
@@ -3691,8 +3691,8 @@ static void ice_tx_timeout(struct net_device *netdev) | |||
3691 | struct ice_ring *tx_ring = NULL; | 3691 | struct ice_ring *tx_ring = NULL; |
3692 | struct ice_vsi *vsi = np->vsi; | 3692 | struct ice_vsi *vsi = np->vsi; |
3693 | struct ice_pf *pf = vsi->back; | 3693 | struct ice_pf *pf = vsi->back; |
3694 | u32 head, val = 0, i; | ||
3695 | int hung_queue = -1; | 3694 | int hung_queue = -1; |
3695 | u32 i; | ||
3696 | 3696 | ||
3697 | pf->tx_timeout_count++; | 3697 | pf->tx_timeout_count++; |
3698 | 3698 | ||
@@ -3736,17 +3736,20 @@ static void ice_tx_timeout(struct net_device *netdev) | |||
3736 | return; | 3736 | return; |
3737 | 3737 | ||
3738 | if (tx_ring) { | 3738 | if (tx_ring) { |
3739 | head = tx_ring->next_to_clean; | 3739 | struct ice_hw *hw = &pf->hw; |
3740 | u32 head, val = 0; | ||
3741 | |||
3742 | head = (rd32(hw, QTX_COMM_HEAD(vsi->txq_map[hung_queue])) & | ||
3743 | QTX_COMM_HEAD_HEAD_M) >> QTX_COMM_HEAD_HEAD_S; | ||
3740 | /* Read interrupt register */ | 3744 | /* Read interrupt register */ |
3741 | if (test_bit(ICE_FLAG_MSIX_ENA, pf->flags)) | 3745 | if (test_bit(ICE_FLAG_MSIX_ENA, pf->flags)) |
3742 | val = rd32(&pf->hw, | 3746 | val = rd32(hw, |
3743 | GLINT_DYN_CTL(tx_ring->q_vector->v_idx + | 3747 | GLINT_DYN_CTL(tx_ring->q_vector->v_idx + |
3744 | tx_ring->vsi->hw_base_vector)); | 3748 | tx_ring->vsi->hw_base_vector)); |
3745 | 3749 | ||
3746 | netdev_info(netdev, "tx_timeout: VSI_num: %d, Q %d, NTC: 0x%x, HWB: 0x%x, NTU: 0x%x, TAIL: 0x%x, INT: 0x%x\n", | 3750 | netdev_info(netdev, "tx_timeout: VSI_num: %d, Q %d, NTC: 0x%x, HW_HEAD: 0x%x, NTU: 0x%x, INT: 0x%x\n", |
3747 | vsi->vsi_num, hung_queue, tx_ring->next_to_clean, | 3751 | vsi->vsi_num, hung_queue, tx_ring->next_to_clean, |
3748 | head, tx_ring->next_to_use, | 3752 | head, tx_ring->next_to_use, val); |
3749 | readl(tx_ring->tail), val); | ||
3750 | } | 3753 | } |
3751 | 3754 | ||
3752 | pf->tx_timeout_last_recovery = jiffies; | 3755 | pf->tx_timeout_last_recovery = jiffies; |