All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net-next 1/1] iavf: Enable setting RSS hash key
@ 2021-07-16 22:16 Tony Nguyen
  2021-07-16 22:16 ` [Intel-wired-lan] [PATCH net-next 1/7] ice: Fix static analyzer hit Tony Nguyen
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Tony Nguyen @ 2021-07-16 22:16 UTC (permalink / raw)
  To: intel-wired-lan

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 <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
index 01047786eabc..1aed5ade8682 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
@@ -1893,7 +1893,7 @@ static int iavf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
  * @key: hash key
  * @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.
  **/
 static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir,
@@ -1902,19 +1902,21 @@ static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir,
 	struct iavf_adapter *adapter = netdev_priv(netdev);
 	u16 i;
 
-	/* We do not allow change in unsupported parameters */
-	if (key ||
-	    (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP))
+	/* Only support toeplitz hash function */
+	if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
 		return -EOPNOTSUPP;
-	if (!indir)
+
+	if (!key && !indir)
 		return 0;
 
 	if (key)
 		memcpy(adapter->rss_key, key, adapter->rss_key_size);
 
-	/* Each 32 bits pointed by 'indir' is stored with a lut entry */
-	for (i = 0; i < adapter->rss_lut_size; i++)
-		adapter->rss_lut[i] = (u8)(indir[i]);
+	if (indir) {
+		/* Each 32 bits pointed by 'indir' is stored with a lut entry */
+		for (i = 0; i < adapter->rss_lut_size; i++)
+			adapter->rss_lut[i] = (u8)(indir[i]);
+	}
 
 	return iavf_config_rss(adapter);
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-11-02 23:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 22:16 [Intel-wired-lan] [PATCH net-next 1/1] iavf: Enable setting RSS hash key Tony Nguyen
2021-07-16 22:16 ` [Intel-wired-lan] [PATCH net-next 1/7] ice: Fix static analyzer hit Tony Nguyen
2021-07-16 22:16 ` [Intel-wired-lan] [PATCH net-next 2/7] ice: Fix link mode handling Tony Nguyen
2021-08-11 12:51   ` G, GurucharanX
2021-07-16 22:16 ` [Intel-wired-lan] [PATCH net-next 3/7] ice: Add DSCP support Tony Nguyen
2021-07-16 22:16 ` [Intel-wired-lan] [PATCH net-next 4/7] ice: Add feature bitmap, helpers and a check for DSCP Tony Nguyen
     [not found]   ` <BYAPR11MB33678EAAB258C5CF310FC4E8FCD39@BYAPR11MB3367.namprd11.prod.outlook.com>
2021-09-09  3:57     ` G, GurucharanX
2021-07-16 22:16 ` [Intel-wired-lan] [PATCH net-next 5/7] ice: Add package PTYPE enable information Tony Nguyen
2021-11-02 23:04   ` Brelinski, Tony
2021-07-16 22:16 ` [Intel-wired-lan] [PATCH net-next 6/7] ice: refactor PTYPE validating Tony Nguyen
2021-11-02 23:03   ` Brelinski, Tony
2021-07-16 22:16 ` [Intel-wired-lan] [PATCH net-next 7/7] ice: Fix macro name for IPv4 fragment flag Tony Nguyen
2021-08-09 10:08   ` G, GurucharanX
2021-11-02 23:04 ` [Intel-wired-lan] [PATCH net-next 1/1] iavf: Enable setting RSS hash key Brelinski, Tony

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.