Skip to content

Commit b231b59

Browse files
committed
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: Tony Nguyen <[email protected]> Tested-by: Tony Brelinski <[email protected]>
1 parent bdb9e5c commit b231b59

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

drivers/net/ethernet/intel/iavf/iavf_ethtool.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,7 +1910,7 @@ static int iavf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
19101910
* @key: hash key
19111911
* @hfunc: hash function to use
19121912
*
1913-
* Returns -EINVAL if the table specifies an inavlid queue id, otherwise
1913+
* Returns -EINVAL if the table specifies an invalid queue id, otherwise
19141914
* returns 0 after programming the table.
19151915
**/
19161916
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,
19191919
struct iavf_adapter *adapter = netdev_priv(netdev);
19201920
u16 i;
19211921

1922-
/* We do not allow change in unsupported parameters */
1923-
if (key ||
1924-
(hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP))
1922+
/* Only support toeplitz hash function */
1923+
if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
19251924
return -EOPNOTSUPP;
1926-
if (!indir)
1925+
1926+
if (!key && !indir)
19271927
return 0;
19281928

19291929
if (key)
19301930
memcpy(adapter->rss_key, key, adapter->rss_key_size);
19311931

1932-
/* Each 32 bits pointed by 'indir' is stored with a lut entry */
1933-
for (i = 0; i < adapter->rss_lut_size; i++)
1934-
adapter->rss_lut[i] = (u8)(indir[i]);
1932+
if (indir) {
1933+
/* Each 32 bits pointed by 'indir' is stored with a lut entry */
1934+
for (i = 0; i < adapter->rss_lut_size; i++)
1935+
adapter->rss_lut[i] = (u8)(indir[i]);
1936+
}
19351937

19361938
return iavf_config_rss(adapter);
19371939
}

0 commit comments

Comments
 (0)