diff options
author | Helin Zhang <helin.zhang@intel.com> | 2015-10-26 19:44:27 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-12-01 22:26:26 -0800 |
commit | 28c5869f2bc4e319027bc22a66a1aa9eefc69a16 (patch) | |
tree | dedc52104cc9ddbef24760febd97b9f5e8a92b87 /drivers/net/ethernet/intel/i40e/i40e_ethtool.c | |
parent | 6cc568340148424e657508d82692ef787d6c4b2c (diff) | |
download | lwn-28c5869f2bc4e319027bc22a66a1aa9eefc69a16.tar.gz lwn-28c5869f2bc4e319027bc22a66a1aa9eefc69a16.zip |
i40e: add new fields to store user configuration
This patch adds new fields to i40e_vsi to store user configured
RSS config data and code to use it.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Change-ID: I73886469dca9e9f6b16d842182a87f3f4009f95d
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/i40e/i40e_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index 6cb2b340cdc2..b52c50924274 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -2651,10 +2651,8 @@ static int i40e_set_rxfh(struct net_device *netdev, const u32 *indir, { struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_vsi *vsi = np->vsi; - u8 seed_def[I40E_HKEY_ARRAY_SIZE]; - u8 *lut, *seed = NULL; + u8 *seed = NULL; u16 i; - int ret; if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP) return -EOPNOTSUPP; @@ -2663,18 +2661,27 @@ static int i40e_set_rxfh(struct net_device *netdev, const u32 *indir, return 0; if (key) { - memcpy(seed_def, key, I40E_HKEY_ARRAY_SIZE); - seed = seed_def; + if (!vsi->rss_hkey_user) { + vsi->rss_hkey_user = kzalloc(I40E_HKEY_ARRAY_SIZE, + GFP_KERNEL); + if (!vsi->rss_hkey_user) + return -ENOMEM; + } + memcpy(vsi->rss_hkey_user, key, I40E_HKEY_ARRAY_SIZE); + seed = vsi->rss_hkey_user; } - lut = kzalloc(I40E_HLUT_ARRAY_SIZE, GFP_KERNEL); - if (!lut) - return -ENOMEM; + if (!vsi->rss_lut_user) { + vsi->rss_lut_user = kzalloc(I40E_HLUT_ARRAY_SIZE, GFP_KERNEL); + if (!vsi->rss_lut_user) + return -ENOMEM; + } + + /* Each 32 bits pointed by 'indir' is stored with a lut entry */ for (i = 0; i < I40E_HLUT_ARRAY_SIZE; i++) - lut[i] = (u8)(indir[i]); - ret = i40e_config_rss(vsi, seed, lut, I40E_HLUT_ARRAY_SIZE); - kfree(lut); + vsi->rss_lut_user[i] = (u8)(indir[i]); - return ret; + return i40e_config_rss(vsi, seed, vsi->rss_lut_user, + I40E_HLUT_ARRAY_SIZE); } /** |