diff options
author | Helin Zhang <helin.zhang@intel.com> | 2015-10-27 02:44:34 +0300 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-12-02 09:50:36 +0300 |
commit | 66f9af855a4df146713866f6076207edea44a4f5 (patch) | |
tree | 61f7a2e32158fe0920bebe6ce5ca440deb910a56 /drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | |
parent | 90b02b4392eb9778265ec6b4fef034010a937910 (diff) | |
download | linux-66f9af855a4df146713866f6076207edea44a4f5.tar.xz |
i40evf: add new fields to store user configuration of RSS
This patch adds new fields to i40e_vsi to store user configured
RSS config data and code to use it.
Change-ID: Ic5d3db8d9df52182b560248f8cdca9c5c7546879
Signed-off-by: Helin Zhang <helin.zhang@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_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c index a5209707bcf3..966863c93dc4 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c @@ -678,9 +678,7 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir, { struct i40evf_adapter *adapter = netdev_priv(netdev); struct i40e_vsi *vsi = &adapter->vsi; - u8 seed_def[I40EVF_HKEY_ARRAY_SIZE]; - u8 *seed = NULL, *lut; - int ret; + u8 *seed = NULL; u16 i; /* We do not allow change in unsupported parameters */ @@ -691,21 +689,28 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir, return 0; if (key) { - memcpy(seed_def, key, I40EVF_HKEY_ARRAY_SIZE); - seed = seed_def; + if (!vsi->rss_hkey_user) { + vsi->rss_hkey_user = kzalloc(I40EVF_HKEY_ARRAY_SIZE, + GFP_KERNEL); + if (!vsi->rss_hkey_user) + return -ENOMEM; + } + memcpy(vsi->rss_hkey_user, key, I40EVF_HKEY_ARRAY_SIZE); + seed = vsi->rss_hkey_user; + } + if (!vsi->rss_lut_user) { + vsi->rss_lut_user = kzalloc(I40EVF_HLUT_ARRAY_SIZE, + GFP_KERNEL); + if (!vsi->rss_lut_user) + return -ENOMEM; } - lut = kzalloc(I40EVF_HLUT_ARRAY_SIZE, GFP_KERNEL); - if (!lut) - return -ENOMEM; /* Each 32 bits pointed by 'indir' is stored with a lut entry */ for (i = 0; i < I40EVF_HLUT_ARRAY_SIZE; i++) - lut[i] = (u8)(indir[i]); + vsi->rss_lut_user[i] = (u8)(indir[i]); - ret = i40evf_config_rss(vsi, seed, lut, I40EVF_HLUT_ARRAY_SIZE); - kfree(lut); - - return ret; + return i40evf_config_rss(vsi, seed, vsi->rss_lut_user, + I40EVF_HLUT_ARRAY_SIZE); } static const struct ethtool_ops i40evf_ethtool_ops = { |