netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers)
@ 2025-06-14 18:06 Jakub Kicinski
  2025-06-14 18:06 ` [PATCH net-next v2 1/5] eth: cisco: migrate to new RXFH callbacks Jakub Kicinski
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Jakub Kicinski @ 2025-06-14 18:06 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 the drivers which only implement ETHTOOL_GRXFH to
the recently added dedicated .get_rxfh_fields ethtool callback.

v2:
 - fix enetc
 - move the sfc falcon patch to later series in case I need to refactor
v1: https://lore.kernel.org/20250613005409.3544529-1-kuba@kernel.org

Jakub Kicinski (5):
  eth: cisco: migrate to new RXFH callbacks
  eth: cxgb4: migrate to new RXFH callbacks
  eth: lan743x: migrate to new RXFH callbacks
  eth: e1000e: migrate to new RXFH callbacks
  eth: enetc: migrate to new RXFH callbacks

 .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    | 105 +++++++++---------
 .../net/ethernet/cisco/enic/enic_ethtool.c    |   8 +-
 .../ethernet/freescale/enetc/enetc_ethtool.c  |  11 +-
 drivers/net/ethernet/intel/e1000e/ethtool.c   |  77 ++++++-------
 .../net/ethernet/microchip/lan743x_ethtool.c  |  31 ++++--
 5 files changed, 118 insertions(+), 114 deletions(-)

-- 
2.49.0


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

* [PATCH net-next v2 1/5] eth: cisco: migrate to new RXFH callbacks
  2025-06-14 18:06 [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers) Jakub Kicinski
@ 2025-06-14 18:06 ` Jakub Kicinski
  2025-06-14 18:06 ` [PATCH net-next v2 2/5] eth: cxgb4: " Jakub Kicinski
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Jakub Kicinski @ 2025-06-14 18:06 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,
	Joe Damato

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.

Reviewed-by: Joe Damato <joe@dama.to>
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] 10+ messages in thread

* [PATCH net-next v2 2/5] eth: cxgb4: migrate to new RXFH callbacks
  2025-06-14 18:06 [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers) Jakub Kicinski
  2025-06-14 18:06 ` [PATCH net-next v2 1/5] eth: cisco: migrate to new RXFH callbacks Jakub Kicinski
@ 2025-06-14 18:06 ` Jakub Kicinski
  2025-06-14 18:06 ` [PATCH net-next v2 3/5] eth: lan743x: " Jakub Kicinski
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Jakub Kicinski @ 2025-06-14 18:06 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,
	Joe Damato

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.

Reviewed-by: Joe Damato <joe@dama.to>
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] 10+ messages in thread

* [PATCH net-next v2 3/5] eth: lan743x: migrate to new RXFH callbacks
  2025-06-14 18:06 [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers) Jakub Kicinski
  2025-06-14 18:06 ` [PATCH net-next v2 1/5] eth: cisco: migrate to new RXFH callbacks Jakub Kicinski
  2025-06-14 18:06 ` [PATCH net-next v2 2/5] eth: cxgb4: " Jakub Kicinski
@ 2025-06-14 18:06 ` Jakub Kicinski
  2025-06-14 18:06 ` [PATCH net-next v2 4/5] eth: e1000e: " Jakub Kicinski
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Jakub Kicinski @ 2025-06-14 18:06 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,
	Joe Damato

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.

Reviewed-by: Joe Damato <joe@dama.to>
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] 10+ messages in thread

* [PATCH net-next v2 4/5] eth: e1000e: migrate to new RXFH callbacks
  2025-06-14 18:06 [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers) Jakub Kicinski
                   ` (2 preceding siblings ...)
  2025-06-14 18:06 ` [PATCH net-next v2 3/5] eth: lan743x: " Jakub Kicinski
@ 2025-06-14 18:06 ` Jakub Kicinski
  2025-06-16 18:07   ` Tony Nguyen
  2025-06-14 18:06 ` [PATCH net-next v2 5/5] eth: enetc: " Jakub Kicinski
  2025-06-17  1:40 ` [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers) patchwork-bot+netdevbpf
  5 siblings, 1 reply; 10+ messages in thread
From: Jakub Kicinski @ 2025-06-14 18:06 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,
	Joe Damato

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.

Reviewed-by: Joe Damato <joe@dama.to>
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] 10+ messages in thread

* [PATCH net-next v2 5/5] eth: enetc: migrate to new RXFH callbacks
  2025-06-14 18:06 [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers) Jakub Kicinski
                   ` (3 preceding siblings ...)
  2025-06-14 18:06 ` [PATCH net-next v2 4/5] eth: e1000e: " Jakub Kicinski
@ 2025-06-14 18:06 ` Jakub Kicinski
  2025-06-15  7:41   ` Joe Damato
  2025-06-16  1:32   ` Wei Fang
  2025-06-17  1:40 ` [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers) patchwork-bot+netdevbpf
  5 siblings, 2 replies; 10+ messages in thread
From: Jakub Kicinski @ 2025-06-14 18:06 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>
---
v2:
 - add get_rxfh_fields to enetc4_pf_ethtool_ops
v1: https://lore.kernel.org/20250613005409.3544529-6-kuba@kernel.org
---
 drivers/net/ethernet/freescale/enetc/enetc_ethtool.c | 11 +++++------
 1 file changed, 5 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..2e5cef646741 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,
@@ -1284,6 +1282,7 @@ const struct ethtool_ops enetc4_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,
 };
 
 void enetc_set_ethtool_ops(struct net_device *ndev)
-- 
2.49.0


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

* Re: [PATCH net-next v2 5/5] eth: enetc: migrate to new RXFH callbacks
  2025-06-14 18:06 ` [PATCH net-next v2 5/5] eth: enetc: " Jakub Kicinski
@ 2025-06-15  7:41   ` Joe Damato
  2025-06-16  1:32   ` Wei Fang
  1 sibling, 0 replies; 10+ messages in thread
From: Joe Damato @ 2025-06-15  7:41 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 Sat, Jun 14, 2025 at 11:06:38AM -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>
> ---
> v2:
>  - add get_rxfh_fields to enetc4_pf_ethtool_ops
> v1: https://lore.kernel.org/20250613005409.3544529-6-kuba@kernel.org
> ---
>  drivers/net/ethernet/freescale/enetc/enetc_ethtool.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 

Reviewed-by: Joe Damato <joe@dama.to>

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

* RE: [PATCH net-next v2 5/5] eth: enetc: migrate to new RXFH callbacks
  2025-06-14 18:06 ` [PATCH net-next v2 5/5] eth: enetc: " Jakub Kicinski
  2025-06-15  7:41   ` Joe Damato
@ 2025-06-16  1:32   ` Wei Fang
  1 sibling, 0 replies; 10+ messages in thread
From: Wei Fang @ 2025-06-16  1:32 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

> 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>
> ---
> v2:
>  - add get_rxfh_fields to enetc4_pf_ethtool_ops

Reviewed-by: Wei Fang <wei.fang@nxp.com>

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

* Re: [PATCH net-next v2 4/5] eth: e1000e: migrate to new RXFH callbacks
  2025-06-14 18:06 ` [PATCH net-next v2 4/5] eth: e1000e: " Jakub Kicinski
@ 2025-06-16 18:07   ` Tony Nguyen
  0 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2025-06-16 18:07 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, przemyslaw.kitszel, bryan.whitehead, ecree.xilinx,
	rosenp, imx, Joe Damato



On 6/14/2025 11:06 AM, 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.
> 
> Reviewed-by: Joe Damato <joe@dama.to>

Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>

> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

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

* Re: [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers)
  2025-06-14 18:06 [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers) Jakub Kicinski
                   ` (4 preceding siblings ...)
  2025-06-14 18:06 ` [PATCH net-next v2 5/5] eth: enetc: " Jakub Kicinski
@ 2025-06-17  1:40 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-17  1:40 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

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 14 Jun 2025 11:06:33 -0700 you wrote:
> Migrate the drivers which only implement ETHTOOL_GRXFH to
> the recently added dedicated .get_rxfh_fields ethtool callback.
> 
> v2:
>  - fix enetc
>  - move the sfc falcon patch to later series in case I need to refactor
> v1: https://lore.kernel.org/20250613005409.3544529-1-kuba@kernel.org
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/5] eth: cisco: migrate to new RXFH callbacks
    https://git.kernel.org/netdev/net-next/c/b4512e36ec9e
  - [net-next,v2,2/5] eth: cxgb4: migrate to new RXFH callbacks
    https://git.kernel.org/netdev/net-next/c/8d90593fd539
  - [net-next,v2,3/5] eth: lan743x: migrate to new RXFH callbacks
    https://git.kernel.org/netdev/net-next/c/a689e2300e17
  - [net-next,v2,4/5] eth: e1000e: migrate to new RXFH callbacks
    https://git.kernel.org/netdev/net-next/c/b8379a59b282
  - [net-next,v2,5/5] eth: enetc: migrate to new RXFH callbacks
    https://git.kernel.org/netdev/net-next/c/9a9f7ce8cb77

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-06-17  1:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-14 18:06 [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers) Jakub Kicinski
2025-06-14 18:06 ` [PATCH net-next v2 1/5] eth: cisco: migrate to new RXFH callbacks Jakub Kicinski
2025-06-14 18:06 ` [PATCH net-next v2 2/5] eth: cxgb4: " Jakub Kicinski
2025-06-14 18:06 ` [PATCH net-next v2 3/5] eth: lan743x: " Jakub Kicinski
2025-06-14 18:06 ` [PATCH net-next v2 4/5] eth: e1000e: " Jakub Kicinski
2025-06-16 18:07   ` Tony Nguyen
2025-06-14 18:06 ` [PATCH net-next v2 5/5] eth: enetc: " Jakub Kicinski
2025-06-15  7:41   ` Joe Damato
2025-06-16  1:32   ` Wei Fang
2025-06-17  1:40 ` [PATCH net-next v2 0/5] eth: migrate to new RXFH callbacks (get-only drivers) patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).