// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2018, Intel Corporation. */ /* ethtool support for ice */ #include "ice.h" #include "ice_ethtool.h" #include "ice_flow.h" #include "ice_fltr.h" #include "ice_lib.h" #include "ice_dcb_lib.h" #include <net/dcbnl.h> struct ice_stats { … }; #define ICE_STAT(_type, _name, _stat) … #define ICE_VSI_STAT(_name, _stat) … #define ICE_PF_STAT(_name, _stat) … static int ice_q_stats_len(struct net_device *netdev) { … } #define ICE_PF_STATS_LEN … #define ICE_VSI_STATS_LEN … #define ICE_PFC_STATS_LEN … #define ICE_ALL_STATS_LEN(n) … static const struct ice_stats ice_gstrings_vsi_stats[] = …; enum ice_ethtool_test_id { … }; static const char ice_gstrings_test[][ETH_GSTRING_LEN] = …; #define ICE_TEST_LEN … /* These PF_STATs might look like duplicates of some NETDEV_STATs, * but they aren't. This device is capable of supporting multiple * VSIs/netdevs on a single PF. The NETDEV_STATs are for individual * netdevs whereas the PF_STATs are for the physical function that's * hosting these netdevs. * * The PF_STATs are appended to the netdev stats only when ethtool -S * is queried on the base PF netdev. */ static const struct ice_stats ice_gstrings_pf_stats[] = …; static const u32 ice_regs_dump_list[] = …; struct ice_priv_flag { … }; #define ICE_PRIV_FLAG(_name, _bitno) … static const struct ice_priv_flag ice_gstrings_priv_flags[] = …; #define ICE_PRIV_FLAG_ARRAY_SIZE … static const u32 ice_adv_lnk_speed_100[] __initconst = …; static const u32 ice_adv_lnk_speed_1000[] __initconst = …; static const u32 ice_adv_lnk_speed_2500[] __initconst = …; static const u32 ice_adv_lnk_speed_5000[] __initconst = …; static const u32 ice_adv_lnk_speed_10000[] __initconst = …; static const u32 ice_adv_lnk_speed_25000[] __initconst = …; static const u32 ice_adv_lnk_speed_40000[] __initconst = …; static const u32 ice_adv_lnk_speed_50000[] __initconst = …; static const u32 ice_adv_lnk_speed_100000[] __initconst = …; static const u32 ice_adv_lnk_speed_200000[] __initconst = …; static struct ethtool_forced_speed_map ice_adv_lnk_speed_maps[] __ro_after_init = …; void __init ice_adv_lnk_speed_maps_init(void) { … } static void __ice_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo, struct ice_vsi *vsi) { … } static void ice_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) { … } static int ice_get_regs_len(struct net_device __always_unused *netdev) { … } /** * ice_ethtool_get_maxspeed - Get the max speed for given lport * @hw: pointer to the HW struct * @lport: logical port for which max speed is requested * @max_speed: return max speed for input lport * * Return: 0 on success, negative on failure. */ static int ice_ethtool_get_maxspeed(struct ice_hw *hw, u8 lport, u8 *max_speed) { … } /** * ice_is_serdes_muxed - returns whether serdes is muxed in hardware * @hw: pointer to the HW struct * * Return: true when serdes is muxed, false when serdes is not muxed. */ static bool ice_is_serdes_muxed(struct ice_hw *hw) { … } static int ice_map_port_topology_for_sfp(struct ice_port_topology *port_topology, u8 lport, bool is_muxed) { … } static int ice_map_port_topology_for_qsfp(struct ice_port_topology *port_topology, u8 lport, bool is_muxed) { … } /** * ice_get_port_topology - returns physical topology like pcsquad, pcsport, * serdes number * @hw: pointer to the HW struct * @lport: logical port for which physical info requested * @port_topology: buffer to hold port topology * * Return: 0 on success, negative on failure. */ static int ice_get_port_topology(struct ice_hw *hw, u8 lport, struct ice_port_topology *port_topology) { … } /** * ice_get_tx_rx_equa - read serdes tx rx equaliser param * @hw: pointer to the HW struct * @serdes_num: represents the serdes number * @ptr: structure to read all serdes parameter for given serdes * * Return: all serdes equalization parameter supported per serdes number */ static int ice_get_tx_rx_equa(struct ice_hw *hw, u8 serdes_num, struct ice_serdes_equalization_to_ethtool *ptr) { … } /** * ice_get_extended_regs - returns FEC correctable, uncorrectable stats per * pcsquad, pcsport * @netdev: pointer to net device structure * @p: output buffer to fill requested register dump * * Return: 0 on success, negative on failure. */ static int ice_get_extended_regs(struct net_device *netdev, void *p) { … } static void ice_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p) { … } static u32 ice_get_msglevel(struct net_device *netdev) { … } static void ice_set_msglevel(struct net_device *netdev, u32 data) { … } static int ice_get_eeprom_len(struct net_device *netdev) { … } static int ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, u8 *bytes) { … } /** * ice_active_vfs - check if there are any active VFs * @pf: board private structure * * Returns true if an active VF is found, otherwise returns false */ static bool ice_active_vfs(struct ice_pf *pf) { … } /** * ice_link_test - perform a link test on a given net_device * @netdev: network interface device structure * * This function performs one of the self-tests required by ethtool. * Returns 0 on success, non-zero on failure. */ static u64 ice_link_test(struct net_device *netdev) { … } /** * ice_eeprom_test - perform an EEPROM test on a given net_device * @netdev: network interface device structure * * This function performs one of the self-tests required by ethtool. * Returns 0 on success, non-zero on failure. */ static u64 ice_eeprom_test(struct net_device *netdev) { … } /** * ice_reg_pattern_test * @hw: pointer to the HW struct * @reg: reg to be tested * @mask: bits to be touched */ static int ice_reg_pattern_test(struct ice_hw *hw, u32 reg, u32 mask) { … } /** * ice_reg_test - perform a register test on a given net_device * @netdev: network interface device structure * * This function performs one of the self-tests required by ethtool. * Returns 0 on success, non-zero on failure. */ static u64 ice_reg_test(struct net_device *netdev) { … } /** * ice_lbtest_prepare_rings - configure Tx/Rx test rings * @vsi: pointer to the VSI structure * * Function configures rings of a VSI for loopback test without * enabling interrupts or informing the kernel about new queues. * * Returns 0 on success, negative on failure. */ static int ice_lbtest_prepare_rings(struct ice_vsi *vsi) { … } /** * ice_lbtest_disable_rings - disable Tx/Rx test rings after loopback test * @vsi: pointer to the VSI structure * * Function stops and frees VSI rings after a loopback test. * Returns 0 on success, negative on failure. */ static int ice_lbtest_disable_rings(struct ice_vsi *vsi) { … } /** * ice_lbtest_create_frame - create test packet * @pf: pointer to the PF structure * @ret_data: allocated frame buffer * @size: size of the packet data * * Function allocates a frame with a test pattern on specific offsets. * Returns 0 on success, non-zero on failure. */ static int ice_lbtest_create_frame(struct ice_pf *pf, u8 **ret_data, u16 size) { … } /** * ice_lbtest_check_frame - verify received loopback frame * @frame: pointer to the raw packet data * * Function verifies received test frame with a pattern. * Returns true if frame matches the pattern, false otherwise. */ static bool ice_lbtest_check_frame(u8 *frame) { … } /** * ice_diag_send - send test frames to the test ring * @tx_ring: pointer to the transmit ring * @data: pointer to the raw packet data * @size: size of the packet to send * * Function sends loopback packets on a test Tx ring. */ static int ice_diag_send(struct ice_tx_ring *tx_ring, u8 *data, u16 size) { … } #define ICE_LB_FRAME_SIZE … /** * ice_lbtest_receive_frames - receive and verify test frames * @rx_ring: pointer to the receive ring * * Function receives loopback packets and verify their correctness. * Returns number of received valid frames. */ static int ice_lbtest_receive_frames(struct ice_rx_ring *rx_ring) { … } /** * ice_loopback_test - perform a loopback test on a given net_device * @netdev: network interface device structure * * This function performs one of the self-tests required by ethtool. * Returns 0 on success, non-zero on failure. */ static u64 ice_loopback_test(struct net_device *netdev) { … } /** * ice_intr_test - perform an interrupt test on a given net_device * @netdev: network interface device structure * * This function performs one of the self-tests required by ethtool. * Returns 0 on success, non-zero on failure. */ static u64 ice_intr_test(struct net_device *netdev) { … } /** * ice_self_test - handler function for performing a self-test by ethtool * @netdev: network interface device structure * @eth_test: ethtool_test structure * @data: required by ethtool.self_test * * This function is called after invoking 'ethtool -t devname' command where * devname is the name of the network device on which ethtool should operate. * It performs a set of self-tests to check if a device works properly. */ static void ice_self_test(struct net_device *netdev, struct ethtool_test *eth_test, u64 *data) { … } static void __ice_get_strings(struct net_device *netdev, u32 stringset, u8 *data, struct ice_vsi *vsi) { … } static void ice_get_strings(struct net_device *netdev, u32 stringset, u8 *data) { … } static int ice_set_phys_id(struct net_device *netdev, enum ethtool_phys_id_state state) { … } /** * ice_set_fec_cfg - Set link FEC options * @netdev: network interface device structure * @req_fec: FEC mode to configure */ static int ice_set_fec_cfg(struct net_device *netdev, enum ice_fec_mode req_fec) { … } /** * ice_set_fecparam - Set FEC link options * @netdev: network interface device structure * @fecparam: Ethtool structure to retrieve FEC parameters */ static int ice_set_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam) { … } /** * ice_get_fecparam - Get link FEC options * @netdev: network interface device structure * @fecparam: Ethtool structure to retrieve FEC parameters */ static int ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam) { … } /** * ice_nway_reset - restart autonegotiation * @netdev: network interface device structure */ static int ice_nway_reset(struct net_device *netdev) { … } /** * ice_get_priv_flags - report device private flags * @netdev: network interface device structure * * The get string set count and the string set should be matched for each * flag returned. Add new strings for each flag to the ice_gstrings_priv_flags * array. * * Returns a u32 bitmap of flags. */ static u32 ice_get_priv_flags(struct net_device *netdev) { … } /** * ice_set_priv_flags - set private flags * @netdev: network interface device structure * @flags: bit flags to be set */ static int ice_set_priv_flags(struct net_device *netdev, u32 flags) { … } static int ice_get_sset_count(struct net_device *netdev, int sset) { … } static void __ice_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats __always_unused *stats, u64 *data, struct ice_vsi *vsi) { … } static void ice_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats __always_unused *stats, u64 *data) { … } #define ICE_PHY_TYPE_LOW_MASK_MIN_1G … #define ICE_PHY_TYPE_LOW_MASK_MIN_25G … #define ICE_PHY_TYPE_LOW_MASK_100G … #define ICE_PHY_TYPE_HIGH_MASK_100G … #define ICE_PHY_TYPE_HIGH_MASK_200G … /** * ice_mask_min_supported_speeds * @hw: pointer to the HW structure * @phy_types_high: PHY type high * @phy_types_low: PHY type low to apply minimum supported speeds mask * * Apply minimum supported speeds mask to PHY type low. These are the speeds * for ethtool supported link mode. */ static void ice_mask_min_supported_speeds(struct ice_hw *hw, u64 phy_types_high, u64 *phy_types_low) { … } /** * ice_linkmode_set_bit - set link mode bit * @phy_to_ethtool: PHY type to ethtool link mode struct to set * @ks: ethtool link ksettings struct to fill out * @req_speeds: speed requested by user * @advert_phy_type: advertised PHY type * @phy_type: PHY type */ static void ice_linkmode_set_bit(const struct ice_phy_type_to_ethtool *phy_to_ethtool, struct ethtool_link_ksettings *ks, u32 req_speeds, u64 advert_phy_type, u32 phy_type) { … } /** * ice_phy_type_to_ethtool - convert the phy_types to ethtool link modes * @netdev: network interface device structure * @ks: ethtool link ksettings struct to fill out */ static void ice_phy_type_to_ethtool(struct net_device *netdev, struct ethtool_link_ksettings *ks) { … } #define TEST_SET_BITS_TIMEOUT … #define TEST_SET_BITS_SLEEP_MAX … #define TEST_SET_BITS_SLEEP_MIN … /** * ice_get_settings_link_up - Get Link settings for when link is up * @ks: ethtool ksettings to fill in * @netdev: network interface device structure */ static void ice_get_settings_link_up(struct ethtool_link_ksettings *ks, struct net_device *netdev) { … } /** * ice_get_settings_link_down - Get the Link settings when link is down * @ks: ethtool ksettings to fill in * @netdev: network interface device structure * * Reports link settings that can be determined when link is down */ static void ice_get_settings_link_down(struct ethtool_link_ksettings *ks, struct net_device *netdev) { … } /** * ice_get_link_ksettings - Get Link Speed and Duplex settings * @netdev: network interface device structure * @ks: ethtool ksettings * * Reports speed/duplex settings based on media_type */ static int ice_get_link_ksettings(struct net_device *netdev, struct ethtool_link_ksettings *ks) { … } /** * ice_speed_to_aq_link - Get AQ link speed by Ethtool forced speed * @speed: ethtool forced speed */ static u16 ice_speed_to_aq_link(int speed) { … } /** * ice_ksettings_find_adv_link_speed - Find advertising link speed * @ks: ethtool ksettings */ static u16 ice_ksettings_find_adv_link_speed(const struct ethtool_link_ksettings *ks) { … } /** * ice_setup_autoneg * @p: port info * @ks: ethtool_link_ksettings * @config: configuration that will be sent down to FW * @autoneg_enabled: autonegotiation is enabled or not * @autoneg_changed: will there a change in autonegotiation * @netdev: network interface device structure * * Setup PHY autonegotiation feature */ static int ice_setup_autoneg(struct ice_port_info *p, struct ethtool_link_ksettings *ks, struct ice_aqc_set_phy_cfg_data *config, u8 autoneg_enabled, u8 *autoneg_changed, struct net_device *netdev) { … } /** * ice_set_phy_type_from_speed - set phy_types based on speeds * and advertised modes * @ks: ethtool link ksettings struct * @phy_type_low: pointer to the lower part of phy_type * @phy_type_high: pointer to the higher part of phy_type * @adv_link_speed: targeted link speeds bitmap */ static void ice_set_phy_type_from_speed(const struct ethtool_link_ksettings *ks, u64 *phy_type_low, u64 *phy_type_high, u16 adv_link_speed) { … } /** * ice_set_link_ksettings - Set Speed and Duplex * @netdev: network interface device structure * @ks: ethtool ksettings * * Set speed/duplex per media_types advertised/forced */ static int ice_set_link_ksettings(struct net_device *netdev, const struct ethtool_link_ksettings *ks) { … } /** * 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) { … } /** * 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) { … } /** * 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_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) { … } /** * ice_set_rxnfc - command to set Rx flow rules. * @netdev: network interface device structure * @cmd: ethtool rxnfc command * * Returns 0 for success and negative values for errors */ static int ice_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd) { … } /** * ice_get_rxnfc - command to get Rx flow classification rules * @netdev: network interface device structure * @cmd: ethtool rxnfc command * @rule_locs: buffer to rturn Rx flow classification rules * * Returns Success if the command is supported. */ static int ice_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd, u32 __always_unused *rule_locs) { … } static void ice_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, struct netlink_ext_ack *extack) { … } static int ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, struct netlink_ext_ack *extack) { … } /** * ice_get_pauseparam - Get Flow Control status * @netdev: network interface device structure * @pause: ethernet pause (flow control) parameters * * Get requested flow control status from PHY capability. * If autoneg is true, then ethtool will send the ETHTOOL_GSET ioctl which * is handled by ice_get_link_ksettings. ice_get_link_ksettings will report * the negotiated Rx/Tx pause via lp_advertising. */ static void ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) { … } /** * ice_set_pauseparam - Set Flow Control parameter * @netdev: network interface device structure * @pause: return Tx/Rx flow control status */ static int ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) { … } /** * ice_get_rxfh_key_size - get the RSS hash key size * @netdev: network interface device structure * * Returns the table size. */ static u32 ice_get_rxfh_key_size(struct net_device __always_unused *netdev) { … } /** * ice_get_rxfh_indir_size - get the Rx flow hash indirection table size * @netdev: network interface device structure * * Returns the table size. */ static u32 ice_get_rxfh_indir_size(struct net_device *netdev) { … } /** * ice_get_rxfh - get the Rx flow hash indirection table * @netdev: network interface device structure * @rxfh: pointer to param struct (indir, key, hfunc) * * Reads the indirection table directly from the hardware. */ static int ice_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh) { … } /** * ice_set_rxfh - set the Rx flow hash indirection table * @netdev: network interface device structure * @rxfh: pointer to param struct (indir, key, hfunc) * @extack: extended ACK from the Netlink message * * Returns -EINVAL if the table specifies an invalid queue ID, otherwise * returns 0 after programming the table. */ static int ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh, struct netlink_ext_ack *extack) { … } static int ice_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info) { … } /** * ice_get_max_txq - return the maximum number of Tx queues for in a PF * @pf: PF structure */ static int ice_get_max_txq(struct ice_pf *pf) { … } /** * ice_get_max_rxq - return the maximum number of Rx queues for in a PF * @pf: PF structure */ static int ice_get_max_rxq(struct ice_pf *pf) { … } /** * ice_get_combined_cnt - return the current number of combined channels * @vsi: PF VSI pointer * * Go through all queue vectors and count ones that have both Rx and Tx ring * attached */ static u32 ice_get_combined_cnt(struct ice_vsi *vsi) { … } /** * ice_get_channels - get the current and max supported channels * @dev: network interface device structure * @ch: ethtool channel data structure */ static void ice_get_channels(struct net_device *dev, struct ethtool_channels *ch) { … } /** * ice_get_valid_rss_size - return valid number of RSS queues * @hw: pointer to the HW structure * @new_size: requested RSS queues */ static int ice_get_valid_rss_size(struct ice_hw *hw, int new_size) { … } /** * ice_vsi_set_dflt_rss_lut - set default RSS LUT with requested RSS size * @vsi: VSI to reconfigure RSS LUT on * @req_rss_size: requested range of queue numbers for hashing * * Set the VSI's RSS parameters, configure the RSS LUT based on these. */ static int ice_vsi_set_dflt_rss_lut(struct ice_vsi *vsi, int req_rss_size) { … } /** * ice_set_channels - set the number channels * @dev: network interface device structure * @ch: ethtool channel data structure */ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch) { … } /** * ice_get_wol - get current Wake on LAN configuration * @netdev: network interface device structure * @wol: Ethtool structure to retrieve WoL settings */ static void ice_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) { … } /** * ice_set_wol - set Wake on LAN on supported device * @netdev: network interface device structure * @wol: Ethtool structure to set WoL */ static int ice_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) { … } /** * ice_get_rc_coalesce - get ITR values for specific ring container * @ec: ethtool structure to fill with driver's coalesce settings * @rc: ring container that the ITR values will come from * * Query the device for ice_ring_container specific ITR values. This is * done per ice_ring_container because each q_vector can have 1 or more rings * and all of said ring(s) will have the same ITR values. * * Returns 0 on success, negative otherwise. */ static int ice_get_rc_coalesce(struct ethtool_coalesce *ec, struct ice_ring_container *rc) { … } /** * ice_get_q_coalesce - get a queue's ITR/INTRL (coalesce) settings * @vsi: VSI associated to the queue for getting ITR/INTRL (coalesce) settings * @ec: coalesce settings to program the device with * @q_num: update ITR/INTRL (coalesce) settings for this queue number/index * * Return 0 on success, and negative under the following conditions: * 1. Getting Tx or Rx ITR/INTRL (coalesce) settings failed. * 2. The q_num passed in is not a valid number/index for Tx and Rx rings. */ static int ice_get_q_coalesce(struct ice_vsi *vsi, struct ethtool_coalesce *ec, int q_num) { … } /** * __ice_get_coalesce - get ITR/INTRL values for the device * @netdev: pointer to the netdev associated with this query * @ec: ethtool structure to fill with driver's coalesce settings * @q_num: queue number to get the coalesce settings for * * If the caller passes in a negative q_num then we return coalesce settings * based on queue number 0, else use the actual q_num passed in. */ static int __ice_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec, int q_num) { … } static int ice_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec, struct kernel_ethtool_coalesce *kernel_coal, struct netlink_ext_ack *extack) { … } static int ice_get_per_q_coalesce(struct net_device *netdev, u32 q_num, struct ethtool_coalesce *ec) { … } /** * ice_set_rc_coalesce - set ITR values for specific ring container * @ec: ethtool structure from user to update ITR settings * @rc: ring container that the ITR values will come from * @vsi: VSI associated to the ring container * * Set specific ITR values. This is done per ice_ring_container because each * q_vector can have 1 or more rings and all of said ring(s) will have the same * ITR values. * * Returns 0 on success, negative otherwise. */ static int ice_set_rc_coalesce(struct ethtool_coalesce *ec, struct ice_ring_container *rc, struct ice_vsi *vsi) { … } /** * ice_set_q_coalesce - set a queue's ITR/INTRL (coalesce) settings * @vsi: VSI associated to the queue that need updating * @ec: coalesce settings to program the device with * @q_num: update ITR/INTRL (coalesce) settings for this queue number/index * * Return 0 on success, and negative under the following conditions: * 1. Setting Tx or Rx ITR/INTRL (coalesce) settings failed. * 2. The q_num passed in is not a valid number/index for Tx and Rx rings. */ static int ice_set_q_coalesce(struct ice_vsi *vsi, struct ethtool_coalesce *ec, int q_num) { … } /** * ice_print_if_odd_usecs - print message if user tries to set odd [tx|rx]-usecs * @netdev: netdev used for print * @itr_setting: previous user setting * @use_adaptive_coalesce: if adaptive coalesce is enabled or being enabled * @coalesce_usecs: requested value of [tx|rx]-usecs * @c_type_str: either "rx" or "tx" to match user set field of [tx|rx]-usecs */ static void ice_print_if_odd_usecs(struct net_device *netdev, u16 itr_setting, u32 use_adaptive_coalesce, u32 coalesce_usecs, const char *c_type_str) { … } /** * __ice_set_coalesce - set ITR/INTRL values for the device * @netdev: pointer to the netdev associated with this query * @ec: ethtool structure to fill with driver's coalesce settings * @q_num: queue number to get the coalesce settings for * * If the caller passes in a negative q_num then we set the coalesce settings * for all Tx/Rx queues, else use the actual q_num passed in. */ static int __ice_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec, int q_num) { … } static int ice_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec, struct kernel_ethtool_coalesce *kernel_coal, struct netlink_ext_ack *extack) { … } static int ice_set_per_q_coalesce(struct net_device *netdev, u32 q_num, struct ethtool_coalesce *ec) { … } static void ice_repr_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) { … } static void ice_repr_get_strings(struct net_device *netdev, u32 stringset, u8 *data) { … } static void ice_repr_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats __always_unused *stats, u64 *data) { … } static int ice_repr_get_sset_count(struct net_device *netdev, int sset) { … } #define ICE_I2C_EEPROM_DEV_ADDR … #define ICE_I2C_EEPROM_DEV_ADDR2 … #define ICE_MODULE_TYPE_SFP … #define ICE_MODULE_TYPE_QSFP_PLUS … #define ICE_MODULE_TYPE_QSFP28 … #define ICE_MODULE_SFF_ADDR_MODE … #define ICE_MODULE_SFF_DIAG_CAPAB … #define ICE_MODULE_REVISION_ADDR … #define ICE_MODULE_SFF_8472_COMP … #define ICE_MODULE_SFF_8472_SWAP … #define ICE_MODULE_QSFP_MAX_LEN … /** * ice_get_module_info - get SFF module type and revision information * @netdev: network interface device structure * @modinfo: module EEPROM size and layout information structure */ static int ice_get_module_info(struct net_device *netdev, struct ethtool_modinfo *modinfo) { … } /** * ice_get_module_eeprom - fill buffer with SFF EEPROM contents * @netdev: network interface device structure * @ee: EEPROM dump request structure * @data: buffer to be filled with EEPROM contents */ static int ice_get_module_eeprom(struct net_device *netdev, struct ethtool_eeprom *ee, u8 *data) { … } /** * ice_get_port_fec_stats - returns FEC correctable, uncorrectable stats per * pcsquad, pcsport * @hw: pointer to the HW struct * @pcs_quad: pcsquad for input port * @pcs_port: pcsport for input port * @fec_stats: buffer to hold FEC statistics for given port * * Return: 0 on success, negative on failure. */ static int ice_get_port_fec_stats(struct ice_hw *hw, u16 pcs_quad, u16 pcs_port, struct ethtool_fec_stats *fec_stats) { … } /** * ice_get_fec_stats - returns FEC correctable, uncorrectable stats per netdev * @netdev: network interface device structure * @fec_stats: buffer to hold FEC statistics for given port * */ static void ice_get_fec_stats(struct net_device *netdev, struct ethtool_fec_stats *fec_stats) { … } static const struct ethtool_ops ice_ethtool_ops = …; static const struct ethtool_ops ice_ethtool_safe_mode_ops = …; /** * ice_set_ethtool_safe_mode_ops - setup safe mode ethtool ops * @netdev: network interface device structure */ void ice_set_ethtool_safe_mode_ops(struct net_device *netdev) { … } static const struct ethtool_ops ice_ethtool_repr_ops = …; /** * ice_set_ethtool_repr_ops - setup VF's port representor ethtool ops * @netdev: network interface device structure */ void ice_set_ethtool_repr_ops(struct net_device *netdev) { … } /** * ice_set_ethtool_ops - setup netdev ethtool ops * @netdev: network interface device structure * * setup netdev ethtool ops with ice specific ops */ void ice_set_ethtool_ops(struct net_device *netdev) { … }