igc: add RSS key get/set support
Subsystems (3)
cover igc: add RSS key get/set support
This series adds ethtool get/set support for the RSS hash key in the igc driver.
- ethtool -x <dev> to display the RSS key
- ethtool -X <dev> hkey <key> to configure the RSS key
Without patch:
# ethtool -x $DEV | grep key -A1 RSS hash key: Operation not supported # ethtool -X $DEV hkey be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef Cannot set RX flow hash configuration: Hash key setting not supported
With patch:
# ethtool -x $DEV | grep key -A1 RSS hash key: dd:7c:1f:06:1a:42:dc:e5:7e:90:2c:48:aa:3f:5d:5a:d7:da:ec:44:3e:3f:df:78:89:1e:3c:68:2e:59:da:a0:23:5a:32:5c:cf:5e:7e:7b # ethtool -X $DEV hkey be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef # ethtool -x $DEV | grep key -A1 RSS hash key: be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef:be:ef
Kohei Enju (3):
igc: prepare for RSS key get/set support
igc: expose RSS key via ethtool get_rxfh
igc: allow configuring RSS key via ethtool set_rxfh
drivers/net/ethernet/intel/igc/igc.h | 4 ++ drivers/net/ethernet/intel/igc/igc_ethtool.c | 60 ++++++++++++++------ drivers/net/ethernet/intel/igc/igc_main.c | 7 +-- 3 files changed, 50 insertions(+), 21 deletions(-)
Signature · 1 line
2.51.0
PATCH 1/3 igc: prepare for RSS key get/set support
Store the RSS key inside struct igc_adapter and introduce the igc_write_rss_key() helper function. This allows the driver to program the RSSRK registers using a persistent RSS key, instead of using a stack-local buffer in igc_setup_mrqc().
This is a preparation patch for adding RSS key get/set support in subsequent changes, and no functional change is intended in this patch.
--- drivers/net/ethernet/intel/igc/igc.h | 3 +++ drivers/net/ethernet/intel/igc/igc_ethtool.c | 12 ++++++++++++ drivers/net/ethernet/intel/igc/igc_main.c | 6 ++---- 3 files changed, 17 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/igc/igc.h +3 -0
@@ -30,6 +30,7 @@ void igc_ethtool_set_ops(struct net_device *);#define MAX_ETYPE_FILTER 8#define IGC_RETA_SIZE 128 +#define IGC_RSS_KEY_SIZE 40/* SDP support */ #define IGC_N_EXTTS 2
@@ -302,6 +303,7 @@ struct igc_adapter {unsigned int nfc_rule_count;u8 rss_indir_tbl[IGC_RETA_SIZE ]; +u8 rss_key[IGC_RSS_KEY_SIZE ];unsigned long link_check_timeout;struct igc_info ei;
@@ -360,6 +362,7 @@ unsigned int igc_get_max_rss_queues(struct igc_adapter *adapter);void igc_set_flag_queue_pairs (struct igc_adapter *adapter,const u32 max_rss_queues);int igc_reinit_queues (struct igc_adapter *adapter); +void igc_write_rss_key (struct igc_adapter *adapter);void igc_write_rss_indir_tbl (struct igc_adapter *adapter);bool igc_has_link (struct igc_adapter *adapter);void igc_reset (struct igc_adapter *adapter);
drivers/net/ethernet/intel/igc/igc_ethtool.c +12 -0
@@ -1456,6 +1456,18 @@ static int igc_ethtool_set_rxnfc(struct net_device *dev, } } +void igc_write_rss_key (struct igc_adapter *adapter) +{ +struct igc_hw *hw = &adapter->hw; +u32 val; +int i; + +for (i =0 ; i <IGC_RSS_KEY_SIZE /4 ; i++) { + val =get_unaligned_le32 (&adapter->rss_key[i *4 ]); +wr32 (IGC_RSSRK (i), val); + } +} +void igc_write_rss_indir_tbl (struct igc_adapter *adapter) {struct igc_hw *hw = &adapter->hw;
drivers/net/ethernet/intel/igc/igc_main.c +2 -4
@@ -778,11 +778,9 @@ static void igc_setup_mrqc(struct igc_adapter *adapter)struct igc_hw *hw = &adapter->hw;u32 j, num_rx_queues;u32 mrqc, rxcsum; -u32 rss_key[10 ]; -netdev_rss_key_fill (rss_key,sizeof (rss_key)); -for (j =0 ; j <10 ; j++) -wr32 (IGC_RSSRK (j), rss_key[j]); +netdev_rss_key_fill (adapter->rss_key,sizeof (adapter->rss_key)); +igc_write_rss_key (adapter); num_rx_queues = adapter->rss_queues;
Signature · 1 line
2.51.0
RE: [Intel-wired-lan] [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set support
Quoted 106 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: Saturday, October 25, 2025 5:02 PM
To: [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; [email protected]; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set supportStore the RSS key inside struct
igc_adapterand introduce theigc_write_rss_key()helper function. This allows the driver to program the RSSRK registers using a persistent RSS key, instead of using a stack-local buffer inigc_setup_mrqc().This is a preparation patch for adding RSS key get/set support in subsequent changes, and no functional change is intended in this patch.
Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/igc/igc.h | 3 +++ drivers/net/ethernet/intel/igc/igc_ethtool.c | 12 ++++++++++++ drivers/net/ethernet/intel/igc/igc_main.c | 6 ++---- 3 files changed, 17 insertions(+), 4 deletions(-)drivers/net/ethernet/intel/igc/igc.h +2
-0@@ -30,6 +30,7 @@ void igc_ethtool_set_ops(struct net_device *);#define MAX_ETYPE_FILTER 8#define IGC_RETA_SIZE 128 +#define IGC_RSS_KEY_SIZE 40/* SDP support */ #define IGC_N_EXTTS 2@@ -302,6 +303,7 @@ struct igc_adapter {unsigned int nfc_rule_count;u8 rss_indir_tbl[IGC_RETA_SIZE ]; +u8 rss_key[IGC_RSS_KEY_SIZE ];unsigned long link_check_timeout;struct igc_info ei;@@ -360,6 +362,7 @@ unsigned int igc_get_max_rss_queues(struct
igc_adapter*adapter); void igc_set_flag_queue_pairs(structigc_adapter*adapter,drivers/net/ethernet/intel/igc/igc.h +1
-0const u32 max_rss_queues);int igc_reinit_queues (struct igc_adapter *adapter); +void igc_write_rss_key (struct igc_adapter *adapter);void igc_write_rss_indir_tbl (struct igc_adapter *adapter);bool
igc_has_link(struct igc_adapter *adapter); voidigc_reset(struct igc_adapter *adapter); diff --gita/drivers/net/ethernet/intel/igc/igc_ethtool.cb/drivers/net/ethernet/intel/igc/igc_ethtool.c
indexca93629b1d3a..f89c2cbaace0100644drivers/net/ethernet/intel/igc/igc_ethtool.c +11
-0@@ -1456,6 +1456,18 @@ static int igc_ethtool_set_rxnfc(struct net_device *dev, } } +void igc_write_rss_key (struct igc_adapter *adapter) { +struct igc_hw *hw = &adapter->hw; +u32 val; +int i; + +for (i =0 ; i <IGC_RSS_KEY_SIZE /4 ; i++) { + val =get_unaligned_le32 (&adapter->rss_key[i *4 ]); +wr32 (IGC_RSSRK (i), val); + } +} +void igc_write_rss_indir_tbl (struct igc_adapter *adapter) {struct igc_hw *hw = &adapter->hw;drivers/net/ethernet/intel/igc/igc_main.c +2
-4@@ -778,11 +778,9 @@ static void igc_setup_mrqc(struct igc_adapter *adapter)struct igc_hw *hw = &adapter->hw;u32 j, num_rx_queues;u32 mrqc, rxcsum; -u32 rss_key[10 ]; -netdev_rss_key_fill (rss_key,sizeof (rss_key)); -for (j =0 ; j <10 ; j++) -wr32 (IGC_RSSRK (j), rss_key[j]); +netdev_rss_key_fill (adapter->rss_key,sizeof (adapter- >rss_key)); +igc_write_rss_key (adapter);
num_rx_queues=adapter->rss_queues;
Quoted 2 lines
--
2.51.0
Re: [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set support
In reply to Kohei EnjuQuoted 9 lines · Kohei Enju
Store the RSS key inside struct
igc_adapterand introduce theigc_write_rss_key()helper function. This allows the driver to program the RSSRK registers using a persistent RSS key, instead of using a stack-local buffer inigc_setup_mrqc().This is a preparation patch for adding RSS key get/set support in subsequent changes, and no functional change is intended in this patch.
Signed-off-by Kohei Enju <[email protected]>
Lifshits, Vitaly
Reviewed-byRe: [Intel-wired-lan] [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set support
Quoted 6 lines · Simon Horman
Quoted 5 lines · Kohei Enju
Store the RSS key inside struct
igc_adapterand introduce theigc_write_rss_key()helper function. This allows the driver to program the RSSRK registers using a persistent RSS key, instead of using a stack-local buffer inigc_setup_mrqc().
Quoted 7 lines
Quoted 4 lines
This is a preparation patch for adding RSS key get/set support in subsequent changes, and no functional change is intended in this patch.
Signed-off-by Kohei Enju <[email protected]>Reviewed-by Simon Horman <[email protected]>
Re: [Intel-wired-lan] [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set support
In reply to Kohei EnjuQuoted 8 lines · Kohei Enju
Store the RSS key inside struct
igc_adapterand introduce theigc_write_rss_key()helper function. This allows the driver to program the RSSRK registers using a persistent RSS key, instead of using a stack-local buffer inigc_setup_mrqc().This is a preparation patch for adding RSS key get/set support in subsequent changes, and no functional change is intended in this patch.
Quoted 7 lines
Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/igc/igc.h | 3 +++ drivers/net/ethernet/intel/igc/igc_ethtool.c | 12 ++++++++++++ drivers/net/ethernet/intel/igc/igc_main.c | 6 ++---- 3 files changed, 17 insertions(+), 4 deletions(-)
Re: [Intel-wired-lan] [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set support
In reply to Kohei EnjuQuoted 8 lines · Kohei Enju
Store the RSS key inside struct
igc_adapterand introduce theigc_write_rss_key()helper function. This allows the driver to program the RSSRK registers using a persistent RSS key, instead of using a stack-local buffer inigc_setup_mrqc().This is a preparation patch for adding RSS key get/set support in subsequent changes, and no functional change is intended in this patch.
Quoted 7 lines
Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/igc/igc.h | 3 +++ drivers/net/ethernet/intel/igc/igc_ethtool.c | 12 ++++++++++++ drivers/net/ethernet/intel/igc/igc_main.c | 6 ++---- 3 files changed, 17 insertions(+), 4 deletions(-)
PATCH 2/3 igc: expose RSS key via ethtool get_rxfh
In reply to Kohei EnjuImplement igc_ethtool_get_rxfh_key_size() and extend igc_ethtool_get_rxfh() to return the RSS key to userspace.
This can be tested using ethtool -x <dev>.
--- drivers/net/ethernet/intel/igc/igc_ethtool.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/igc/igc_ethtool.c +13 -4
@@ -1490,6 +1490,11 @@ void igc_write_rss_indir_tbl(struct igc_adapter *adapter) } } +static u32 igc_ethtool_get_rxfh_key_size (struct net_device *netdev) +{ +return IGC_RSS_KEY_SIZE ; +} +static u32 igc_ethtool_get_rxfh_indir_size (struct net_device *netdev) {return IGC_RETA_SIZE ;
@@ -1502,10 +1507,13 @@ static int igc_ethtool_get_rxfh(struct net_device *netdev,int i; rxfh->hfunc =ETH_RSS_HASH_TOP ; -if (!rxfh->indir) -return 0 ; -for (i =0 ; i <IGC_RETA_SIZE ; i++) - rxfh->indir[i] = adapter->rss_indir_tbl[i]; + +if (rxfh->indir) +for (i =0 ; i <IGC_RETA_SIZE ; i++) + rxfh->indir[i] = adapter->rss_indir_tbl[i]; + +if (rxfh->key) +memcpy (rxfh->key, adapter->rss_key,sizeof (adapter->rss_key));return 0 ; }
@@ -2182,6 +2190,7 @@ static const struct ethtool_ops igc_ethtool_ops = { .set_coalesce = igc_ethtool_set_coalesce, .get_rxnfc = igc_ethtool_get_rxnfc, .set_rxnfc = igc_ethtool_set_rxnfc, + .get_rxfh_key_size = igc_ethtool_get_rxfh_key_size, .get_rxfh_indir_size = igc_ethtool_get_rxfh_indir_size, .get_rxfh = igc_ethtool_get_rxfh, .set_rxfh = igc_ethtool_set_rxfh,
Signature · 1 line
2.51.0
RE: [Intel-wired-lan] [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh
Quoted 71 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: Saturday, October 25, 2025 5:02 PM
To: [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; [email protected]; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtoolget_rxfhImplement
igc_ethtool_get_rxfh_key_size()and extendigc_ethtool_get_rxfh()to return the RSS key to userspace.This can be tested using
ethtool -x <dev>.Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/igc/igc_ethtool.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)drivers/net/ethernet/intel/igc/igc_ethtool.c +11
-4@@ -1490,6 +1490,11 @@ void igc_write_rss_indir_tbl(struct igc_adapter *adapter) } } +static u32 igc_ethtool_get_rxfh_key_size (struct net_device *netdev) { +return IGC_RSS_KEY_SIZE ; +} +static u32 igc_ethtool_get_rxfh_indir_size (struct net_device *netdev) {return IGC_RETA_SIZE ;@@ -1502,10 +1507,13 @@ static int igc_ethtool_get_rxfh(structnet_device *netdev, int i; rxfh->hfunc =ETH_RSS_HASH_TOP ; -if (!rxfh->indir) -return 0 ; -for (i =0 ; i <IGC_RETA_SIZE ; i++) - rxfh->indir[i] = adapter->rss_indir_tbl[i]; + +if (rxfh->indir) +for (i =0 ; i <IGC_RETA_SIZE ; i++) + rxfh->indir[i] = adapter->rss_indir_tbl[i]; + +if (rxfh->key) +memcpy (rxfh->key, adapter->rss_key,sizeof (adapter- >rss_key));drivers/net/ethernet/intel/igc/igc_ethtool.c +1
-0return 0 ; }@@ -2182,6 +2190,7 @@ static const struct ethtool_ops igc_ethtool_ops = { .set_coalesce = igc_ethtool_set_coalesce, .get_rxnfc = igc_ethtool_get_rxnfc, .set_rxnfc = igc_ethtool_set_rxnfc, + .get_rxfh_key_size = igc_ethtool_get_rxfh_key_size, .get_rxfh_indir_size = igc_ethtool_get_rxfh_indir_size, .get_rxfh = igc_ethtool_get_rxfh,
Quoted 3 lines
.set_rxfh =
igc_ethtool_set_rxfh,
--
2.51.0
Re: [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh
In reply to Kohei EnjuQuoted 6 lines · Kohei Enju
Implement
igc_ethtool_get_rxfh_key_size()and extendigc_ethtool_get_rxfh()to return the RSS key to userspace.This can be tested using
ethtool -x <dev>.Signed-off-by Kohei Enju <[email protected]>
Lifshits, Vitaly
Reviewed-byRe: [Intel-wired-lan] [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh
Quoted 10 lines · Simon Horman
Quoted 6 lines · Kohei Enju
Implement
igc_ethtool_get_rxfh_key_size()and extendigc_ethtool_get_rxfh()to return the RSS key to userspace.This can be tested using
ethtool -x <dev>.Signed-off-by Kohei Enju <[email protected]>Reviewed-by Simon Horman <[email protected]>
Re: [Intel-wired-lan] [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh
In reply to Kohei EnjuQuoted 10 lines · Kohei Enju
Implement
igc_ethtool_get_rxfh_key_size()and extendigc_ethtool_get_rxfh()to return the RSS key to userspace.This can be tested using
ethtool -x <dev>.Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/igc/igc_ethtool.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
PATCH 3/3 igc: allow configuring RSS key via ethtool set_rxfh
In reply to Kohei EnjuChange 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>.
--- drivers/net/ethernet/intel/igc/igc.h | 1 + drivers/net/ethernet/intel/igc/igc_ethtool.c | 31 ++++++++++++-------- drivers/net/ethernet/intel/igc/igc_main.c | 3 +- 3 files changed, 21 insertions(+), 14 deletions(-)
drivers/net/ethernet/intel/igc/igc.h +1 -0
@@ -304,6 +304,7 @@ struct igc_adapter {u8 rss_indir_tbl[IGC_RETA_SIZE ];u8 rss_key[IGC_RSS_KEY_SIZE ]; +bool has_user_rss_key;unsigned long link_check_timeout;struct igc_info ei;
drivers/net/ethernet/intel/igc/igc_ethtool.c +18 -13
@@ -1527,24 +1527,29 @@ 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) { + adapter->has_user_rss_key = true; +memcpy (adapter->rss_key, rxfh->key,sizeof (adapter->rss_key)); +igc_write_rss_key (adapter); + }return 0 ; }
drivers/net/ethernet/intel/igc/igc_main.c +2 -1
@@ -779,7 +779,8 @@ static void igc_setup_mrqc(struct igc_adapter *adapter)u32 j, num_rx_queues;u32 mrqc, rxcsum; -netdev_rss_key_fill (adapter->rss_key,sizeof (adapter->rss_key)); +if (!adapter->has_user_rss_key) +netdev_rss_key_fill (adapter->rss_key,sizeof (adapter->rss_key));igc_write_rss_key (adapter); num_rx_queues = adapter->rss_queues;
Signature · 1 line
2.51.0
RE: [Intel-wired-lan] [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh
Quoted 112 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: Saturday, October 25, 2025 5:02 PM
To: [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; [email protected]; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtoolset_rxfhChange
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 <[email protected]>--- drivers/net/ethernet/intel/igc/igc.h | 1 + drivers/net/ethernet/intel/igc/igc_ethtool.c | 31 ++++++++++++-------(quoted diff) +0
-1- drivers/net/ethernet/intel/igc/igc_main.c | 3 +- 3 files changed, 21 insertions(+), 14 deletions(-)drivers/net/ethernet/intel/igc/igc.h +1
-0@@ -304,6 +304,7 @@ struct igc_adapter {u8 rss_indir_tbl[IGC_RETA_SIZE ];u8 rss_key[IGC_RSS_KEY_SIZE ]; +bool has_user_rss_key;unsigned long link_check_timeout;struct igc_info ei;drivers/net/ethernet/intel/igc/igc_ethtool.c +18
-13@@ -1527,24 +1527,29 @@ static int igc_ethtool_set_rxfh(structnet_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) { + adapter->has_user_rss_key = true; +memcpy (adapter->rss_key, rxfh->key,sizeof (adapter- >rss_key)); +igc_write_rss_key (adapter); + }drivers/net/ethernet/intel/igc/igc_ethtool.c +0
-0return 0 ; }drivers/net/ethernet/intel/igc/igc_main.c +2
-1@@ -779,7 +779,8 @@ static void igc_setup_mrqc(struct igc_adapter *adapter)u32 j, num_rx_queues;u32 mrqc, rxcsum; -netdev_rss_key_fill (adapter->rss_key,sizeof (adapter- >rss_key)); +if (!adapter->has_user_rss_key) +netdev_rss_key_fill (adapter->rss_key,sizeof (adapter- >rss_key));drivers/net/ethernet/intel/igc/igc_main.c +0
-1igc_write_rss_key (adapter); num_rx_queues = adapter->rss_queues; --
Quoted 1 line
2.51.0
Re: [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh
In reply to Kohei EnjuQuoted 7 lines · Kohei Enju
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 <[email protected]>
Lifshits, Vitaly
Reviewed-byRe: [Intel-wired-lan] [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh
Quoted 11 lines · Simon Horman
Quoted 7 lines · Kohei Enju
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 <[email protected]>Reviewed-by Simon Horman <[email protected]>
Re: [Intel-wired-lan] [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh
In reply to Kohei EnjuQuoted 4 lines · Kohei Enju
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.
Quoted 9 lines
This can be tested using
ethtool -X <dev> hkey <key>.Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/igc/igc.h | 1 + drivers/net/ethernet/intel/igc/igc_ethtool.c | 31 ++++++++++++-------- drivers/net/ethernet/intel/igc/igc_main.c | 3 +- 3 files changed, 21 insertions(+), 14 deletions(-)