* [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set support
2025-10-25 15:01 [PATCH iwl-next v1 0/3] igc: add RSS key get/set support Kohei Enju
@ 2025-10-25 15:01 ` Kohei Enju
2025-10-27 7:15 ` [Intel-wired-lan] " Loktionov, Aleksandr
` (2 more replies)
2025-10-25 15:01 ` [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh Kohei Enju
2025-10-25 15:01 ` [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh Kohei Enju
2 siblings, 3 replies; 16+ messages in thread
From: Kohei Enju @ 2025-10-25 15:01 UTC (permalink / raw)
To: intel-wired-lan, netdev
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kohei.enju, Kohei Enju
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.
Signed-off-by: Kohei Enju <enjuk@amazon.com>
---
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(-)
diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index a427f05814c1..dd159397d191 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -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);
diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index ca93629b1d3a..f89c2cbaace0 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -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;
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 728d7ca5338b..1f0a601cbcef 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -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;
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* RE: [Intel-wired-lan] [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set support
2025-10-25 15:01 ` [PATCH iwl-next v1 1/3] igc: prepare for " Kohei Enju
@ 2025-10-27 7:15 ` Loktionov, Aleksandr
2025-10-28 18:12 ` Simon Horman
2025-12-21 10:34 ` Avigail Dahan
2 siblings, 0 replies; 16+ messages in thread
From: Loktionov, Aleksandr @ 2025-10-27 7:15 UTC (permalink / raw)
To: Kohei Enju, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org
Cc: Nguyen, Anthony L, Kitszel, Przemyslaw, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
kohei.enju@gmail.com
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Kohei Enju
> Sent: Saturday, October 25, 2025 5:02 PM
> To: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@intel.com>; Andrew Lunn
> <andrew+netdev@lunn.ch>; David S. Miller <davem@davemloft.net>; Eric
> Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo
> Abeni <pabeni@redhat.com>; kohei.enju@gmail.com; Kohei Enju
> <enjuk@amazon.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v1 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.
>
> Signed-off-by: Kohei Enju <enjuk@amazon.com>
> ---
> 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(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc.h
> b/drivers/net/ethernet/intel/igc/igc.h
> index a427f05814c1..dd159397d191 100644
> --- a/drivers/net/ethernet/intel/igc/igc.h
> +++ b/drivers/net/ethernet/intel/igc/igc.h
> @@ -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); diff --git
> a/drivers/net/ethernet/intel/igc/igc_ethtool.c
> b/drivers/net/ethernet/intel/igc/igc_ethtool.c
> index ca93629b1d3a..f89c2cbaace0 100644
> --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
> +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
> @@ -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;
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c
> b/drivers/net/ethernet/intel/igc/igc_main.c
> index 728d7ca5338b..1f0a601cbcef 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -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;
>
> --
> 2.51.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set support
2025-10-25 15:01 ` [PATCH iwl-next v1 1/3] igc: prepare for " Kohei Enju
2025-10-27 7:15 ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2025-10-28 18:12 ` Simon Horman
2025-11-02 8:44 ` [Intel-wired-lan] " Lifshits, Vitaly
2025-12-21 10:34 ` Avigail Dahan
2 siblings, 1 reply; 16+ messages in thread
From: Simon Horman @ 2025-10-28 18:12 UTC (permalink / raw)
To: Kohei Enju
Cc: intel-wired-lan, netdev, Tony Nguyen, Przemek Kitszel,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, kohei.enju
On Sun, Oct 26, 2025 at 12:01:30AM +0900, Kohei Enju wrote:
> 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.
>
> Signed-off-by: Kohei Enju <enjuk@amazon.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set support
2025-10-28 18:12 ` Simon Horman
@ 2025-11-02 8:44 ` Lifshits, Vitaly
0 siblings, 0 replies; 16+ messages in thread
From: Lifshits, Vitaly @ 2025-11-02 8:44 UTC (permalink / raw)
To: Simon Horman, Kohei Enju
Cc: intel-wired-lan, netdev, Tony Nguyen, Przemek Kitszel,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, kohei.enju
On 10/28/2025 8:12 PM, Simon Horman wrote:
> On Sun, Oct 26, 2025 at 12:01:30AM +0900, Kohei Enju wrote:
>> 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.
>>
>> Signed-off-by: Kohei Enju <enjuk@amazon.com>
>
> Reviewed-by: Simon Horman <horms@kernel.org>
>
Reviewed-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next v1 1/3] igc: prepare for RSS key get/set support
2025-10-25 15:01 ` [PATCH iwl-next v1 1/3] igc: prepare for " Kohei Enju
2025-10-27 7:15 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-10-28 18:12 ` Simon Horman
@ 2025-12-21 10:34 ` Avigail Dahan
2 siblings, 0 replies; 16+ messages in thread
From: Avigail Dahan @ 2025-12-21 10:34 UTC (permalink / raw)
To: Kohei Enju, intel-wired-lan, netdev
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kohei.enju
On 25/10/2025 18:01, Kohei Enju wrote:
> 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.
>
> Signed-off-by: Kohei Enju <enjuk@amazon.com>
> ---
> 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(-)
>
Tested-by: Avigail Dahan <avigailx.dahan@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh
2025-10-25 15:01 [PATCH iwl-next v1 0/3] igc: add RSS key get/set support Kohei Enju
2025-10-25 15:01 ` [PATCH iwl-next v1 1/3] igc: prepare for " Kohei Enju
@ 2025-10-25 15:01 ` Kohei Enju
2025-10-27 7:16 ` [Intel-wired-lan] " Loktionov, Aleksandr
` (2 more replies)
2025-10-25 15:01 ` [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh Kohei Enju
2 siblings, 3 replies; 16+ messages in thread
From: Kohei Enju @ 2025-10-25 15:01 UTC (permalink / raw)
To: intel-wired-lan, netdev
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kohei.enju, Kohei Enju
Implement 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>`.
Signed-off-by: Kohei Enju <enjuk@amazon.com>
---
drivers/net/ethernet/intel/igc/igc_ethtool.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index f89c2cbaace0..0482e590bc5a 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -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,
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* RE: [Intel-wired-lan] [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh
2025-10-25 15:01 ` [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh Kohei Enju
@ 2025-10-27 7:16 ` Loktionov, Aleksandr
2025-10-28 18:12 ` Simon Horman
2025-12-21 10:35 ` Avigail Dahan
2 siblings, 0 replies; 16+ messages in thread
From: Loktionov, Aleksandr @ 2025-10-27 7:16 UTC (permalink / raw)
To: Kohei Enju, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org
Cc: Nguyen, Anthony L, Kitszel, Przemyslaw, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
kohei.enju@gmail.com
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Kohei Enju
> Sent: Saturday, October 25, 2025 5:02 PM
> To: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@intel.com>; Andrew Lunn
> <andrew+netdev@lunn.ch>; David S. Miller <davem@davemloft.net>; Eric
> Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo
> Abeni <pabeni@redhat.com>; kohei.enju@gmail.com; Kohei Enju
> <enjuk@amazon.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v1 2/3] igc: expose RSS key
> via ethtool get_rxfh
>
> Implement 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>`.
>
> Signed-off-by: Kohei Enju <enjuk@amazon.com>
> ---
> drivers/net/ethernet/intel/igc/igc_ethtool.c | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c
> b/drivers/net/ethernet/intel/igc/igc_ethtool.c
> index f89c2cbaace0..0482e590bc5a 100644
> --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
> +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
> @@ -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,
> --
> 2.51.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh
2025-10-25 15:01 ` [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh Kohei Enju
2025-10-27 7:16 ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2025-10-28 18:12 ` Simon Horman
2025-11-02 8:43 ` [Intel-wired-lan] " Lifshits, Vitaly
2025-12-21 10:35 ` Avigail Dahan
2 siblings, 1 reply; 16+ messages in thread
From: Simon Horman @ 2025-10-28 18:12 UTC (permalink / raw)
To: Kohei Enju
Cc: intel-wired-lan, netdev, Tony Nguyen, Przemek Kitszel,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, kohei.enju
On Sun, Oct 26, 2025 at 12:01:31AM +0900, Kohei Enju wrote:
> Implement 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>`.
>
> Signed-off-by: Kohei Enju <enjuk@amazon.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh
2025-10-28 18:12 ` Simon Horman
@ 2025-11-02 8:43 ` Lifshits, Vitaly
0 siblings, 0 replies; 16+ messages in thread
From: Lifshits, Vitaly @ 2025-11-02 8:43 UTC (permalink / raw)
To: Simon Horman, Kohei Enju
Cc: intel-wired-lan, netdev, Tony Nguyen, Przemek Kitszel,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, kohei.enju
On 10/28/2025 8:12 PM, Simon Horman wrote:
> On Sun, Oct 26, 2025 at 12:01:31AM +0900, Kohei Enju wrote:
>> Implement 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>`.
>>
>> Signed-off-by: Kohei Enju <enjuk@amazon.com>
>
> Reviewed-by: Simon Horman <horms@kernel.org>
>
Reviewed-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh
2025-10-25 15:01 ` [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh Kohei Enju
2025-10-27 7:16 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-10-28 18:12 ` Simon Horman
@ 2025-12-21 10:35 ` Avigail Dahan
2 siblings, 0 replies; 16+ messages in thread
From: Avigail Dahan @ 2025-12-21 10:35 UTC (permalink / raw)
To: Kohei Enju, intel-wired-lan, netdev
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kohei.enju
On 25/10/2025 18:01, Kohei Enju wrote:
> Implement 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>`.
>
> Signed-off-by: Kohei Enju <enjuk@amazon.com>
> ---
> drivers/net/ethernet/intel/igc/igc_ethtool.c | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
>
Tested-by: Avigail Dahan <avigailx.dahan@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh
2025-10-25 15:01 [PATCH iwl-next v1 0/3] igc: add RSS key get/set support Kohei Enju
2025-10-25 15:01 ` [PATCH iwl-next v1 1/3] igc: prepare for " Kohei Enju
2025-10-25 15:01 ` [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh Kohei Enju
@ 2025-10-25 15:01 ` Kohei Enju
2025-10-27 7:16 ` [Intel-wired-lan] " Loktionov, Aleksandr
` (2 more replies)
2 siblings, 3 replies; 16+ messages in thread
From: Kohei Enju @ 2025-10-25 15:01 UTC (permalink / raw)
To: intel-wired-lan, netdev
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kohei.enju, 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 <enjuk@amazon.com>
---
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(-)
diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index dd159397d191..c894a5a99fc0 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -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;
diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index 0482e590bc5a..64eac1ccb3ff 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -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;
}
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 1f0a601cbcef..e977661bed2f 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -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;
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* RE: [Intel-wired-lan] [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh
2025-10-25 15:01 ` [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh Kohei Enju
@ 2025-10-27 7:16 ` Loktionov, Aleksandr
2025-10-28 18:12 ` Simon Horman
2025-12-21 13:20 ` Avigail Dahan
2 siblings, 0 replies; 16+ messages in thread
From: Loktionov, Aleksandr @ 2025-10-27 7:16 UTC (permalink / raw)
To: Kohei Enju, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org
Cc: Nguyen, Anthony L, Kitszel, Przemyslaw, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
kohei.enju@gmail.com
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Kohei Enju
> Sent: Saturday, October 25, 2025 5:02 PM
> To: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@intel.com>; Andrew Lunn
> <andrew+netdev@lunn.ch>; David S. Miller <davem@davemloft.net>; Eric
> Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo
> Abeni <pabeni@redhat.com>; kohei.enju@gmail.com; Kohei Enju
> <enjuk@amazon.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v1 3/3] 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 <enjuk@amazon.com>
> ---
> 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(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc.h
> b/drivers/net/ethernet/intel/igc/igc.h
> index dd159397d191..c894a5a99fc0 100644
> --- a/drivers/net/ethernet/intel/igc/igc.h
> +++ b/drivers/net/ethernet/intel/igc/igc.h
> @@ -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;
> diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c
> b/drivers/net/ethernet/intel/igc/igc_ethtool.c
> index 0482e590bc5a..64eac1ccb3ff 100644
> --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
> +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
> @@ -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;
> }
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c
> b/drivers/net/ethernet/intel/igc/igc_main.c
> index 1f0a601cbcef..e977661bed2f 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -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;
> --
> 2.51.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh
2025-10-25 15:01 ` [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh Kohei Enju
2025-10-27 7:16 ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2025-10-28 18:12 ` Simon Horman
2025-11-02 8:43 ` [Intel-wired-lan] " Lifshits, Vitaly
2025-12-21 13:20 ` Avigail Dahan
2 siblings, 1 reply; 16+ messages in thread
From: Simon Horman @ 2025-10-28 18:12 UTC (permalink / raw)
To: Kohei Enju
Cc: intel-wired-lan, netdev, Tony Nguyen, Przemek Kitszel,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, kohei.enju
On Sun, Oct 26, 2025 at 12:01:32AM +0900, Kohei Enju wrote:
> 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 <enjuk@amazon.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh
2025-10-28 18:12 ` Simon Horman
@ 2025-11-02 8:43 ` Lifshits, Vitaly
0 siblings, 0 replies; 16+ messages in thread
From: Lifshits, Vitaly @ 2025-11-02 8:43 UTC (permalink / raw)
To: Simon Horman, Kohei Enju
Cc: intel-wired-lan, netdev, Tony Nguyen, Przemek Kitszel,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, kohei.enju
On 10/28/2025 8:12 PM, Simon Horman wrote:
> On Sun, Oct 26, 2025 at 12:01:32AM +0900, Kohei Enju wrote:
>> 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 <enjuk@amazon.com>
>
> Reviewed-by: Simon Horman <horms@kernel.org>
>
Reviewed-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh
2025-10-25 15:01 ` [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh Kohei Enju
2025-10-27 7:16 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-10-28 18:12 ` Simon Horman
@ 2025-12-21 13:20 ` Avigail Dahan
2 siblings, 0 replies; 16+ messages in thread
From: Avigail Dahan @ 2025-12-21 13:20 UTC (permalink / raw)
To: Kohei Enju, intel-wired-lan, netdev
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kohei.enju
On 25/10/2025 18:01, Kohei Enju wrote:
> 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 <enjuk@amazon.com>
> ---
> 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(-)
>
Tested-by: Avigail Dahan <avigailx.dahan@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread