Commit b231b59a authored by Tony Nguyen's avatar Tony Nguyen

iavf: Enable setting RSS hash key

Driver support for changing the RSS hash key exists, however, checks
have caused it to be reported as unsupported. Remove the check and
allow the hash key to be specified.
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: default avatarTony Brelinski <tony.brelinski@intel.com>
parent bdb9e5c7
...@@ -1910,7 +1910,7 @@ static int iavf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, ...@@ -1910,7 +1910,7 @@ static int iavf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
* @key: hash key * @key: hash key
* @hfunc: hash function to use * @hfunc: hash function to use
* *
* Returns -EINVAL if the table specifies an inavlid queue id, otherwise * Returns -EINVAL if the table specifies an invalid queue id, otherwise
* returns 0 after programming the table. * returns 0 after programming the table.
**/ **/
static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir, static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir,
...@@ -1919,19 +1919,21 @@ static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir, ...@@ -1919,19 +1919,21 @@ static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir,
struct iavf_adapter *adapter = netdev_priv(netdev); struct iavf_adapter *adapter = netdev_priv(netdev);
u16 i; u16 i;
/* We do not allow change in unsupported parameters */ /* Only support toeplitz hash function */
if (key || if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
(hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP))
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (!indir)
if (!key && !indir)
return 0; return 0;
if (key) if (key)
memcpy(adapter->rss_key, key, adapter->rss_key_size); memcpy(adapter->rss_key, key, adapter->rss_key_size);
/* Each 32 bits pointed by 'indir' is stored with a lut entry */ if (indir) {
for (i = 0; i < adapter->rss_lut_size; i++) /* Each 32 bits pointed by 'indir' is stored with a lut entry */
adapter->rss_lut[i] = (u8)(indir[i]); for (i = 0; i < adapter->rss_lut_size; i++)
adapter->rss_lut[i] = (u8)(indir[i]);
}
return iavf_config_rss(adapter); return iavf_config_rss(adapter);
} }
......
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