eth: intel: migrate to new RXFH callbacks
Subsystems (3)
Jakub Kicinski
maintainerv2 cover eth: intel: migrate to new RXFH callbacks
Migrate Intel drivers to the recently added dedicated .get_rxfh_fields and .set_rxfh_fields ethtool callbacks.
Note that I'm deleting all the boilerplate kdoc from the affected functions in the more recent drivers. If the maintainers feel strongly I can respin and add it back, but it really feels useless and undue burden for refactoring. No other vendor does this.
v2:
- fix missing change to ops struct in ixgbe
v1: https://lore.kernel.org/[email protected]
Jakub Kicinski (7):
eth: igb: migrate to new RXFH callbacks
eth: igc: migrate to new RXFH callbacks
eth: ixgbe: migrate to new RXFH callbacks
eth: fm10k: migrate to new RXFH callbacks
eth: i40e: migrate to new RXFH callbacks
eth: ice: migrate to new RXFH callbacks
eth: iavf: migrate to new RXFH callbacks
.../net/ethernet/intel/fm10k/fm10k_ethtool.c | 34 ++++------- .../net/ethernet/intel/i40e/i40e_ethtool.c | 38 +++++------- .../net/ethernet/intel/iavf/iavf_ethtool.c | 52 ++++------------ drivers/net/ethernet/intel/ice/ice_ethtool.c | 59 ++++++------------- drivers/net/ethernet/intel/igb/igb_ethtool.c | 20 +++---- drivers/net/ethernet/intel/igc/igc_ethtool.c | 18 +++--- .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 22 +++---- 7 files changed, 85 insertions(+), 158 deletions(-)
Signature · 1 line
2.49.0
Jakub Kicinski
maintainerPATCH v2 1/7 eth: igb: 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/intel/igb/igb_ethtool.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +10 -10
@@ -2500,9 +2500,11 @@ static int igb_get_ethtool_nfc_all(struct igb_adapter *adapter,return 0 ; } -static int igb_get_rss_hash_opts (struct igb_adapter *adapter, -struct ethtool_rxnfc *cmd) +static int igb_get_rxfh_fields (struct net_device *dev, +struct ethtool_rxfh_fields *cmd) { +struct igb_adapter *adapter =netdev_priv (dev); + cmd->data =0 ;/* Report default options for RSS on igb */
@@ -2563,9 +2565,6 @@ static int igb_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,case ETHTOOL_GRXCLSRLALL : ret =igb_get_ethtool_nfc_all (adapter, cmd, rule_locs);break ; -case ETHTOOL_GRXFH : - ret =igb_get_rss_hash_opts (adapter, cmd); -break ;default :break ; }
@@ -2575,9 +2574,11 @@ static int igb_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,#define UDP_RSS_FLAGS (IGB_FLAG_RSS_FIELD_IPV4_UDP | \ IGB_FLAG_RSS_FIELD_IPV6_UDP) -static int igb_set_rss_hash_opt (struct igb_adapter *adapter, -struct ethtool_rxnfc *nfc) +static int igb_set_rxfh_fields (struct net_device *dev, +const struct ethtool_rxfh_fields *nfc, +struct netlink_ext_ack *extack) { +struct igb_adapter *adapter =netdev_priv (dev);u32 flags = adapter->flags;/* RSS does not support anything other than hashing
@@ -3005,9 +3006,6 @@ static int igb_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)int ret = -EOPNOTSUPP ;switch (cmd->cmd) { -case ETHTOOL_SRXFH : - ret =igb_set_rss_hash_opt (adapter, cmd); -break ;case ETHTOOL_SRXCLSRLINS : ret =igb_add_ethtool_nfc_entry (adapter, cmd);break ;
@@ -3485,6 +3483,8 @@ static const struct ethtool_ops igb_ethtool_ops = { .get_rxfh_indir_size = igb_get_rxfh_indir_size, .get_rxfh = igb_get_rxfh, .set_rxfh = igb_set_rxfh, + .get_rxfh_fields = igb_get_rxfh_fields, + .set_rxfh_fields = igb_set_rxfh_fields, .get_channels = igb_get_channels, .set_channels = igb_set_channels, .get_priv_flags = igb_get_priv_flags,
Signature · 1 line
2.49.0
Jakub Kicinski
maintainerPATCH v2 2/7 eth: igc: 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").
--- drivers/net/ethernet/intel/igc/igc_ethtool.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/igc/igc_ethtool.c +10 -8
@@ -1045,9 +1045,11 @@ static int igc_ethtool_get_nfc_rules(struct igc_adapter *adapter,return 0 ; } -static int igc_ethtool_get_rss_hash_opts (struct igc_adapter *adapter, -struct ethtool_rxnfc *cmd) +static int igc_ethtool_get_rxfh_fields (struct net_device *dev, +struct ethtool_rxfh_fields *cmd) { +struct igc_adapter *adapter =netdev_priv (dev); + cmd->data =0 ;/* Report default options for RSS on igc */
@@ -1103,8 +1105,6 @@ static int igc_ethtool_get_rxnfc(struct net_device *dev,return igc_ethtool_get_nfc_rule (adapter, cmd);case ETHTOOL_GRXCLSRLALL :return igc_ethtool_get_nfc_rules (adapter, cmd, rule_locs); -case ETHTOOL_GRXFH : -return igc_ethtool_get_rss_hash_opts (adapter, cmd);default :return -EOPNOTSUPP ; }
@@ -1112,9 +1112,11 @@ static int igc_ethtool_get_rxnfc(struct net_device *dev,#define UDP_RSS_FLAGS (IGC_FLAG_RSS_FIELD_IPV4_UDP | \ IGC_FLAG_RSS_FIELD_IPV6_UDP) -static int igc_ethtool_set_rss_hash_opt (struct igc_adapter *adapter, -struct ethtool_rxnfc *nfc) +static int igc_ethtool_set_rxfh_fields (struct net_device *dev, +const struct ethtool_rxfh_fields *nfc, +struct netlink_ext_ack *extack) { +struct igc_adapter *adapter =netdev_priv (dev);u32 flags = adapter->flags;/* RSS does not support anything other than hashing
@@ -1425,8 +1427,6 @@ static int igc_ethtool_set_rxnfc(struct net_device *dev,struct igc_adapter *adapter =netdev_priv (dev);switch (cmd->cmd) { -case ETHTOOL_SRXFH : -return igc_ethtool_set_rss_hash_opt (adapter, cmd);case ETHTOOL_SRXCLSRLINS :return igc_ethtool_add_nfc_rule (adapter, cmd);case ETHTOOL_SRXCLSRLDEL :
@@ -2144,6 +2144,8 @@ static const struct ethtool_ops igc_ethtool_ops = { .get_rxfh_indir_size = igc_ethtool_get_rxfh_indir_size, .get_rxfh = igc_ethtool_get_rxfh, .set_rxfh = igc_ethtool_set_rxfh, + .get_rxfh_fields = igc_ethtool_get_rxfh_fields, + .set_rxfh_fields = igc_ethtool_set_rxfh_fields, .get_ts_info = igc_ethtool_get_ts_info, .get_channels = igc_ethtool_get_channels, .set_channels = igc_ethtool_set_channels,
Signature · 1 line
2.49.0
Re: [PATCH net-next v2 2/7] eth: igc: 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").Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>--- drivers/net/ethernet/intel/igc/igc_ethtool.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
Jakub Kicinski
maintainerPATCH v2 3/7 eth: ixgbe: 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").
---
v2:
- add callbacks to ixgbe_ethtool_ops
v1: https://lore.kernel.org/[email protected]
--- .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +12 -10
@@ -2753,9 +2753,11 @@ static int ixgbe_get_ethtool_fdir_all(struct ixgbe_adapter *adapter,return 0 ; } -static int ixgbe_get_rss_hash_opts (struct ixgbe_adapter *adapter, -struct ethtool_rxnfc *cmd) +static int ixgbe_get_rxfh_fields (struct net_device *dev, +struct ethtool_rxfh_fields *cmd) { +struct ixgbe_adapter *adapter =ixgbe_from_netdev (dev); + cmd->data =0 ;/* Report default options for RSS on ixgbe */
@@ -2825,9 +2827,6 @@ static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,case ETHTOOL_GRXCLSRLALL : ret =ixgbe_get_ethtool_fdir_all (adapter, cmd, rule_locs);break ; -case ETHTOOL_GRXFH : - ret =ixgbe_get_rss_hash_opts (adapter, cmd); -break ;default :break ; }
@@ -3079,9 +3078,11 @@ static int ixgbe_del_ethtool_fdir_entry(struct ixgbe_adapter *adapter,#define UDP_RSS_FLAGS (IXGBE_FLAG2_RSS_FIELD_IPV4_UDP | \ IXGBE_FLAG2_RSS_FIELD_IPV6_UDP) -static int ixgbe_set_rss_hash_opt (struct ixgbe_adapter *adapter, -struct ethtool_rxnfc *nfc) +static int ixgbe_set_rxfh_fields (struct net_device *dev, +const struct ethtool_rxfh_fields *nfc, +struct netlink_ext_ack *extack) { +struct ixgbe_adapter *adapter =ixgbe_from_netdev (dev);u32 flags2 = adapter->flags2;/*
@@ -3204,9 +3205,6 @@ static int ixgbe_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)case ETHTOOL_SRXCLSRLDEL : ret =ixgbe_del_ethtool_fdir_entry (adapter, cmd);break ; -case ETHTOOL_SRXFH : - ret =ixgbe_set_rss_hash_opt (adapter, cmd); -break ;default :break ; }
@@ -3751,6 +3749,8 @@ static const struct ethtool_ops ixgbe_ethtool_ops = { .get_rxfh_key_size = ixgbe_get_rxfh_key_size, .get_rxfh = ixgbe_get_rxfh, .set_rxfh = ixgbe_set_rxfh, + .get_rxfh_fields = ixgbe_get_rxfh_fields, + .set_rxfh_fields = ixgbe_set_rxfh_fields, .get_eee = ixgbe_get_eee, .set_eee = ixgbe_set_eee, .get_channels = ixgbe_get_channels,
@@ -3797,6 +3797,8 @@ static const struct ethtool_ops ixgbe_ethtool_ops_e610 = { .get_rxfh_key_size = ixgbe_get_rxfh_key_size, .get_rxfh = ixgbe_get_rxfh, .set_rxfh = ixgbe_set_rxfh, + .get_rxfh_fields = ixgbe_get_rxfh_fields, + .set_rxfh_fields = ixgbe_set_rxfh_fields, .get_eee = ixgbe_get_eee, .set_eee = ixgbe_set_eee, .get_channels = ixgbe_get_channels,
Signature · 1 line
2.49.0
Re: [PATCH net-next v2 3/7] eth: ixgbe: migrate to new RXFH callbacks
Quoted 5 lines · Jakub Kicinski
Migrate to new callbacks added by commit
9bb00786fc61("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>
Quoted 8 lines
---
v2:
- add callbacks toixgbe_ethtool_ops
v1: https://lore.kernel.org/[email protected]--- .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-)
Good catch on the other ethtool_ops struct.
Jakub Kicinski
maintainerPATCH v2 4/7 eth: fm10k: 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"). .get callback moves out of the switch and set_rxnfc disappears as ETHTOOL_SRXFH as the only functionality.
--- .../net/ethernet/intel/fm10k/fm10k_ethtool.c | 34 ++++++------------- 1 file changed, 10 insertions(+), 24 deletions(-)
drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c +10 -24
@@ -691,9 +691,11 @@ static int fm10k_set_coalesce(struct net_device *dev,return 0 ; } -static int fm10k_get_rss_hash_opts (struct fm10k_intfc *interface, -struct ethtool_rxnfc *cmd) +static int fm10k_get_rssh_fields (struct net_device *dev, +struct ethtool_rxfh_fields *cmd) { +struct fm10k_intfc *interface =netdev_priv (dev); + cmd->data =0 ;/* Report default options for RSS on fm10k */
@@ -743,9 +745,6 @@ static int fm10k_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, cmd->data = interface->num_rx_queues; ret =0 ;break ; -case ETHTOOL_GRXFH : - ret =fm10k_get_rss_hash_opts (interface, cmd); -break ;default :break ; }
@@ -753,9 +752,11 @@ static int fm10k_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,return ret; } -static int fm10k_set_rss_hash_opt (struct fm10k_intfc *interface, -struct ethtool_rxnfc *nfc) +static int fm10k_set_rssh_fields (struct net_device *dev, +const struct ethtool_rxfh_fields *nfc, +struct netlink_ext_ack *extack) { +struct fm10k_intfc *interface =netdev_priv (dev);int rss_ipv4_udp =test_bit (FM10K_FLAG_RSS_FIELD_IPV4_UDP , interface->flags); int rss_ipv6_udp = test_bit(FM10K_FLAG_RSS_FIELD_IPV6_UDP,
@@ -871,22 +872,6 @@ static int fm10k_set_rss_hash_opt(struct fm10k_intfc *interface,return 0 ; } -static int fm10k_set_rxnfc (struct net_device *dev,struct ethtool_rxnfc *cmd) -{ -struct fm10k_intfc *interface =netdev_priv (dev); -int ret = -EOPNOTSUPP ; - -switch (cmd->cmd) { -case ETHTOOL_SRXFH : - ret =fm10k_set_rss_hash_opt (interface, cmd); -break ; -default : -break ; - } - -return ret; -} -static int fm10k_mbx_test (struct fm10k_intfc *interface,u64 *data) {struct fm10k_hw *hw = &interface->hw;
@@ -1176,7 +1161,6 @@ static const struct ethtool_ops fm10k_ethtool_ops = { .get_coalesce = fm10k_get_coalesce, .set_coalesce = fm10k_set_coalesce, .get_rxnfc = fm10k_get_rxnfc, - .set_rxnfc = fm10k_set_rxnfc, .get_regs = fm10k_get_regs, .get_regs_len = fm10k_get_regs_len, .self_test = fm10k_self_test,
@@ -1186,6 +1170,8 @@ static const struct ethtool_ops fm10k_ethtool_ops = { .get_rxfh_key_size = fm10k_get_rssrk_size, .get_rxfh = fm10k_get_rssh, .set_rxfh = fm10k_set_rssh, + .get_rxfh_fields = fm10k_get_rssh_fields, + .set_rxfh_fields = fm10k_set_rssh_fields, .get_channels = fm10k_get_channels, .set_channels = fm10k_set_channels, .get_ts_info = ethtool_op_get_ts_info,
Signature · 1 line
2.49.0
Re: [PATCH net-next v2 4/7] eth: fm10k: 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"). .get callback moves out of the switch andset_rxnfcdisappears asETHTOOL_SRXFHas the only functionality.Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>--- .../net/ethernet/intel/fm10k/fm10k_ethtool.c | 34 ++++++------------- 1 file changed, 10 insertions(+), 24 deletions(-)
Jakub Kicinski
maintainerPATCH v2 5/7 eth: i40e: 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").
I'm deleting all the boilerplate kdoc from the affected functions. It is somewhere between pointless and incorrect, just a burden for people refactoring the code.
--- .../net/ethernet/intel/i40e/i40e_ethtool.c | 38 +++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +14 -24
@@ -3139,15 +3139,12 @@ static int i40e_set_per_queue_coalesce(struct net_device *netdev, u32 queue,return __i40e_set_coalesce (netdev, ec, queue); } -/** -* i40e_get_rss_hash_opts - Get RSS hash Input Set for each flow type -* @pf: pointer to the physical function struct -* @cmd: ethtool rxnfc command -* -* Returns Success if the flow is supported, else Invalid Input. -**/ -static int i40e_get_rss_hash_opts (struct i40e_pf *pf,struct ethtool_rxnfc *cmd) +static int i40e_get_rxfh_fields (struct net_device *netdev, +struct ethtool_rxfh_fields *cmd) { +struct i40e_netdev_priv *np =netdev_priv (netdev); +struct i40e_vsi *vsi = np->vsi; +struct i40e_pf *pf = vsi->back;struct i40e_hw *hw = &pf->hw;u8 flow_pctype =0 ;u64 i_set =0 ;
@@ -3545,9 +3542,6 @@ static int i40e_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd, cmd->data = vsi->rss_size; ret =0 ;break ; -case ETHTOOL_GRXFH : - ret =i40e_get_rss_hash_opts (pf, cmd); -break ;case ETHTOOL_GRXCLSRLCNT : cmd->rule_cnt = pf->fdir_pf_active_filters;/* report total rule count */
@@ -3576,7 +3570,7 @@ static int i40e_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,* Returns value of bits to be set per user request **/ static u64 i40e_get_rss_hash_bits (struct i40e_hw *hw, -struct ethtool_rxnfc *nfc, +const struct ethtool_rxfh_fields *nfc,u64 i_setc) {u64 i_set = i_setc;
@@ -3621,15 +3615,13 @@ static u64 i40e_get_rss_hash_bits(struct i40e_hw *hw, }#define FLOW_PCTYPES_SIZE 64 -/** -* i40e_set_rss_hash_opt - Enable/Disable flow types for RSS hash -* @pf: pointer to the physical function struct -* @nfc: ethtool rxnfc command -* -* Returns Success if the flow input set is supported. -**/ -static int i40e_set_rss_hash_opt (struct i40e_pf *pf,struct ethtool_rxnfc *nfc) +static int i40e_set_rxfh_fields (struct net_device *netdev, +const struct ethtool_rxfh_fields *nfc, +struct netlink_ext_ack *extack) { +struct i40e_netdev_priv *np =netdev_priv (netdev); +struct i40e_vsi *vsi = np->vsi; +struct i40e_pf *pf = vsi->back;struct i40e_hw *hw = &pf->hw;u64 hena = (u64 )i40e_read_rx_ctl (hw,I40E_PFQF_HENA (0 )) | ((u64 )i40e_read_rx_ctl (hw,I40E_PFQF_HENA (1 )) <<32 );
@@ -4964,13 +4956,9 @@ static int i40e_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd) {struct i40e_netdev_priv *np =netdev_priv (netdev);struct i40e_vsi *vsi = np->vsi; -struct i40e_pf *pf = vsi->back;int ret = -EOPNOTSUPP ;switch (cmd->cmd) { -case ETHTOOL_SRXFH : - ret =i40e_set_rss_hash_opt (pf, cmd); -break ;case ETHTOOL_SRXCLSRLINS : ret =i40e_add_fdir_ethtool (vsi, cmd);break ;
@@ -5846,6 +5834,8 @@ static const struct ethtool_ops i40e_ethtool_ops = { .get_rxfh_indir_size = i40e_get_rxfh_indir_size, .get_rxfh = i40e_get_rxfh, .set_rxfh = i40e_set_rxfh, + .get_rxfh_fields = i40e_get_rxfh_fields, + .set_rxfh_fields = i40e_set_rxfh_fields, .get_channels = i40e_get_channels, .set_channels = i40e_set_channels, .get_module_info = i40e_get_module_info,
Signature · 1 line
2.49.0
Re: [PATCH net-next v2 5/7] eth: i40e: 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").I'm deleting all the boilerplate kdoc from the affected functions. It is somewhere between pointless and incorrect, just a burden for people refactoring the code.
Quoted 6 lines
Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>--- .../net/ethernet/intel/i40e/i40e_ethtool.c | 38 +++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-)
Jakub Kicinski
maintainerPATCH v2 6/7 eth: ice: 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").
I'm deleting all the boilerplate kdoc from the affected functions. It is somewhere between pointless and incorrect, just a burden for people refactoring the code.
--- drivers/net/ethernet/intel/ice/ice_ethtool.c | 59 ++++++-------------- 1 file changed, 18 insertions(+), 41 deletions(-)
drivers/net/ethernet/intel/ice/ice_ethtool.c +18 -41
@@ -2797,14 +2797,7 @@ ice_set_link_ksettings(struct net_device *netdev,return err; } -/** -* ice_parse_hdrs - parses headers from RSS hash input -* @nfc: ethtool rxnfc command -* -* This function parses the rxnfc command and returns intended -* header types for RSS configuration -*/ -static u32 ice_parse_hdrs (struct ethtool_rxnfc *nfc) +static u32 ice_parse_hdrs (const struct ethtool_rxfh_fields *nfc) {u32 hdrs =ICE_FLOW_SEG_HDR_NONE ;
@@ -2869,15 +2862,7 @@ static u32 ice_parse_hdrs(struct ethtool_rxnfc *nfc)return hdrs; } -/** -* ice_parse_hash_flds - parses hash fields from RSS hash input -* @nfc: ethtool rxnfc command -* @symm: true if Symmetric Topelitz is set -* -* This function parses the rxnfc command and returns intended -* hash fields for RSS configuration -*/ -static u64 ice_parse_hash_flds (struct ethtool_rxnfc *nfc,bool symm) +static u64 ice_parse_hash_flds (const struct ethtool_rxfh_fields *nfc,bool symm) {u64 hfld =ICE_HASH_INVALID ;
@@ -2974,16 +2959,13 @@ static u64 ice_parse_hash_flds(struct ethtool_rxnfc *nfc, bool symm)return hfld; } -/** -* ice_set_rss_hash_opt - Enable/Disable flow types for RSS hash -* @vsi: the VSI being configured -* @nfc: ethtool rxnfc command -* -* Returns Success if the flow input set is supported. -*/ static int -ice_set_rss_hash_opt (struct ice_vsi *vsi,struct ethtool_rxnfc *nfc) +ice_set_rxfh_fields (struct net_device *netdev, +const struct ethtool_rxfh_fields *nfc, +struct netlink_ext_ack *extack) { +struct ice_netdev_priv *np =netdev_priv (netdev); +struct ice_vsi *vsi = np->vsi;struct ice_pf *pf = vsi->back;struct ice_rss_hash_cfg cfg;struct device *dev;
@@ -3029,14 +3011,11 @@ ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)return 0 ; } -/** -* ice_get_rss_hash_opt - Retrieve hash fields for a given flow-type -* @vsi: the VSI being configured -* @nfc: ethtool rxnfc command -*/ -static void -ice_get_rss_hash_opt (struct ice_vsi *vsi,struct ethtool_rxnfc *nfc) +static int +ice_get_rxfh_fields (struct net_device *netdev,struct ethtool_rxfh_fields *nfc) { +struct ice_netdev_priv *np =netdev_priv (netdev); +struct ice_vsi *vsi = np->vsi;struct ice_pf *pf = vsi->back;struct device *dev;u64 hash_flds;
@@ -3049,21 +3028,21 @@ ice_get_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)if (ice_is_safe_mode (pf)) {dev_dbg (dev,"Advanced RSS disabled. Package download failed, vsi num = %d\n" , vsi->vsi_num); -return ; +return 0 ; } hdrs =ice_parse_hdrs (nfc);if (hdrs ==ICE_FLOW_SEG_HDR_NONE ) {dev_dbg (dev,"Header type is not valid, vsi num = %d\n" , vsi->vsi_num); -return ; +return 0 ; } hash_flds =ice_get_rss_cfg (&pf->hw, vsi->idx, hdrs, &symm);if (hash_flds ==ICE_HASH_INVALID ) {dev_dbg (dev,"No hash fields found for the given header type, vsi num = %d\n" , vsi->vsi_num); -return ; +return 0 ; } if (hash_flds & ICE_FLOW_HASH_FLD_IPV4_SA ||
@@ -3090,6 +3069,8 @@ ice_get_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc) hash_flds &ICE_FLOW_HASH_FLD_GTPU_UP_TEID || hash_flds & ICE_FLOW_HASH_FLD_GTPU_DWN_TEID) nfc->data |= (u64)RXH_GTP_TEID; + +return 0 ; }/**
@@ -3109,8 +3090,6 @@ static int ice_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)return ice_add_fdir_ethtool (vsi, cmd);case ETHTOOL_SRXCLSRLDEL :return ice_del_fdir_ethtool (vsi, cmd); -case ETHTOOL_SRXFH : -return ice_set_rss_hash_opt (vsi, cmd);default :break ; }
@@ -3153,10 +3132,6 @@ ice_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,case ETHTOOL_GRXCLSRLALL : ret =ice_get_fdir_fltr_ids (hw, cmd, (u32 *)rule_locs);break ; -case ETHTOOL_GRXFH : -ice_get_rss_hash_opt (vsi, cmd); - ret =0 ; -break ;default :break ; }
@@ -4816,6 +4791,8 @@ static const struct ethtool_ops ice_ethtool_ops = { .get_rxfh_indir_size = ice_get_rxfh_indir_size, .get_rxfh = ice_get_rxfh, .set_rxfh = ice_set_rxfh, + .get_rxfh_fields = ice_get_rxfh_fields, + .set_rxfh_fields = ice_set_rxfh_fields, .get_channels = ice_get_channels, .set_channels = ice_set_channels, .get_ts_info = ice_get_ts_info,
Signature · 1 line
2.49.0
Re: [PATCH net-next v2 6/7] eth: ice: 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").I'm deleting all the boilerplate kdoc from the affected functions. It is somewhere between pointless and incorrect, just a burden for people refactoring the code.
Quoted 5 lines
Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>--- drivers/net/ethernet/intel/ice/ice_ethtool.c | 59 ++++++-------------- 1 file changed, 18 insertions(+), 41 deletions(-)
Jakub Kicinski
maintainerPATCH v2 7/7 eth: iavf: 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").
I'm deleting all the boilerplate kdoc from the affected functions. It is somewhere between pointless and incorrect, just a burden for people refactoring the code.
--- .../net/ethernet/intel/iavf/iavf_ethtool.c | 52 ++++--------------- 1 file changed, 11 insertions(+), 41 deletions(-)
drivers/net/ethernet/intel/iavf/iavf_ethtool.c +11 -41
@@ -1307,14 +1307,7 @@ static int iavf_del_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rxreturn iavf_fdir_del_fltr (adapter, false, fsp->location); } -/** -* iavf_adv_rss_parse_hdrs - parses headers from RSS hash input -* @cmd: ethtool rxnfc command -* -* This function parses the rxnfc command and returns intended -* header types for RSS configuration -*/ -static u32 iavf_adv_rss_parse_hdrs (struct ethtool_rxnfc *cmd) +static u32 iavf_adv_rss_parse_hdrs (const struct ethtool_rxfh_fields *cmd) {u32 hdrs =IAVF_ADV_RSS_FLOW_SEG_HDR_NONE ;
@@ -1350,15 +1343,8 @@ static u32 iavf_adv_rss_parse_hdrs(struct ethtool_rxnfc *cmd)return hdrs; } -/** -* iavf_adv_rss_parse_hash_flds - parses hash fields from RSS hash input -* @cmd: ethtool rxnfc command -* @symm: true if Symmetric Topelitz is set -* -* This function parses the rxnfc command and returns intended hash fields for -* RSS configuration -*/ -static u64 iavf_adv_rss_parse_hash_flds (struct ethtool_rxnfc *cmd,bool symm) +static u64 +iavf_adv_rss_parse_hash_flds (const struct ethtool_rxfh_fields *cmd,bool symm) {u64 hfld =IAVF_ADV_RSS_HASH_INVALID ;
@@ -1416,17 +1402,12 @@ static u64 iavf_adv_rss_parse_hash_flds(struct ethtool_rxnfc *cmd, bool symm)return hfld; } -/** -* iavf_set_adv_rss_hash_opt - Enable/Disable flow types for RSS hash -* @adapter: pointer to the VF adapter structure -* @cmd: ethtool rxnfc command -* -* Returns Success if the flow input set is supported. -*/ static int -iavf_set_adv_rss_hash_opt (struct iavf_adapter *adapter, -struct ethtool_rxnfc *cmd) +iavf_set_rxfh_fields (struct net_device *netdev, +const struct ethtool_rxfh_fields *cmd, +struct netlink_ext_ack *extack) { +struct iavf_adapter *adapter =netdev_priv (netdev);struct iavf_adv_rss *rss_old, *rss_new;bool rss_new_add = false;bool symm = false;
@@ -1493,17 +1474,10 @@ iavf_set_adv_rss_hash_opt(struct iavf_adapter *adapter,return err; } -/** -* iavf_get_adv_rss_hash_opt - Retrieve hash fields for a given flow-type -* @adapter: pointer to the VF adapter structure -* @cmd: ethtool rxnfc command -* -* Returns Success if the flow input set is supported. -*/ static int -iavf_get_adv_rss_hash_opt (struct iavf_adapter *adapter, -struct ethtool_rxnfc *cmd) +iavf_get_rxfh_fields (struct net_device *netdev,struct ethtool_rxfh_fields *cmd) { +struct iavf_adapter *adapter =netdev_priv (netdev);struct iavf_adv_rss *rss;u64 hash_flds;u32 hdrs;
@@ -1568,9 +1542,6 @@ static int iavf_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)case ETHTOOL_SRXCLSRLDEL : ret =iavf_del_fdir_ethtool (adapter, cmd);break ; -case ETHTOOL_SRXFH : - ret =iavf_set_adv_rss_hash_opt (adapter, cmd); -break ;default :break ; }
@@ -1612,9 +1583,6 @@ static int iavf_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,case ETHTOOL_GRXCLSRLALL : ret =iavf_get_fdir_fltr_ids (adapter, cmd, (u32 *)rule_locs);break ; -case ETHTOOL_GRXFH : - ret =iavf_get_adv_rss_hash_opt (adapter, cmd); -break ;default :break ; }
@@ -1812,6 +1780,8 @@ static const struct ethtool_ops iavf_ethtool_ops = { .get_rxfh_indir_size = iavf_get_rxfh_indir_size, .get_rxfh = iavf_get_rxfh, .set_rxfh = iavf_set_rxfh, + .get_rxfh_fields = iavf_get_rxfh_fields, + .set_rxfh_fields = iavf_set_rxfh_fields, .get_channels = iavf_get_channels, .set_channels = iavf_set_channels, .get_rxfh_key_size = iavf_get_rxfh_key_size,
Signature · 1 line
2.49.0
Re: [PATCH net-next v2 7/7] eth: iavf: 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").I'm deleting all the boilerplate kdoc from the affected functions. It is somewhere between pointless and incorrect, just a burden for people refactoring the code.
Quoted 6 lines
Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>--- .../net/ethernet/intel/iavf/iavf_ethtool.c | 52 ++++--------------- 1 file changed, 11 insertions(+), 41 deletions(-)
Quoted 12 lines · Jakub Kicinski
Migrate Intel drivers to the recently added dedicated .get_rxfh_fields and .set_rxfh_fields ethtool callbacks.
Note that I'm deleting all the boilerplate kdoc from the affected functions in the more recent drivers. If the maintainers feel strongly I can respin and add it back, but it really feels useless and undue burden for refactoring. No other vendor does this.
v2:
- fix missing change to ops struct in ixgbe
v1: https://lore.kernel.org/[email protected]
Quoted 8 lines
Jakub Kicinski (7):
eth: igb: migrate to new RXFH callbacks
eth: igc: migrate to new RXFH callbacks
eth: ixgbe: migrate to new RXFH callbacks
eth: fm10k: migrate to new RXFH callbacks
eth: i40e: migrate to new RXFH callbacks
eth: ice: migrate to new RXFH callbacks
eth: iavf: migrate to new RXFH callbacks
For the series:
Quoted 9 lines
.../net/ethernet/intel/fm10k/fm10k_ethtool.c | 34 ++++------- .../net/ethernet/intel/i40e/i40e_ethtool.c | 38 +++++------- .../net/ethernet/intel/iavf/iavf_ethtool.c | 52 ++++------------ drivers/net/ethernet/intel/ice/ice_ethtool.c | 59 ++++++------------- drivers/net/ethernet/intel/igb/igb_ethtool.c | 20 +++---- drivers/net/ethernet/intel/igc/igc_ethtool.c | 18 +++--- .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 22 +++---- 7 files changed, 85 insertions(+), 158 deletions(-)
Quoted 26 lines
-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Saturday, June 14, 2025 11:09 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Keller, Jacob E <[email protected]>; [email protected]; [email protected]; Jakub Kicinski <[email protected]>
Subject: [PATCH net-next v2 0/7] eth: intel: migrate to new RXFH callbacksMigrate Intel drivers to the recently added dedicated .get_rxfh_fields and .set_rxfh_fields ethtool callbacks.
Note that I'm deleting all the boilerplate kdoc from the affected functions in the more recent drivers. If the maintainers feel strongly I can respin and add it back, but it really feels useless and undue burden for refactoring. No other vendor does this.
v2:
- fix missing change to ops struct in ixgbe
v1: https://lore.kernel.org/[email protected]
Quoted 9 lines
Jakub Kicinski (7):
eth: igb: migrate to new RXFH callbacks
eth: igc: migrate to new RXFH callbacks
eth: ixgbe: migrate to new RXFH callbacks
eth: fm10k: migrate to new RXFH callbacks
eth: i40e: migrate to new RXFH callbacks
eth: ice: migrate to new RXFH callbacks
eth: iavf: migrate to new RXFH callbacks
The whole series looks fine to me, thanks for doing this cleanup!
Quoted 11 lines
.../net/ethernet/intel/fm10k/fm10k_ethtool.c | 34 ++++------- .../net/ethernet/intel/i40e/i40e_ethtool.c | 38 +++++------- .../net/ethernet/intel/iavf/iavf_ethtool.c | 52 ++++------------ drivers/net/ethernet/intel/ice/ice_ethtool.c | 59 ++++++------------- drivers/net/ethernet/intel/igb/igb_ethtool.c | 20 +++---- drivers/net/ethernet/intel/igc/igc_ethtool.c | 18 +++--- .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 22 +++---- 7 files changed, 85 insertions(+), 158 deletions(-)--
2.49.0
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 9 lines · On Sat, 14 Jun 2025 11:09:00 -0700 you wrote:
Migrate Intel drivers to the recently added dedicated .get_rxfh_fields and .set_rxfh_fields ethtool callbacks.
Note that I'm deleting all the boilerplate kdoc from the affected functions in the more recent drivers. If the maintainers feel strongly I can respin and add it back, but it really feels useless and undue burden for refactoring. No other vendor does this.
[...]
Here is the summary with links:
- [net-next,v2,1/7] eth: igb: migrate to new RXFH callbacks
https://git.kernel.org/netdev/net-next/c/f148250e357b - [net-next,v2,2/7] eth: igc: migrate to new RXFH callbacks https://git.kernel.org/netdev/net-next/c/575d1b28d204 - [net-next,v2,3/7] eth: ixgbe: migrate to new RXFH callbacks https://git.kernel.org/netdev/net-next/c/ecb86e1ff4a3 - [net-next,v2,4/7] eth: fm10k: migrate to new RXFH callbacks https://git.kernel.org/netdev/net-next/c/5bd68c191a82 - [net-next,v2,5/7] eth: i40e: migrate to new RXFH callbacks https://git.kernel.org/netdev/net-next/c/5a28983710b7 - [net-next,v2,6/7] eth: ice: migrate to new RXFH callbacks https://git.kernel.org/netdev/net-next/c/1899fce53a78 - [net-next,v2,7/7] eth: iavf: migrate to new RXFH callbacks https://git.kernel.org/netdev/net-next/c/2c5f2ad1d919
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html