mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 10:31:33 -04:00
igc: allow configuring RSS key via ethtool set_rxfh
Change igc_ethtool_set_rxfh() to accept and save a userspace-provided RSS key. When a key is provided, store it in the adapter and write the RSSRK registers accordingly. This can be tested using `ethtool -X <dev> hkey <key>`. Signed-off-by: Kohei Enju <kohei@enjuk.jp> Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Avigail Dahan <avigailx.dahan@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
@@ -1539,24 +1539,28 @@ static int igc_ethtool_set_rxfh(struct net_device *netdev,
|
||||
int i;
|
||||
|
||||
/* We do not allow change in unsupported parameters */
|
||||
if (rxfh->key ||
|
||||
(rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
|
||||
rxfh->hfunc != ETH_RSS_HASH_TOP))
|
||||
if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
|
||||
rxfh->hfunc != ETH_RSS_HASH_TOP)
|
||||
return -EOPNOTSUPP;
|
||||
if (!rxfh->indir)
|
||||
return 0;
|
||||
|
||||
num_queues = adapter->rss_queues;
|
||||
if (rxfh->indir) {
|
||||
num_queues = adapter->rss_queues;
|
||||
|
||||
/* Verify user input. */
|
||||
for (i = 0; i < IGC_RETA_SIZE; i++)
|
||||
if (rxfh->indir[i] >= num_queues)
|
||||
return -EINVAL;
|
||||
/* Verify user input. */
|
||||
for (i = 0; i < IGC_RETA_SIZE; i++)
|
||||
if (rxfh->indir[i] >= num_queues)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < IGC_RETA_SIZE; i++)
|
||||
adapter->rss_indir_tbl[i] = rxfh->indir[i];
|
||||
for (i = 0; i < IGC_RETA_SIZE; i++)
|
||||
adapter->rss_indir_tbl[i] = rxfh->indir[i];
|
||||
|
||||
igc_write_rss_indir_tbl(adapter);
|
||||
igc_write_rss_indir_tbl(adapter);
|
||||
}
|
||||
|
||||
if (rxfh->key) {
|
||||
memcpy(adapter->rss_key, rxfh->key, sizeof(adapter->rss_key));
|
||||
igc_write_rss_key(adapter);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user