Commit 552b9962 authored by Jacob Keller's avatar Jacob Keller Committed by Jeff Kirsher

i40e: use configured RSS key and lookup table in i40e_vsi_config_rss

A previous refactor added support to store user configuration for VSIs,
so that extra VSIs such as for VMDq can use this information when
configuring. Unfortunately the i40e_vsi_config_rss function was missed
in this refactor, and the values were being ignored. Fix this by
checking for the fields and using those instead of always using the
default values.
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 776b2e15
...@@ -8076,13 +8076,26 @@ static int i40e_vsi_config_rss(struct i40e_vsi *vsi) ...@@ -8076,13 +8076,26 @@ static int i40e_vsi_config_rss(struct i40e_vsi *vsi)
if (!(pf->flags & I40E_FLAG_RSS_AQ_CAPABLE)) if (!(pf->flags & I40E_FLAG_RSS_AQ_CAPABLE))
return 0; return 0;
if (!vsi->rss_size)
vsi->rss_size = min_t(int, pf->alloc_rss_size,
vsi->num_queue_pairs);
if (!vsi->rss_size)
return -EINVAL;
lut = kzalloc(vsi->rss_table_size, GFP_KERNEL); lut = kzalloc(vsi->rss_table_size, GFP_KERNEL);
if (!lut) if (!lut)
return -ENOMEM; return -ENOMEM;
/* Use the user configured hash keys and lookup table if there is one,
i40e_fill_rss_lut(pf, lut, vsi->rss_table_size, vsi->rss_size); * otherwise use default
netdev_rss_key_fill((void *)seed, I40E_HKEY_ARRAY_SIZE); */
vsi->rss_size = min_t(int, pf->alloc_rss_size, vsi->num_queue_pairs); if (vsi->rss_lut_user)
memcpy(lut, vsi->rss_lut_user, vsi->rss_table_size);
else
i40e_fill_rss_lut(pf, lut, vsi->rss_table_size, vsi->rss_size);
if (vsi->rss_hkey_user)
memcpy(seed, vsi->rss_hkey_user, I40E_HKEY_ARRAY_SIZE);
else
netdev_rss_key_fill((void *)seed, I40E_HKEY_ARRAY_SIZE);
ret = i40e_config_rss_aq(vsi, seed, lut, vsi->rss_table_size); ret = i40e_config_rss_aq(vsi, seed, lut, vsi->rss_table_size);
kfree(lut); kfree(lut);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment