aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40evf/i40evf_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2017-12-29 08:50:44 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-02-12 13:54:25 -0500
commit8b99b1179c27958f51ecfc489af5f459f9408d96 (patch)
tree59b2e84afbe799b20ded2085a5e889eb8f8d7d19 /drivers/net/ethernet/intel/i40evf/i40evf_main.c
parentfe09ed0ee1f57a818e4d7e41b25f16744487e678 (diff)
i40e/i40evf: Clean-up of bits related to using q_vector->reg_idx
This patch is a further clean-up related to the change over to using q_vector->reg_idx when accessing the ITR registers. Specifically the code appears to have several other spots where we were computing the register offset manually and this resulted in errors in a few spots. Specifically in the i40evf functions for mapping queues to vectors it appears we may have had an off by 1 error since (v_idx - 1) for the first q_vector with an index of 0 would result in us returning -1 if I am not mistaken. Signed-off-by: Alexander Duyck <alexander.h.duyck@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/i40evf/i40evf_main.c')
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index a5fb540c2637..f648e5e97529 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -357,7 +357,8 @@ i40evf_map_vector_to_rxq(struct i40evf_adapter *adapter, int v_idx, int r_idx)
357 q_vector->rx.itr = ITR_TO_REG(rx_ring->itr_setting); 357 q_vector->rx.itr = ITR_TO_REG(rx_ring->itr_setting);
358 q_vector->ring_mask |= BIT(r_idx); 358 q_vector->ring_mask |= BIT(r_idx);
359 q_vector->itr_countdown = ITR_COUNTDOWN_START; 359 q_vector->itr_countdown = ITR_COUNTDOWN_START;
360 wr32(hw, I40E_VFINT_ITRN1(I40E_RX_ITR, v_idx - 1), q_vector->rx.itr); 360 wr32(hw, I40E_VFINT_ITRN1(I40E_RX_ITR, q_vector->reg_idx),
361 q_vector->rx.itr);
361} 362}
362 363
363/** 364/**
@@ -382,7 +383,8 @@ i40evf_map_vector_to_txq(struct i40evf_adapter *adapter, int v_idx, int t_idx)
382 q_vector->tx.itr = ITR_TO_REG(tx_ring->itr_setting); 383 q_vector->tx.itr = ITR_TO_REG(tx_ring->itr_setting);
383 q_vector->itr_countdown = ITR_COUNTDOWN_START; 384 q_vector->itr_countdown = ITR_COUNTDOWN_START;
384 q_vector->num_ringpairs++; 385 q_vector->num_ringpairs++;
385 wr32(hw, I40E_VFINT_ITRN1(I40E_TX_ITR, v_idx - 1), q_vector->tx.itr); 386 wr32(hw, I40E_VFINT_ITRN1(I40E_TX_ITR, q_vector->reg_idx),
387 q_vector->tx.itr);
386} 388}
387 389
388/** 390/**