* [PATCH net-next 1/6] eth: cisco: migrate to new RXFH callbacks
2025-06-13 0:54 [PATCH net-next 0/6] eth: migrate to new RXFH callbacks (get-only drivres) Jakub Kicinski
@ 2025-06-13 0:54 ` Jakub Kicinski
2025-06-13 5:42 ` Joe Damato
2025-06-13 0:54 ` [PATCH net-next 2/6] eth: cxgb4: " Jakub Kicinski
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2025-06-13 0:54 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, bharat, benve,
satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, ecree.xilinx, rosenp, imx, Jakub Kicinski
Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
This driver's RXFH config is read only / fixed so the conversion
is trivial.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/cisco/enic/enic_ethtool.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/cisco/enic/enic_ethtool.c b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
index 529160926a96..a50f5dad34d5 100644
--- a/drivers/net/ethernet/cisco/enic/enic_ethtool.c
+++ b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
@@ -528,8 +528,10 @@ static int enic_grxclsrule(struct enic *enic, struct ethtool_rxnfc *cmd)
return 0;
}
-static int enic_get_rx_flow_hash(struct enic *enic, struct ethtool_rxnfc *cmd)
+static int enic_get_rx_flow_hash(struct net_device *dev,
+ struct ethtool_rxfh_fields *cmd)
{
+ struct enic *enic = netdev_priv(dev);
u8 rss_hash_type = 0;
cmd->data = 0;
@@ -597,9 +599,6 @@ static int enic_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
ret = enic_grxclsrule(enic, cmd);
spin_unlock_bh(&enic->rfs_h.lock);
break;
- case ETHTOOL_GRXFH:
- ret = enic_get_rx_flow_hash(enic, cmd);
- break;
default:
ret = -EOPNOTSUPP;
break;
@@ -693,6 +692,7 @@ static const struct ethtool_ops enic_ethtool_ops = {
.get_rxfh_key_size = enic_get_rxfh_key_size,
.get_rxfh = enic_get_rxfh,
.set_rxfh = enic_set_rxfh,
+ .get_rxfh_fields = enic_get_rx_flow_hash,
.get_link_ksettings = enic_get_ksettings,
.get_ts_info = enic_get_ts_info,
.get_channels = enic_get_channels,
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH net-next 1/6] eth: cisco: migrate to new RXFH callbacks
2025-06-13 0:54 ` [PATCH net-next 1/6] eth: cisco: migrate to new RXFH callbacks Jakub Kicinski
@ 2025-06-13 5:42 ` Joe Damato
0 siblings, 0 replies; 15+ messages in thread
From: Joe Damato @ 2025-06-13 5:42 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, bharat,
benve, satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, ecree.xilinx, rosenp, imx
On Thu, Jun 12, 2025 at 05:54:04PM -0700, Jakub Kicinski wrote:
> Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
> add dedicated callbacks for getting and setting rxfh fields").
> This driver's RXFH config is read only / fixed so the conversion
> is trivial.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> drivers/net/ethernet/cisco/enic/enic_ethtool.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH net-next 2/6] eth: cxgb4: migrate to new RXFH callbacks
2025-06-13 0:54 [PATCH net-next 0/6] eth: migrate to new RXFH callbacks (get-only drivres) Jakub Kicinski
2025-06-13 0:54 ` [PATCH net-next 1/6] eth: cisco: migrate to new RXFH callbacks Jakub Kicinski
@ 2025-06-13 0:54 ` Jakub Kicinski
2025-06-13 5:43 ` Joe Damato
2025-06-13 0:54 ` [PATCH net-next 3/6] eth: lan743x: " Jakub Kicinski
` (3 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2025-06-13 0:54 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, bharat, benve,
satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, ecree.xilinx, rosenp, imx, Jakub Kicinski
Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
This driver's RXFH config is read only / fixed so the conversion
is purely factoring out the handling into a helper.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
.../ethernet/chelsio/cxgb4/cxgb4_ethtool.c | 105 +++++++++---------
1 file changed, 55 insertions(+), 50 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c
index 1546c3db08f0..23326235d4ab 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c
@@ -1730,6 +1730,60 @@ static int cxgb4_ntuple_get_filter(struct net_device *dev,
return 0;
}
+static int cxgb4_get_rxfh_fields(struct net_device *dev,
+ struct ethtool_rxfh_fields *info)
+{
+ const struct port_info *pi = netdev_priv(dev);
+ unsigned int v = pi->rss_mode;
+
+ info->data = 0;
+ switch (info->flow_type) {
+ case TCP_V4_FLOW:
+ if (v & FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_F)
+ info->data = RXH_IP_SRC | RXH_IP_DST |
+ RXH_L4_B_0_1 | RXH_L4_B_2_3;
+ else if (v & FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F)
+ info->data = RXH_IP_SRC | RXH_IP_DST;
+ break;
+ case UDP_V4_FLOW:
+ if ((v & FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_F) &&
+ (v & FW_RSS_VI_CONFIG_CMD_UDPEN_F))
+ info->data = RXH_IP_SRC | RXH_IP_DST |
+ RXH_L4_B_0_1 | RXH_L4_B_2_3;
+ else if (v & FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F)
+ info->data = RXH_IP_SRC | RXH_IP_DST;
+ break;
+ case SCTP_V4_FLOW:
+ case AH_ESP_V4_FLOW:
+ case IPV4_FLOW:
+ if (v & FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F)
+ info->data = RXH_IP_SRC | RXH_IP_DST;
+ break;
+ case TCP_V6_FLOW:
+ if (v & FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_F)
+ info->data = RXH_IP_SRC | RXH_IP_DST |
+ RXH_L4_B_0_1 | RXH_L4_B_2_3;
+ else if (v & FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F)
+ info->data = RXH_IP_SRC | RXH_IP_DST;
+ break;
+ case UDP_V6_FLOW:
+ if ((v & FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_F) &&
+ (v & FW_RSS_VI_CONFIG_CMD_UDPEN_F))
+ info->data = RXH_IP_SRC | RXH_IP_DST |
+ RXH_L4_B_0_1 | RXH_L4_B_2_3;
+ else if (v & FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F)
+ info->data = RXH_IP_SRC | RXH_IP_DST;
+ break;
+ case SCTP_V6_FLOW:
+ case AH_ESP_V6_FLOW:
+ case IPV6_FLOW:
+ if (v & FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F)
+ info->data = RXH_IP_SRC | RXH_IP_DST;
+ break;
+ }
+ return 0;
+}
+
static int get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
u32 *rules)
{
@@ -1739,56 +1793,6 @@ static int get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
int ret = 0;
switch (info->cmd) {
- case ETHTOOL_GRXFH: {
- unsigned int v = pi->rss_mode;
-
- info->data = 0;
- switch (info->flow_type) {
- case TCP_V4_FLOW:
- if (v & FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_F)
- info->data = RXH_IP_SRC | RXH_IP_DST |
- RXH_L4_B_0_1 | RXH_L4_B_2_3;
- else if (v & FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F)
- info->data = RXH_IP_SRC | RXH_IP_DST;
- break;
- case UDP_V4_FLOW:
- if ((v & FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_F) &&
- (v & FW_RSS_VI_CONFIG_CMD_UDPEN_F))
- info->data = RXH_IP_SRC | RXH_IP_DST |
- RXH_L4_B_0_1 | RXH_L4_B_2_3;
- else if (v & FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F)
- info->data = RXH_IP_SRC | RXH_IP_DST;
- break;
- case SCTP_V4_FLOW:
- case AH_ESP_V4_FLOW:
- case IPV4_FLOW:
- if (v & FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F)
- info->data = RXH_IP_SRC | RXH_IP_DST;
- break;
- case TCP_V6_FLOW:
- if (v & FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_F)
- info->data = RXH_IP_SRC | RXH_IP_DST |
- RXH_L4_B_0_1 | RXH_L4_B_2_3;
- else if (v & FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F)
- info->data = RXH_IP_SRC | RXH_IP_DST;
- break;
- case UDP_V6_FLOW:
- if ((v & FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_F) &&
- (v & FW_RSS_VI_CONFIG_CMD_UDPEN_F))
- info->data = RXH_IP_SRC | RXH_IP_DST |
- RXH_L4_B_0_1 | RXH_L4_B_2_3;
- else if (v & FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F)
- info->data = RXH_IP_SRC | RXH_IP_DST;
- break;
- case SCTP_V6_FLOW:
- case AH_ESP_V6_FLOW:
- case IPV6_FLOW:
- if (v & FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F)
- info->data = RXH_IP_SRC | RXH_IP_DST;
- break;
- }
- return 0;
- }
case ETHTOOL_GRXRINGS:
info->data = pi->nqsets;
return 0;
@@ -2199,6 +2203,7 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
.get_rxfh_indir_size = get_rss_table_size,
.get_rxfh = get_rss_table,
.set_rxfh = set_rss_table,
+ .get_rxfh_fields = cxgb4_get_rxfh_fields,
.self_test = cxgb4_self_test,
.flash_device = set_flash,
.get_ts_info = get_ts_info,
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH net-next 2/6] eth: cxgb4: migrate to new RXFH callbacks
2025-06-13 0:54 ` [PATCH net-next 2/6] eth: cxgb4: " Jakub Kicinski
@ 2025-06-13 5:43 ` Joe Damato
0 siblings, 0 replies; 15+ messages in thread
From: Joe Damato @ 2025-06-13 5:43 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, bharat,
benve, satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, ecree.xilinx, rosenp, imx
On Thu, Jun 12, 2025 at 05:54:05PM -0700, Jakub Kicinski wrote:
> Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
> add dedicated callbacks for getting and setting rxfh fields").
> This driver's RXFH config is read only / fixed so the conversion
> is purely factoring out the handling into a helper.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c | 105 +++++++++---------
> 1 file changed, 55 insertions(+), 50 deletions(-)
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH net-next 3/6] eth: lan743x: migrate to new RXFH callbacks
2025-06-13 0:54 [PATCH net-next 0/6] eth: migrate to new RXFH callbacks (get-only drivres) Jakub Kicinski
2025-06-13 0:54 ` [PATCH net-next 1/6] eth: cisco: migrate to new RXFH callbacks Jakub Kicinski
2025-06-13 0:54 ` [PATCH net-next 2/6] eth: cxgb4: " Jakub Kicinski
@ 2025-06-13 0:54 ` Jakub Kicinski
2025-06-13 5:44 ` Joe Damato
2025-06-13 0:54 ` [PATCH net-next 4/6] eth: e1000e: " Jakub Kicinski
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2025-06-13 0:54 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, bharat, benve,
satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, ecree.xilinx, rosenp, imx, Jakub Kicinski
Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
This driver's RXFH config is read only / fixed so the conversion
is purely factoring out the handling into a helper.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
.../net/ethernet/microchip/lan743x_ethtool.c | 31 ++++++++++++-------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/microchip/lan743x_ethtool.c b/drivers/net/ethernet/microchip/lan743x_ethtool.c
index 64a3b953cc17..40002d9fe274 100644
--- a/drivers/net/ethernet/microchip/lan743x_ethtool.c
+++ b/drivers/net/ethernet/microchip/lan743x_ethtool.c
@@ -913,23 +913,29 @@ static int lan743x_ethtool_get_sset_count(struct net_device *netdev, int sset)
}
}
+static int lan743x_ethtool_get_rxfh_fields(struct net_device *netdev,
+ struct ethtool_rxfh_fields *fields)
+{
+ fields->data = 0;
+
+ switch (fields->flow_type) {
+ case TCP_V4_FLOW:case UDP_V4_FLOW:
+ case TCP_V6_FLOW:case UDP_V6_FLOW:
+ fields->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+ fallthrough;
+ case IPV4_FLOW: case IPV6_FLOW:
+ fields->data |= RXH_IP_SRC | RXH_IP_DST;
+ return 0;
+ }
+
+ return 0;
+}
+
static int lan743x_ethtool_get_rxnfc(struct net_device *netdev,
struct ethtool_rxnfc *rxnfc,
u32 *rule_locs)
{
switch (rxnfc->cmd) {
- case ETHTOOL_GRXFH:
- rxnfc->data = 0;
- switch (rxnfc->flow_type) {
- case TCP_V4_FLOW:case UDP_V4_FLOW:
- case TCP_V6_FLOW:case UDP_V6_FLOW:
- rxnfc->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
- fallthrough;
- case IPV4_FLOW: case IPV6_FLOW:
- rxnfc->data |= RXH_IP_SRC | RXH_IP_DST;
- return 0;
- }
- break;
case ETHTOOL_GRXRINGS:
rxnfc->data = LAN743X_USED_RX_CHANNELS;
return 0;
@@ -1368,6 +1374,7 @@ const struct ethtool_ops lan743x_ethtool_ops = {
.get_rxfh_indir_size = lan743x_ethtool_get_rxfh_indir_size,
.get_rxfh = lan743x_ethtool_get_rxfh,
.set_rxfh = lan743x_ethtool_set_rxfh,
+ .get_rxfh_fields = lan743x_ethtool_get_rxfh_fields,
.get_ts_info = lan743x_ethtool_get_ts_info,
.get_eee = lan743x_ethtool_get_eee,
.set_eee = lan743x_ethtool_set_eee,
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH net-next 3/6] eth: lan743x: migrate to new RXFH callbacks
2025-06-13 0:54 ` [PATCH net-next 3/6] eth: lan743x: " Jakub Kicinski
@ 2025-06-13 5:44 ` Joe Damato
0 siblings, 0 replies; 15+ messages in thread
From: Joe Damato @ 2025-06-13 5:44 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, bharat,
benve, satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, ecree.xilinx, rosenp, imx
On Thu, Jun 12, 2025 at 05:54:06PM -0700, Jakub Kicinski wrote:
> Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
> add dedicated callbacks for getting and setting rxfh fields").
> This driver's RXFH config is read only / fixed so the conversion
> is purely factoring out the handling into a helper.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> .../net/ethernet/microchip/lan743x_ethtool.c | 31 ++++++++++++-------
> 1 file changed, 19 insertions(+), 12 deletions(-)
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH net-next 4/6] eth: e1000e: migrate to new RXFH callbacks
2025-06-13 0:54 [PATCH net-next 0/6] eth: migrate to new RXFH callbacks (get-only drivres) Jakub Kicinski
` (2 preceding siblings ...)
2025-06-13 0:54 ` [PATCH net-next 3/6] eth: lan743x: " Jakub Kicinski
@ 2025-06-13 0:54 ` Jakub Kicinski
2025-06-13 5:46 ` Joe Damato
2025-06-13 0:54 ` [PATCH net-next 5/6] eth: enetc: " Jakub Kicinski
2025-06-13 0:54 ` [PATCH net-next 6/6] eth: sfc: falcon: " Jakub Kicinski
5 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2025-06-13 0:54 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, bharat, benve,
satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, ecree.xilinx, rosenp, imx, Jakub Kicinski
Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
This driver's RXFH config is read only / fixed and it's the only
get_rxnfc sub-command the driver supports. So convert the get_rxnfc
handler into a get_rxfh_fields handler.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/intel/e1000e/ethtool.c | 77 ++++++++++-----------
1 file changed, 35 insertions(+), 42 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index 9364bc2b4eb1..c0bbb12eed2e 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -2096,54 +2096,47 @@ static void e1000_get_strings(struct net_device __always_unused *netdev,
}
}
-static int e1000_get_rxnfc(struct net_device *netdev,
- struct ethtool_rxnfc *info,
- u32 __always_unused *rule_locs)
+static int e1000_get_rxfh_fields(struct net_device *netdev,
+ struct ethtool_rxfh_fields *info)
{
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
+ u32 mrqc;
+
info->data = 0;
- switch (info->cmd) {
- case ETHTOOL_GRXFH: {
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_hw *hw = &adapter->hw;
- u32 mrqc;
+ mrqc = er32(MRQC);
- mrqc = er32(MRQC);
-
- if (!(mrqc & E1000_MRQC_RSS_FIELD_MASK))
- return 0;
-
- switch (info->flow_type) {
- case TCP_V4_FLOW:
- if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_TCP)
- info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
- fallthrough;
- case UDP_V4_FLOW:
- case SCTP_V4_FLOW:
- case AH_ESP_V4_FLOW:
- case IPV4_FLOW:
- if (mrqc & E1000_MRQC_RSS_FIELD_IPV4)
- info->data |= RXH_IP_SRC | RXH_IP_DST;
- break;
- case TCP_V6_FLOW:
- if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP)
- info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
- fallthrough;
- case UDP_V6_FLOW:
- case SCTP_V6_FLOW:
- case AH_ESP_V6_FLOW:
- case IPV6_FLOW:
- if (mrqc & E1000_MRQC_RSS_FIELD_IPV6)
- info->data |= RXH_IP_SRC | RXH_IP_DST;
- break;
- default:
- break;
- }
+ if (!(mrqc & E1000_MRQC_RSS_FIELD_MASK))
return 0;
- }
+
+ switch (info->flow_type) {
+ case TCP_V4_FLOW:
+ if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_TCP)
+ info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+ fallthrough;
+ case UDP_V4_FLOW:
+ case SCTP_V4_FLOW:
+ case AH_ESP_V4_FLOW:
+ case IPV4_FLOW:
+ if (mrqc & E1000_MRQC_RSS_FIELD_IPV4)
+ info->data |= RXH_IP_SRC | RXH_IP_DST;
+ break;
+ case TCP_V6_FLOW:
+ if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP)
+ info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+ fallthrough;
+ case UDP_V6_FLOW:
+ case SCTP_V6_FLOW:
+ case AH_ESP_V6_FLOW:
+ case IPV6_FLOW:
+ if (mrqc & E1000_MRQC_RSS_FIELD_IPV6)
+ info->data |= RXH_IP_SRC | RXH_IP_DST;
+ break;
default:
- return -EOPNOTSUPP;
+ break;
}
+ return 0;
}
static int e1000e_get_eee(struct net_device *netdev, struct ethtool_keee *edata)
@@ -2352,7 +2345,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
.get_sset_count = e1000e_get_sset_count,
.get_coalesce = e1000_get_coalesce,
.set_coalesce = e1000_set_coalesce,
- .get_rxnfc = e1000_get_rxnfc,
+ .get_rxfh_fields = e1000_get_rxfh_fields,
.get_ts_info = e1000e_get_ts_info,
.get_eee = e1000e_get_eee,
.set_eee = e1000e_set_eee,
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH net-next 4/6] eth: e1000e: migrate to new RXFH callbacks
2025-06-13 0:54 ` [PATCH net-next 4/6] eth: e1000e: " Jakub Kicinski
@ 2025-06-13 5:46 ` Joe Damato
0 siblings, 0 replies; 15+ messages in thread
From: Joe Damato @ 2025-06-13 5:46 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, bharat,
benve, satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, ecree.xilinx, rosenp, imx
On Thu, Jun 12, 2025 at 05:54:07PM -0700, Jakub Kicinski wrote:
> Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
> add dedicated callbacks for getting and setting rxfh fields").
> This driver's RXFH config is read only / fixed and it's the only
> get_rxnfc sub-command the driver supports. So convert the get_rxnfc
> handler into a get_rxfh_fields handler.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> drivers/net/ethernet/intel/e1000e/ethtool.c | 77 ++++++++++-----------
> 1 file changed, 35 insertions(+), 42 deletions(-)
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH net-next 5/6] eth: enetc: migrate to new RXFH callbacks
2025-06-13 0:54 [PATCH net-next 0/6] eth: migrate to new RXFH callbacks (get-only drivres) Jakub Kicinski
` (3 preceding siblings ...)
2025-06-13 0:54 ` [PATCH net-next 4/6] eth: e1000e: " Jakub Kicinski
@ 2025-06-13 0:54 ` Jakub Kicinski
2025-06-13 2:00 ` Wei Fang
2025-06-13 0:54 ` [PATCH net-next 6/6] eth: sfc: falcon: " Jakub Kicinski
5 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2025-06-13 0:54 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, bharat, benve,
satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, ecree.xilinx, rosenp, imx, Jakub Kicinski
Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
This driver's RXFH config is read only / fixed so the conversion
is trivial.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
index d38cd36be4a6..bb0512d585c1 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
@@ -467,7 +467,8 @@ static void enetc_get_rmon_stats(struct net_device *ndev,
#define ENETC_RSSHASH_L3 (RXH_L2DA | RXH_VLAN | RXH_L3_PROTO | RXH_IP_SRC | \
RXH_IP_DST)
#define ENETC_RSSHASH_L4 (ENETC_RSSHASH_L3 | RXH_L4_B_0_1 | RXH_L4_B_2_3)
-static int enetc_get_rsshash(struct ethtool_rxnfc *rxnfc)
+static int enetc_get_rxfh_fields(struct net_device *netdev,
+ struct ethtool_rxfh_fields *rxnfc)
{
static const u32 rsshash[] = {
[TCP_V4_FLOW] = ENETC_RSSHASH_L4,
@@ -584,9 +585,6 @@ static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc,
case ETHTOOL_GRXRINGS:
rxnfc->data = priv->num_rx_rings;
break;
- case ETHTOOL_GRXFH:
- /* get RSS hash config */
- return enetc_get_rsshash(rxnfc);
case ETHTOOL_GRXCLSRLCNT:
/* total number of entries */
rxnfc->data = priv->si->num_fs_entries;
@@ -639,8 +637,6 @@ static int enetc4_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc
case ETHTOOL_GRXRINGS:
rxnfc->data = priv->num_rx_rings;
break;
- case ETHTOOL_GRXFH:
- return enetc_get_rsshash(rxnfc);
default:
return -EOPNOTSUPP;
}
@@ -1228,6 +1224,7 @@ const struct ethtool_ops enetc_pf_ethtool_ops = {
.get_rxfh_indir_size = enetc_get_rxfh_indir_size,
.get_rxfh = enetc_get_rxfh,
.set_rxfh = enetc_set_rxfh,
+ .get_rxfh_fields = enetc_get_rxfh_fields,
.get_ringparam = enetc_get_ringparam,
.get_coalesce = enetc_get_coalesce,
.set_coalesce = enetc_set_coalesce,
@@ -1258,6 +1255,7 @@ const struct ethtool_ops enetc_vf_ethtool_ops = {
.get_rxfh_indir_size = enetc_get_rxfh_indir_size,
.get_rxfh = enetc_get_rxfh,
.set_rxfh = enetc_set_rxfh,
+ .get_rxfh_fields = enetc_get_rxfh_fields,
.get_ringparam = enetc_get_ringparam,
.get_coalesce = enetc_get_coalesce,
.set_coalesce = enetc_set_coalesce,
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* RE: [PATCH net-next 5/6] eth: enetc: migrate to new RXFH callbacks
2025-06-13 0:54 ` [PATCH net-next 5/6] eth: enetc: " Jakub Kicinski
@ 2025-06-13 2:00 ` Wei Fang
0 siblings, 0 replies; 15+ messages in thread
From: Wei Fang @ 2025-06-13 2:00 UTC (permalink / raw)
To: Jakub Kicinski, davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org, bharat@chelsio.com,
benve@cisco.com, satishkh@cisco.com, Claudiu Manoil,
Vladimir Oltean, Clark Wang, anthony.l.nguyen@intel.com,
przemyslaw.kitszel@intel.com, bryan.whitehead@microchip.com,
ecree.xilinx@gmail.com, rosenp@gmail.com, imx@lists.linux.dev
> @@ -1228,6 +1224,7 @@ const struct ethtool_ops enetc_pf_ethtool_ops = {
> .get_rxfh_indir_size = enetc_get_rxfh_indir_size,
> .get_rxfh = enetc_get_rxfh,
> .set_rxfh = enetc_set_rxfh,
> + .get_rxfh_fields = enetc_get_rxfh_fields,
> .get_ringparam = enetc_get_ringparam,
> .get_coalesce = enetc_get_coalesce,
> .set_coalesce = enetc_set_coalesce,
> @@ -1258,6 +1255,7 @@ const struct ethtool_ops enetc_vf_ethtool_ops = {
> .get_rxfh_indir_size = enetc_get_rxfh_indir_size,
> .get_rxfh = enetc_get_rxfh,
> .set_rxfh = enetc_set_rxfh,
> + .get_rxfh_fields = enetc_get_rxfh_fields,
> .get_ringparam = enetc_get_ringparam,
> .get_coalesce = enetc_get_coalesce,
> .set_coalesce = enetc_set_coalesce,
> --
Hi Jakub,
The .get_rxfh_fields callback also needs to added to enetc4_pf_ethtool_ops.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH net-next 6/6] eth: sfc: falcon: migrate to new RXFH callbacks
2025-06-13 0:54 [PATCH net-next 0/6] eth: migrate to new RXFH callbacks (get-only drivres) Jakub Kicinski
` (4 preceding siblings ...)
2025-06-13 0:54 ` [PATCH net-next 5/6] eth: enetc: " Jakub Kicinski
@ 2025-06-13 0:54 ` Jakub Kicinski
2025-06-13 13:44 ` Edward Cree
5 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2025-06-13 0:54 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, bharat, benve,
satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, ecree.xilinx, rosenp, imx, Jakub Kicinski
Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
This driver's RXFH config is read only / fixed so the conversion
is purely factoring out the handling into a helper.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/sfc/falcon/ethtool.c | 51 +++++++++++++----------
1 file changed, 28 insertions(+), 23 deletions(-)
diff --git a/drivers/net/ethernet/sfc/falcon/ethtool.c b/drivers/net/ethernet/sfc/falcon/ethtool.c
index 04766448a545..6685e71ab13f 100644
--- a/drivers/net/ethernet/sfc/falcon/ethtool.c
+++ b/drivers/net/ethernet/sfc/falcon/ethtool.c
@@ -943,6 +943,33 @@ static int ef4_ethtool_get_class_rule(struct ef4_nic *efx,
return rc;
}
+static int
+ef4_ethtool_get_rxfh_fields(struct net_device *net_dev,
+ struct ethtool_rxfh_fields *info)
+{
+ struct ef4_nic *efx = netdev_priv(net_dev);
+ unsigned int min_revision = 0;
+
+ info->data = 0;
+ switch (info->flow_type) {
+ case TCP_V4_FLOW:
+ info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+ fallthrough;
+ case UDP_V4_FLOW:
+ case SCTP_V4_FLOW:
+ case AH_ESP_V4_FLOW:
+ case IPV4_FLOW:
+ info->data |= RXH_IP_SRC | RXH_IP_DST;
+ min_revision = EF4_REV_FALCON_B0;
+ break;
+ default:
+ break;
+ }
+ if (ef4_nic_rev(efx) < min_revision)
+ info->data = 0;
+ return 0;
+}
+
static int
ef4_ethtool_get_rxnfc(struct net_device *net_dev,
struct ethtool_rxnfc *info, u32 *rule_locs)
@@ -954,29 +981,6 @@ ef4_ethtool_get_rxnfc(struct net_device *net_dev,
info->data = efx->n_rx_channels;
return 0;
- case ETHTOOL_GRXFH: {
- unsigned min_revision = 0;
-
- info->data = 0;
- switch (info->flow_type) {
- case TCP_V4_FLOW:
- info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
- fallthrough;
- case UDP_V4_FLOW:
- case SCTP_V4_FLOW:
- case AH_ESP_V4_FLOW:
- case IPV4_FLOW:
- info->data |= RXH_IP_SRC | RXH_IP_DST;
- min_revision = EF4_REV_FALCON_B0;
- break;
- default:
- break;
- }
- if (ef4_nic_rev(efx) < min_revision)
- info->data = 0;
- return 0;
- }
-
case ETHTOOL_GRXCLSRLCNT:
info->data = ef4_filter_get_rx_id_limit(efx);
if (info->data == 0)
@@ -1343,6 +1347,7 @@ const struct ethtool_ops ef4_ethtool_ops = {
.get_rxfh_indir_size = ef4_ethtool_get_rxfh_indir_size,
.get_rxfh = ef4_ethtool_get_rxfh,
.set_rxfh = ef4_ethtool_set_rxfh,
+ .get_rxfh_fields = ef4_ethtool_get_rxfh_fields,
.get_module_info = ef4_ethtool_get_module_info,
.get_module_eeprom = ef4_ethtool_get_module_eeprom,
.get_link_ksettings = ef4_ethtool_get_link_ksettings,
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH net-next 6/6] eth: sfc: falcon: migrate to new RXFH callbacks
2025-06-13 0:54 ` [PATCH net-next 6/6] eth: sfc: falcon: " Jakub Kicinski
@ 2025-06-13 13:44 ` Edward Cree
2025-06-13 14:50 ` Jakub Kicinski
0 siblings, 1 reply; 15+ messages in thread
From: Edward Cree @ 2025-06-13 13:44 UTC (permalink / raw)
To: Jakub Kicinski, davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, bharat, benve,
satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, rosenp, imx
On 13/06/2025 01:54, Jakub Kicinski wrote:
> Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
> add dedicated callbacks for getting and setting rxfh fields").
> This driver's RXFH config is read only / fixed so the conversion
> is purely factoring out the handling into a helper.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> drivers/net/ethernet/sfc/falcon/ethtool.c | 51 +++++++++++++----------
> 1 file changed, 28 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/net/ethernet/sfc/falcon/ethtool.c b/drivers/net/ethernet/sfc/falcon/ethtool.c
> index 04766448a545..6685e71ab13f 100644
> --- a/drivers/net/ethernet/sfc/falcon/ethtool.c
> +++ b/drivers/net/ethernet/sfc/falcon/ethtool.c
> @@ -943,6 +943,33 @@ static int ef4_ethtool_get_class_rule(struct ef4_nic *efx,
> return rc;
> }
>
> +static int
> +ef4_ethtool_get_rxfh_fields(struct net_device *net_dev,
> + struct ethtool_rxfh_fields *info)
> +{
> + struct ef4_nic *efx = netdev_priv(net_dev);
> + unsigned int min_revision = 0;
> +
> + info->data = 0;
> + switch (info->flow_type) {
> + case TCP_V4_FLOW:
> + info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
> + fallthrough;
> + case UDP_V4_FLOW:
> + case SCTP_V4_FLOW:
> + case AH_ESP_V4_FLOW:
> + case IPV4_FLOW:
> + info->data |= RXH_IP_SRC | RXH_IP_DST;
> + min_revision = EF4_REV_FALCON_B0;
> + break;
> + default:
> + break;
> + }
> + if (ef4_nic_rev(efx) < min_revision)
> + info->data = 0;
> + return 0;
So granted that you're only moving code, but looking at this it doesn't
actually make sense, since every path that sets info->data to nonzero
also sets min_revision, so why not just do the ef4_nic_rev() check at
the start? Answer, from git log spelunking, is that when this code was
shared with Siena, EFX_REV_SIENA_A0 supported IPv6 here.
Have a
Reviewed-By: Edward Cree <ecree.xilinx@gmail.com>
... but this patch could be followed-up with a simplification to put
if (ef4_nic_rev(efx) < EF4_REV_FALCON_B0)
return 0;
before the switch and get rid of min_revision.
Falcon is long since end-of-life, so I don't have any NICs and can't run
any tests, which maybe means the smart thing to do is just to leave well
alone and not touch this code beyond your factoring.
*twitches with barely-suppressed urge to fix it anyway*
-ed
PS: I spent about two hours reading device documentation from 2008
because I thought it said Falcon did 4-tuple hashing on UDP too. For
the record: the 'Falcon hash' was broken (in some unspecified way), so
falcon_init_rx_cfg() selects the Toeplitz hash which does indeed only
consume port numbers on these devices if protocol is TCP. And I will
never get that time back :/
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH net-next 6/6] eth: sfc: falcon: migrate to new RXFH callbacks
2025-06-13 13:44 ` Edward Cree
@ 2025-06-13 14:50 ` Jakub Kicinski
2025-06-16 15:32 ` Edward Cree
0 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2025-06-13 14:50 UTC (permalink / raw)
To: Edward Cree
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, bharat,
benve, satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, rosenp, imx
On Fri, 13 Jun 2025 14:44:40 +0100 Edward Cree wrote:
> So granted that you're only moving code, but looking at this it doesn't
> actually make sense, since every path that sets info->data to nonzero
> also sets min_revision, so why not just do the ef4_nic_rev() check at
> the start? Answer, from git log spelunking, is that when this code was
> shared with Siena, EFX_REV_SIENA_A0 supported IPv6 here.
Ack, I was tempted to clean this up, but it felt slightly outside of
the objective. Looks like I need to respin for enetc - I can change
it in v2 if you'd like?
> Have a
> Reviewed-By: Edward Cree <ecree.xilinx@gmail.com>
> ... but this patch could be followed-up with a simplification to put
> if (ef4_nic_rev(efx) < EF4_REV_FALCON_B0)
> return 0;
> before the switch and get rid of min_revision.
> Falcon is long since end-of-life, so I don't have any NICs and can't run
> any tests, which maybe means the smart thing to do is just to leave well
> alone and not touch this code beyond your factoring.
>
> *twitches with barely-suppressed urge to fix it anyway*
> -ed
>
> PS: I spent about two hours reading device documentation from 2008
> because I thought it said Falcon did 4-tuple hashing on UDP too. For
> the record: the 'Falcon hash' was broken (in some unspecified way), so
> falcon_init_rx_cfg() selects the Toeplitz hash which does indeed only
> consume port numbers on these devices if protocol is TCP. And I will
> never get that time back :/
:D
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next 6/6] eth: sfc: falcon: migrate to new RXFH callbacks
2025-06-13 14:50 ` Jakub Kicinski
@ 2025-06-16 15:32 ` Edward Cree
0 siblings, 0 replies; 15+ messages in thread
From: Edward Cree @ 2025-06-16 15:32 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, bharat,
benve, satishkh, claudiu.manoil, vladimir.oltean, wei.fang,
xiaoning.wang, anthony.l.nguyen, przemyslaw.kitszel,
bryan.whitehead, rosenp, imx
On 13/06/2025 15:50, Jakub Kicinski wrote:
> On Fri, 13 Jun 2025 14:44:40 +0100 Edward Cree wrote:
>> So granted that you're only moving code, but looking at this it doesn't
>> actually make sense, since every path that sets info->data to nonzero
>> also sets min_revision, so why not just do the ef4_nic_rev() check at
>> the start? Answer, from git log spelunking, is that when this code was
>> shared with Siena, EFX_REV_SIENA_A0 supported IPv6 here.
>
> Ack, I was tempted to clean this up, but it felt slightly outside of
> the objective. Looks like I need to respin for enetc - I can change
> it in v2 if you'd like?
I'd say just keep your patch as is, then I'll send a follow-up that does
the refactor and also adds a comment about why the hashing config is what
it is.
^ permalink raw reply [flat|nested] 15+ messages in thread