]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
i40e: Fix RSS size at init since default num queue calculation has changed
authorAnjali Singhai Jain <anjali.singhai@intel.com>
Tue, 24 Feb 2015 06:58:50 +0000 (06:58 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 3 Mar 2015 09:07:29 +0000 (01:07 -0800)
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>
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_main.c

index e7ceae8a0276ef78ba8bc652cf6cae7dee19c301..cfc1d8a52e42deffd88664768297bf30a01bc972 100644 (file)
@@ -472,6 +472,7 @@ struct i40e_vsi {
        u16 tx_itr_setting;
 
        u16 rss_table_size;
+       u16 rss_size;
 
        u16 max_frame;
        u16 rx_hdr_len;
index d6d8c3041875a3bbf6d572bf22c8ec893cf7bd01..f9da8e805842f5507eddef667c34619c17d0390c 100644 (file)
@@ -7207,6 +7207,7 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf)
 static int i40e_config_rss(struct i40e_pf *pf)
 {
        u32 rss_key[I40E_PFQF_HKEY_MAX_INDEX + 1];
+       struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
        struct i40e_hw *hw = &pf->hw;
        u32 lut = 0;
        int i, j;
@@ -7224,6 +7225,8 @@ static int i40e_config_rss(struct i40e_pf *pf)
        wr32(hw, I40E_PFQF_HENA(0), (u32)hena);
        wr32(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32));
 
+       vsi->rss_size = min_t(int, pf->rss_size, vsi->num_queue_pairs);
+
        /* Check capability and Set table size and register per hw expectation*/
        reg_val = rd32(hw, I40E_PFQF_CTL_0);
        if (hw->func_caps.rss_table_size == 512) {
@@ -7245,7 +7248,7 @@ static int i40e_config_rss(struct i40e_pf *pf)
                 * If LAN VSI is the only consumer for RSS then this requirement
                 * is not necessary.
                 */
-               if (j == pf->rss_size)
+               if (j == vsi->rss_size)
                        j = 0;
                /* lut = 4-byte sliding window of 4 lut entries */
                lut = (lut << 8) | (j &