aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Williams <mitch.a.williams@intel.com>2014-02-11 03:26:32 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-03-14 19:30:04 -0400
commit9347eb771ece4fda0ad78c1c991f020af17abcb8 (patch)
tree0e1c8844501be82d24619783bba4d122f88db66c
parentc0c289759c815a67f176d6f8fa0e44a97f27e46d (diff)
i40e/i40evf: Use correct number of VF vectors
Now that the 2.4 firmware reports the correct number of MSI-X vectors, use this value correctly when communicating with the VF, and when setting up the interrupt linked list. The PF has always reported the correct number of MSI-X vectors, so we should never increment the value in the vf driver. Change-ID: Ifeefc631c321390192219ce2af9ada6180c1492f Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c9
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c2
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 42cc6ba88005..7839343b967b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -69,7 +69,7 @@ static inline bool i40e_vc_isvalid_vector_id(struct i40e_vf *vf, u8 vector_id)
69{ 69{
70 struct i40e_pf *pf = vf->pf; 70 struct i40e_pf *pf = vf->pf;
71 71
72 return vector_id <= pf->hw.func_caps.num_msix_vectors_vf; 72 return vector_id < pf->hw.func_caps.num_msix_vectors_vf;
73} 73}
74 74
75/***********************vf resource mgmt routines*****************/ 75/***********************vf resource mgmt routines*****************/
@@ -126,8 +126,8 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_idx,
126 reg_idx = I40E_VPINT_LNKLST0(vf->vf_id); 126 reg_idx = I40E_VPINT_LNKLST0(vf->vf_id);
127 else 127 else
128 reg_idx = I40E_VPINT_LNKLSTN( 128 reg_idx = I40E_VPINT_LNKLSTN(
129 (pf->hw.func_caps.num_msix_vectors_vf 129 ((pf->hw.func_caps.num_msix_vectors_vf - 1) * vf->vf_id) +
130 * vf->vf_id) + (vector_id - 1)); 130 (vector_id - 1));
131 131
132 if (vecmap->rxq_map == 0 && vecmap->txq_map == 0) { 132 if (vecmap->rxq_map == 0 && vecmap->txq_map == 0) {
133 /* Special case - No queues mapped on this vector */ 133 /* Special case - No queues mapped on this vector */
@@ -506,7 +506,8 @@ static void i40e_free_vf_res(struct i40e_vf *vf)
506 vf->lan_vsi_index = 0; 506 vf->lan_vsi_index = 0;
507 vf->lan_vsi_id = 0; 507 vf->lan_vsi_id = 0;
508 } 508 }
509 msix_vf = pf->hw.func_caps.num_msix_vectors_vf + 1; 509 msix_vf = pf->hw.func_caps.num_msix_vectors_vf;
510
510 /* disable interrupts so the VF starts in a known state */ 511 /* disable interrupts so the VF starts in a known state */
511 for (i = 0; i < msix_vf; i++) { 512 for (i = 0; i < msix_vf; i++) {
512 /* format is same for both registers */ 513 /* format is same for both registers */
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 11d0b61510b0..8daab3aacdc3 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1141,7 +1141,7 @@ static int i40evf_set_interrupt_capability(struct i40evf_adapter *adapter)
1141 * (roughly) twice the number of vectors as there are CPU's. 1141 * (roughly) twice the number of vectors as there are CPU's.
1142 */ 1142 */
1143 v_budget = min(pairs, (int)(num_online_cpus() * 2)) + NONQ_VECS; 1143 v_budget = min(pairs, (int)(num_online_cpus() * 2)) + NONQ_VECS;
1144 v_budget = min(v_budget, (int)adapter->vf_res->max_vectors + 1); 1144 v_budget = min(v_budget, (int)adapter->vf_res->max_vectors);
1145 1145
1146 /* A failure in MSI-X entry allocation isn't fatal, but it does 1146 /* A failure in MSI-X entry allocation isn't fatal, but it does
1147 * mean we disable MSI-X capabilities of the adapter. 1147 * mean we disable MSI-X capabilities of the adapter.