eth: migrate more drivers to new RXFH callbacks
Subsystems (6)
Jakub Kicinski
maintainercover eth: migrate more drivers to new RXFH callbacks
Migrate a batch of drivers to the recently added dedicated .get_rxfh_fields and .set_rxfh_fields ethtool callbacks.
Jakub Kicinski (5):
eth: niu: migrate to new RXFH callbacks
eth: mvpp2: migrate to new RXFH callbacks
eth: dpaa: migrate to new RXFH callbacks
eth: dpaa2: migrate to new RXFH callbacks
eth: sxgbe: migrate to new RXFH callbacks
.../net/ethernet/marvell/mvpp2/mvpp2_cls.h | 6 ++- .../ethernet/freescale/dpaa/dpaa_ethtool.c | 44 +++--------------- .../ethernet/freescale/dpaa2/dpaa2-ethtool.c | 36 ++++++++++----- .../net/ethernet/marvell/mvpp2/mvpp2_cls.c | 6 ++- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 31 ++++++++++--- .../ethernet/samsung/sxgbe/sxgbe_ethtool.c | 45 +++---------------- drivers/net/ethernet/sun/niu.c | 17 +++---- 7 files changed, 80 insertions(+), 105 deletions(-)
Signature · 1 line
2.49.0
Jakub Kicinski
maintainerPATCH 1/5 eth: niu: migrate to new RXFH callbacks
Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
--- drivers/net/ethernet/sun/niu.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/net/ethernet/sun/niu.c +9 -8
@@ -7077,8 +7077,10 @@ static int niu_ethflow_to_flowkey(u64 ethflow, u64 *flow_key) } -static int niu_get_hash_opts (struct niu *np,struct ethtool_rxnfc *nfc) +static int niu_get_rxfh_fields (struct net_device *dev, +struct ethtool_rxfh_fields *nfc) { +struct niu *np =netdev_priv (dev);u64 class; nfc->data =0 ;
@@ -7290,9 +7292,6 @@ static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,int ret =0 ;switch (cmd->cmd) { -case ETHTOOL_GRXFH : - ret =niu_get_hash_opts (np, cmd); -break ;case ETHTOOL_GRXRINGS : cmd->data = np->num_rx_rings;break ;
@@ -7313,8 +7312,11 @@ static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,return ret; } -static int niu_set_hash_opts (struct niu *np,struct ethtool_rxnfc *nfc) +static int niu_set_rxfh_fields (struct net_device *dev, +const struct ethtool_rxfh_fields *nfc, +struct netlink_ext_ack *extack) { +struct niu *np =netdev_priv (dev);u64 class;u64 flow_key =0 ;unsigned long flags;
@@ -7656,9 +7658,6 @@ static int niu_set_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd)int ret =0 ;switch (cmd->cmd) { -case ETHTOOL_SRXFH : - ret =niu_set_hash_opts (np, cmd); -break ;case ETHTOOL_SRXCLSRLINS : ret =niu_add_ethtool_tcam_entry (np, cmd);break ;
@@ -7912,6 +7911,8 @@ static const struct ethtool_ops niu_ethtool_ops = { .set_phys_id = niu_set_phys_id, .get_rxnfc = niu_get_nfc, .set_rxnfc = niu_set_nfc, + .get_rxfh_fields = niu_get_rxfh_fields, + .set_rxfh_fields = niu_set_rxfh_fields, .get_link_ksettings = niu_get_link_ksettings, .set_link_ksettings = niu_set_link_ksettings, };
Signature · 1 line
2.49.0
Re: [PATCH net-next 1/5] eth: niu: migrate to new RXFH callbacks
Quoted 7 lines · Jakub Kicinski
Migrate to new callbacks added by commit
9bb00786fc61("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").Signed-off-by Jakub Kicinski <[email protected]>--- drivers/net/ethernet/sun/niu.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
Jakub Kicinski
maintainerPATCH 2/5 eth: mvpp2: migrate to new RXFH callbacks
In reply to Jakub KicinskiMigrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
--- .../net/ethernet/marvell/mvpp2/mvpp2_cls.h | 6 ++-- .../net/ethernet/marvell/mvpp2/mvpp2_cls.c | 6 ++-- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 31 +++++++++++++++---- 3 files changed, 33 insertions(+), 10 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h +4 -2
@@ -272,8 +272,10 @@ int mvpp22_port_rss_ctx_indir_set(struct mvpp2_port *port, u32 rss_ctx,int mvpp22_port_rss_ctx_indir_get (struct mvpp2_port *port,u32 rss_ctx,u32 *indir); -int mvpp2_ethtool_rxfh_get (struct mvpp2_port *port,struct ethtool_rxnfc *info); -int mvpp2_ethtool_rxfh_set (struct mvpp2_port *port,struct ethtool_rxnfc *info); +int mvpp2_ethtool_rxfh_get (struct mvpp2_port *port, +struct ethtool_rxfh_fields *info); +int mvpp2_ethtool_rxfh_set (struct mvpp2_port *port, +const struct ethtool_rxfh_fields *info);void mvpp2_cls_init (struct mvpp2 *priv);
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +4 -2
@@ -1618,7 +1618,8 @@ int mvpp22_port_rss_ctx_indir_get(struct mvpp2_port *port, u32 port_ctx,return 0 ; } -int mvpp2_ethtool_rxfh_set (struct mvpp2_port *port,struct ethtool_rxnfc *info) +int mvpp2_ethtool_rxfh_set (struct mvpp2_port *port, +const struct ethtool_rxfh_fields *info) {u16 hash_opts =0 ;u32 flow_type;
@@ -1656,7 +1657,8 @@ int mvpp2_ethtool_rxfh_set(struct mvpp2_port *port, struct ethtool_rxnfc *info)return mvpp2_port_rss_hash_opts_set (port, flow_type, hash_opts); } -int mvpp2_ethtool_rxfh_get (struct mvpp2_port *port,struct ethtool_rxnfc *info) +int mvpp2_ethtool_rxfh_get (struct mvpp2_port *port, +struct ethtool_rxfh_fields *info) {unsigned long hash_opts;u32 flow_type;
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +25 -6
@@ -5588,9 +5588,6 @@ static int mvpp2_ethtool_get_rxnfc(struct net_device *dev,return -EOPNOTSUPP ;switch (info->cmd) { -case ETHTOOL_GRXFH : - ret =mvpp2_ethtool_rxfh_get (port, info); -break ;case ETHTOOL_GRXRINGS : info->data = port->nrxqs;break ;
@@ -5628,9 +5625,6 @@ static int mvpp2_ethtool_set_rxnfc(struct net_device *dev,return -EOPNOTSUPP ;switch (info->cmd) { -case ETHTOOL_SRXFH : - ret =mvpp2_ethtool_rxfh_set (port, info); -break ;case ETHTOOL_SRXCLSRLINS : ret =mvpp2_ethtool_cls_rule_ins (port, info);break ;
@@ -5747,6 +5741,29 @@ static int mvpp2_ethtool_set_rxfh(struct net_device *dev,return mvpp2_modify_rxfh_context (dev,NULL , rxfh, extack); } +static int mvpp2_ethtool_get_rxfh_fields (struct net_device *dev, +struct ethtool_rxfh_fields *info) +{ +struct mvpp2_port *port =netdev_priv (dev); + +if (!mvpp22_rss_is_supported (port)) +return -EOPNOTSUPP ; + +return mvpp2_ethtool_rxfh_get (port, info); +} + +static int mvpp2_ethtool_set_rxfh_fields (struct net_device *dev, +const struct ethtool_rxfh_fields *info, +struct netlink_ext_ack *extack) +{ +struct mvpp2_port *port =netdev_priv (dev); + +if (!mvpp22_rss_is_supported (port)) +return -EOPNOTSUPP ; + +return mvpp2_ethtool_rxfh_set (port, info); +} +static int mvpp2_ethtool_get_eee (struct net_device *dev,struct ethtool_keee *eee) {
@@ -5813,6 +5830,8 @@ static const struct ethtool_ops mvpp2_eth_tool_ops = { .get_rxfh_indir_size = mvpp2_ethtool_get_rxfh_indir_size, .get_rxfh = mvpp2_ethtool_get_rxfh, .set_rxfh = mvpp2_ethtool_set_rxfh, + .get_rxfh_fields = mvpp2_ethtool_get_rxfh_fields, + .set_rxfh_fields = mvpp2_ethtool_set_rxfh_fields, .create_rxfh_context = mvpp2_create_rxfh_context, .modify_rxfh_context = mvpp2_modify_rxfh_context, .remove_rxfh_context = mvpp2_remove_rxfh_context,
Signature · 1 line
2.49.0
Re: [PATCH net-next 2/5] eth: mvpp2: migrate to new RXFH callbacks
Quoted 9 lines · Jakub Kicinski
Migrate to new callbacks added by commit
9bb00786fc61("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").Signed-off-by Jakub Kicinski <[email protected]>--- .../net/ethernet/marvell/mvpp2/mvpp2_cls.h | 6 ++-- .../net/ethernet/marvell/mvpp2/mvpp2_cls.c | 6 ++-- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 31 +++++++++++++++---- 3 files changed, 33 insertions(+), 10 deletions(-)
Jakub Kicinski
maintainerPATCH 3/5 eth: dpaa: migrate to new RXFH callbacks
In reply to Jakub KicinskiMigrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
RXFH is all this driver supports in RXNFC so old callbacks are completely removed.
--- .../ethernet/freescale/dpaa/dpaa_ethtool.c | 44 +++---------------- 1 file changed, 7 insertions(+), 37 deletions(-)
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c +7 -37
@@ -263,8 +263,8 @@ static void dpaa_get_strings(struct net_device *net_dev, u32 stringset,ethtool_puts (&data, dpaa_stats_global[i]); } -static int dpaa_get_hash_opts (struct net_device *dev, -struct ethtool_rxnfc *cmd) +static int dpaa_get_rxfh_fields (struct net_device *dev, +struct ethtool_rxfh_fields *cmd) {struct dpaa_priv *priv =netdev_priv (dev);
@@ -299,22 +299,6 @@ static int dpaa_get_hash_opts(struct net_device *dev,return 0 ; } -static int dpaa_get_rxnfc (struct net_device *dev,struct ethtool_rxnfc *cmd, -u32 *unused) -{ -int ret = -EOPNOTSUPP ; - -switch (cmd->cmd) { -case ETHTOOL_GRXFH : - ret =dpaa_get_hash_opts (dev, cmd); -break ; -default : -break ; - } - -return ret; -} -static void dpaa_set_hash (struct net_device *net_dev,bool enable) {struct mac_device *mac_dev;
@@ -329,8 +313,9 @@ static void dpaa_set_hash(struct net_device *net_dev, bool enable) priv->keygen_in_use = enable; } -static int dpaa_set_hash_opts (struct net_device *dev, -struct ethtool_rxnfc *nfc) +static int dpaa_set_rxfh_fields (struct net_device *dev, +const struct ethtool_rxfh_fields *nfc, +struct netlink_ext_ack *extack) {int ret = -EINVAL ;
@@ -364,21 +349,6 @@ static int dpaa_set_hash_opts(struct net_device *dev,return ret; } -static int dpaa_set_rxnfc (struct net_device *dev,struct ethtool_rxnfc *cmd) -{ -int ret = -EOPNOTSUPP ; - -switch (cmd->cmd) { -case ETHTOOL_SRXFH : - ret =dpaa_set_hash_opts (dev, cmd); -break ; -default : -break ; - } - -return ret; -} -static int dpaa_get_ts_info (struct net_device *net_dev,struct kernel_ethtool_ts_info *info) {
@@ -510,8 +480,8 @@ const struct ethtool_ops dpaa_ethtool_ops = { .get_strings = dpaa_get_strings, .get_link_ksettings = dpaa_get_link_ksettings, .set_link_ksettings = dpaa_set_link_ksettings, - .get_rxnfc = dpaa_get_rxnfc, - .set_rxnfc = dpaa_set_rxnfc, + .get_rxfh_fields = dpaa_get_rxfh_fields, + .set_rxfh_fields = dpaa_set_rxfh_fields, .get_ts_info = dpaa_get_ts_info, .get_coalesce = dpaa_get_coalesce, .set_coalesce = dpaa_set_coalesce,
Signature · 1 line
2.49.0
Re: [PATCH net-next 3/5] eth: dpaa: migrate to new RXFH callbacks
Quoted 10 lines · Jakub Kicinski
Migrate to new callbacks added by commit
9bb00786fc61("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").RXFH is all this driver supports in RXNFC so old callbacks are completely removed.
Signed-off-by Jakub Kicinski <[email protected]>--- .../ethernet/freescale/dpaa/dpaa_ethtool.c | 44 +++---------------- 1 file changed, 7 insertions(+), 37 deletions(-)
Jakub Kicinski
maintainerPATCH 4/5 eth: dpaa2: migrate to new RXFH callbacks
In reply to Jakub KicinskiMigrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
--- .../ethernet/freescale/dpaa2/dpaa2-ethtool.c | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c +24 -12
@@ -719,13 +719,6 @@ static int dpaa2_eth_get_rxnfc(struct net_device *net_dev,int i, j =0 ;switch (rxnfc->cmd) { -case ETHTOOL_GRXFH : -/* we purposely ignore cmd->flow_type for now, because the -* classifier only supports a single set of fields for all -* protocols -*/ - rxnfc->data = priv->rx_hash_fields; -break ;case ETHTOOL_GRXRINGS : rxnfc->data =dpaa2_eth_queue_count (priv);break ;
@@ -767,11 +760,6 @@ static int dpaa2_eth_set_rxnfc(struct net_device *net_dev,int err =0 ;switch (rxnfc->cmd) { -case ETHTOOL_SRXFH : -if ((rxnfc->data &DPAA2_RXH_SUPPORTED ) != rxnfc->data) -return -EOPNOTSUPP ; - err =dpaa2_eth_set_hash (net_dev, rxnfc->data); -break ;case ETHTOOL_SRXCLSRLINS : err =dpaa2_eth_update_cls_rule (net_dev, &rxnfc->fs, rxnfc->fs.location);break ;
@@ -785,6 +773,28 @@ static int dpaa2_eth_set_rxnfc(struct net_device *net_dev,return err; } +static int dpaa2_eth_get_rxfh_fields (struct net_device *net_dev, +struct ethtool_rxfh_fields *rxnfc) +{ +struct dpaa2_eth_priv *priv =netdev_priv (net_dev); + +/* we purposely ignore cmd->flow_type for now, because the +* classifier only supports a single set of fields for all +* protocols +*/ + rxnfc->data = priv->rx_hash_fields; +return 0 ; +} + +static int dpaa2_eth_set_rxfh_fields (struct net_device *net_dev, +const struct ethtool_rxfh_fields *rxnfc, +struct netlink_ext_ack *extack) +{ +if ((rxnfc->data &DPAA2_RXH_SUPPORTED ) != rxnfc->data) +return -EOPNOTSUPP ; +return dpaa2_eth_set_hash (net_dev, rxnfc->data); +} +int dpaa2_phc_index =-1 ;EXPORT_SYMBOL (dpaa2_phc_index);
@@ -939,6 +949,8 @@ const struct ethtool_ops dpaa2_ethtool_ops = { .get_strings = dpaa2_eth_get_strings, .get_rxnfc = dpaa2_eth_get_rxnfc, .set_rxnfc = dpaa2_eth_set_rxnfc, + .get_rxfh_fields = dpaa2_eth_get_rxfh_fields, + .set_rxfh_fields = dpaa2_eth_set_rxfh_fields, .get_ts_info = dpaa2_eth_get_ts_info, .get_tunable = dpaa2_eth_get_tunable, .set_tunable = dpaa2_eth_set_tunable,
Signature · 1 line
2.49.0
Re: [PATCH net-next 4/5] eth: dpaa2: migrate to new RXFH callbacks
Quoted 8 lines · Jakub Kicinski
Migrate to new callbacks added by commit
9bb00786fc61("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").Signed-off-by Jakub Kicinski <[email protected]>--- .../ethernet/freescale/dpaa2/dpaa2-ethtool.c | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-)
Jakub Kicinski
maintainerPATCH 5/5 eth: sxgbe: migrate to new RXFH callbacks
In reply to Jakub KicinskiMigrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
RXFH is all this driver supports in RXNFC so old callbacks are completely removed.
--- .../ethernet/samsung/sxgbe/sxgbe_ethtool.c | 45 +++---------------- 1 file changed, 7 insertions(+), 38 deletions(-)
drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c +7 -38
@@ -308,8 +308,8 @@ static int sxgbe_set_coalesce(struct net_device *dev,return 0 ; } -static int sxgbe_get_rss_hash_opts (struct sxgbe_priv_data *priv, -struct ethtool_rxnfc *cmd) +static int sxgbe_get_rxfh_fields (struct net_device *dev, +struct ethtool_rxfh_fields *cmd) { cmd->data =0 ;
@@ -344,26 +344,11 @@ static int sxgbe_get_rss_hash_opts(struct sxgbe_priv_data *priv,return 0 ; } -static int sxgbe_get_rxnfc (struct net_device *dev,struct ethtool_rxnfc *cmd, -u32 *rule_locs) +static int sxgbe_set_rxfh_fields (struct net_device *dev, +const struct ethtool_rxfh_fields *cmd, +struct netlink_ext_ack *extack) {struct sxgbe_priv_data *priv =netdev_priv (dev); -int ret = -EOPNOTSUPP ; - -switch (cmd->cmd) { -case ETHTOOL_GRXFH : - ret =sxgbe_get_rss_hash_opts (priv, cmd); -break ; -default : -break ; - } - -return ret; -} - -static int sxgbe_set_rss_hash_opt (struct sxgbe_priv_data *priv, -struct ethtool_rxnfc *cmd) -{u32 reg_val =0 ;/* RSS does not support anything other than hashing
@@ -421,22 +406,6 @@ static int sxgbe_set_rss_hash_opt(struct sxgbe_priv_data *priv,return 0 ; } -static int sxgbe_set_rxnfc (struct net_device *dev,struct ethtool_rxnfc *cmd) -{ -struct sxgbe_priv_data *priv =netdev_priv (dev); -int ret = -EOPNOTSUPP ; - -switch (cmd->cmd) { -case ETHTOOL_SRXFH : - ret =sxgbe_set_rss_hash_opt (priv, cmd); -break ; -default : -break ; - } - -return ret; -} -static void sxgbe_get_regs (struct net_device *dev,struct ethtool_regs *regs,void *space) {
@@ -489,8 +458,8 @@ static const struct ethtool_ops sxgbe_ethtool_ops = { .get_channels = sxgbe_get_channels, .get_coalesce = sxgbe_get_coalesce, .set_coalesce = sxgbe_set_coalesce, - .get_rxnfc = sxgbe_get_rxnfc, - .set_rxnfc = sxgbe_set_rxnfc, + .get_rxfh_fields = sxgbe_get_rxfh_fields, + .set_rxfh_fields = sxgbe_set_rxfh_fields, .get_regs = sxgbe_get_regs, .get_regs_len = sxgbe_get_regs_len, .get_eee = sxgbe_get_eee,
Signature · 1 line
2.49.0
Re: [PATCH net-next 5/5] eth: sxgbe: migrate to new RXFH callbacks
Quoted 11 lines · Jakub Kicinski
Migrate to new callbacks added by commit
9bb00786fc61("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").RXFH is all this driver supports in RXNFC so old callbacks are completely removed.
Signed-off-by Jakub Kicinski <[email protected]>--- .../ethernet/samsung/sxgbe/sxgbe_ethtool.c | 45 +++---------------- 1 file changed, 7 insertions(+), 38 deletions(-)
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Mon, 16 Jun 2025 18:48:43 -0700 you wrote:
Migrate a batch of drivers to the recently added dedicated .get_rxfh_fields and .set_rxfh_fields ethtool callbacks.
Jakub Kicinski (5):
eth: niu: migrate to new RXFH callbacks
eth: mvpp2: migrate to new RXFH callbacks
eth: dpaa: migrate to new RXFH callbacks
eth: dpaa2: migrate to new RXFH callbacks
eth: sxgbe: migrate to new RXFH callbacks[...]
Here is the summary with links:
- [net-next,1/5] eth: niu: migrate to new RXFH callbacks
https://git.kernel.org/netdev/net-next/c/b82d92dd71cb - [net-next,2/5] eth: mvpp2: migrate to new RXFH callbacks https://git.kernel.org/netdev/net-next/c/b6f7e4fafe77 - [net-next,3/5] eth: dpaa: migrate to new RXFH callbacks https://git.kernel.org/netdev/net-next/c/17da66f140c2 - [net-next,4/5] eth: dpaa2: migrate to new RXFH callbacks https://git.kernel.org/netdev/net-next/c/20ffe3bbc2ce - [net-next,5/5] eth: sxgbe: migrate to new RXFH callbacks https://git.kernel.org/netdev/net-next/c/c2cd2f6125bd
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html