diff options
author | Anjali Singhai Jain <anjali.singhai@intel.com> | 2015-02-24 01:58:50 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-03-03 04:07:29 -0500 |
commit | 66ddcffb1afb009d352115a61e25c237915d9e04 (patch) | |
tree | f2da2a3d6a7d6efa52dfc054f6dd55e83260cb18 | |
parent | 5db4cb59cdf1c4ce3c0fe8ecbcdb0f4694fe4986 (diff) |
i40e: Fix RSS size at init since default num queue calculation has changed
With changes to default number of queue pairs that the interface comes up with
from 1 per online CPU to 1 per lan_msix, we need to make sure we recalculate
rss_size. We will now recalculate rss_size based on number of queues enabled in
the VSI.
Without this fix if the max_lan_msix < num_online_cpu we will be coming up
with fewer queues but will be populating rss_size based on num_online_cpus.
This will result in packets getting silently dropped because RSS LUT has queues
that are not enabled.
Change-ID: Ifac8796ce1be1758bb0c34f38dbf4a3a76621e76
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index e7ceae8a0276..cfc1d8a52e42 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h | |||
@@ -472,6 +472,7 @@ struct i40e_vsi { | |||
472 | u16 tx_itr_setting; | 472 | u16 tx_itr_setting; |
473 | 473 | ||
474 | u16 rss_table_size; | 474 | u16 rss_table_size; |
475 | u16 rss_size; | ||
475 | 476 | ||
476 | u16 max_frame; | 477 | u16 max_frame; |
477 | u16 rx_hdr_len; | 478 | u16 rx_hdr_len; |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index d6d8c3041875..f9da8e805842 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -7207,6 +7207,7 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf) | |||
7207 | static int i40e_config_rss(struct i40e_pf *pf) | 7207 | static int i40e_config_rss(struct i40e_pf *pf) |
7208 | { | 7208 | { |
7209 | u32 rss_key[I40E_PFQF_HKEY_MAX_INDEX + 1]; | 7209 | u32 rss_key[I40E_PFQF_HKEY_MAX_INDEX + 1]; |
7210 | struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; | ||
7210 | struct i40e_hw *hw = &pf->hw; | 7211 | struct i40e_hw *hw = &pf->hw; |
7211 | u32 lut = 0; | 7212 | u32 lut = 0; |
7212 | int i, j; | 7213 | int i, j; |
@@ -7224,6 +7225,8 @@ static int i40e_config_rss(struct i40e_pf *pf) | |||
7224 | wr32(hw, I40E_PFQF_HENA(0), (u32)hena); | 7225 | wr32(hw, I40E_PFQF_HENA(0), (u32)hena); |
7225 | wr32(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32)); | 7226 | wr32(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32)); |
7226 | 7227 | ||
7228 | vsi->rss_size = min_t(int, pf->rss_size, vsi->num_queue_pairs); | ||
7229 | |||
7227 | /* Check capability and Set table size and register per hw expectation*/ | 7230 | /* Check capability and Set table size and register per hw expectation*/ |
7228 | reg_val = rd32(hw, I40E_PFQF_CTL_0); | 7231 | reg_val = rd32(hw, I40E_PFQF_CTL_0); |
7229 | if (hw->func_caps.rss_table_size == 512) { | 7232 | if (hw->func_caps.rss_table_size == 512) { |
@@ -7245,7 +7248,7 @@ static int i40e_config_rss(struct i40e_pf *pf) | |||
7245 | * If LAN VSI is the only consumer for RSS then this requirement | 7248 | * If LAN VSI is the only consumer for RSS then this requirement |
7246 | * is not necessary. | 7249 | * is not necessary. |
7247 | */ | 7250 | */ |
7248 | if (j == pf->rss_size) | 7251 | if (j == vsi->rss_size) |
7249 | j = 0; | 7252 | j = 0; |
7250 | /* lut = 4-byte sliding window of 4 lut entries */ | 7253 | /* lut = 4-byte sliding window of 4 lut entries */ |
7251 | lut = (lut << 8) | (j & | 7254 | lut = (lut << 8) | (j & |