ice: staticization refactor
Subsystems (2)
v3 cover ice: staticization refactor
ice: refactor methods to make them static
This series of patches refactor some ice driver files in order to make as many methods as possible static. One additional patch introduced in v3 also refactors one method that can be simplified thanks to being static.
Also there's a minor cleanup of unused methods.
Jan Sokolowski (7):
ice: remove unused methods
ice: refactor ice_ddp to make functions static
ice: refactor ice_lib to make functions static
ice: refactor ice_vf_lib to make functions static
ice: refactor ice_sched to make functions static
ice: refactor ice_ptp_hw to make functions static
ice: refactor ice_vsi_is_vlan_pruning_ena
drivers/net/ethernet/intel/ice/ice_ddp.c | 120 ++--- drivers/net/ethernet/intel/ice/ice_ddp.h | 10 - drivers/net/ethernet/intel/ice/ice_lib.c | 82 ++- drivers/net/ethernet/intel/ice/ice_lib.h | 5 - drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 25 +- drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 4 - drivers/net/ethernet/intel/ice/ice_sched.c | 2 +- drivers/net/ethernet/intel/ice/ice_sched.h | 4 - drivers/net/ethernet/intel/ice/ice_switch.c | 48 -- drivers/net/ethernet/intel/ice/ice_switch.h | 1 - drivers/net/ethernet/intel/ice/ice_vf_lib.c | 468 +++++++++--------- .../ethernet/intel/ice/ice_vf_lib_private.h | 2 - 12 files changed, 331 insertions(+), 440 deletions(-)
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v3 1/7 ice: remove unused methods
Following methods were found to no longer be in use:ice_is_pca9575_presentice_mac_fltr_existice_napi_del
Remove them.
--- drivers/net/ethernet/intel/ice/ice_lib.c | 15 ------- drivers/net/ethernet/intel/ice/ice_lib.h | 2 - drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 19 -------- drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 1 - drivers/net/ethernet/intel/ice/ice_switch.c | 48 --------------------- drivers/net/ethernet/intel/ice/ice_switch.h | 1 - 6 files changed, 86 deletions(-)
drivers/net/ethernet/intel/ice/ice_lib.c +0 -15
@@ -2943,21 +2943,6 @@ void ice_vsi_dis_irq(struct ice_vsi *vsi)synchronize_irq (vsi->q_vectors[i]->irq.virq); } -/** -* ice_napi_del - Remove NAPI handler for the VSI -* @vsi: VSI for which NAPI handler is to be removed -*/ -void ice_napi_del (struct ice_vsi *vsi) -{ -int v_idx; - -if (!vsi->netdev) -return ; - -ice_for_each_q_vector (vsi, v_idx) -netif_napi_del (&vsi->q_vectors[v_idx]->napi); -} -/** * ice_vsi_release - Delete a VSI and free its resources * @vsi: the VSI being removed
drivers/net/ethernet/intel/ice/ice_lib.h +0 -2
@@ -93,8 +93,6 @@ void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi, u8 ena_tc);struct ice_vsi *ice_vsi_setup (struct ice_pf *pf,struct ice_vsi_cfg_params *params); -void ice_napi_del (struct ice_vsi *vsi); -int ice_vsi_release (struct ice_vsi *vsi);void ice_vsi_close (struct ice_vsi *vsi);
drivers/net/ethernet/intel/ice/ice_ptp_hw.c +0 -19
@@ -3113,25 +3113,6 @@ int ice_read_pca9575_reg_e810t(struct ice_hw *hw, u8 offset, u8 *data)return ice_aq_read_i2c (hw, link_topo,0 , addr,1 , data,NULL ); } -/** -* ice_is_pca9575_present -* @hw: pointer to the hw struct -* -* Check if the SW IO expander is present in the netlist -*/ -bool ice_is_pca9575_present (struct ice_hw *hw) -{ -u16 handle =0 ; -int status; - -if (!ice_is_e810t (hw)) -return false; - - status =ice_get_pca9575_handle (hw, &handle); - -return !status && handle; -} -/* Device agnostic functions * * The following functions implement shared behavior common to both E822 and
drivers/net/ethernet/intel/ice/ice_ptp_hw.h +0 -1
@@ -202,7 +202,6 @@ int ice_ptp_init_phy_e810(struct ice_hw *hw);int ice_read_sma_ctrl_e810t (struct ice_hw *hw,u8 *data);int ice_write_sma_ctrl_e810t (struct ice_hw *hw,u8 data);int ice_read_pca9575_reg_e810t (struct ice_hw *hw,u8 offset,u8 *data); -bool ice_is_pca9575_present (struct ice_hw *hw);void ice_ptp_init_phy_model (struct ice_hw *hw);
drivers/net/ethernet/intel/ice/ice_switch.c +0 -48
54 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_switch.h +0 -1
@@ -371,7 +371,6 @@ int ice_add_vlan(struct ice_hw *hw, struct list_head *m_list);int ice_remove_vlan (struct ice_hw *hw,struct list_head *v_list);int ice_add_mac (struct ice_hw *hw,struct list_head *m_lst);int ice_remove_mac (struct ice_hw *hw,struct list_head *m_lst); -bool ice_mac_fltr_exist (struct ice_hw *hw,u8 *mac,u16 vsi_handle);bool ice_vlan_fltr_exist (struct ice_hw *hw,u16 vlan_id,u16 vsi_handle);int ice_add_eth_mac (struct ice_hw *hw,struct list_head *em_list);int ice_remove_eth_mac (struct ice_hw *hw,struct list_head *em_list);
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v3 2/7 ice: refactor ice_ddp to make functions static
In reply to Jan SokolowskiAs following methods are not used outside of ice_ddp, they can be made static:ice_verify_pgkice_pkg_val_bufice_aq_download_pkgice_aq_update_pkgice_find_seg_in_pkg
--- drivers/net/ethernet/intel/ice/ice_ddp.c | 120 ++++++++++++----------- drivers/net/ethernet/intel/ice/ice_ddp.h | 10 -- 2 files changed, 61 insertions(+), 69 deletions(-)
drivers/net/ethernet/intel/ice/ice_ddp.c +61 -59
@@ -30,7 +30,7 @@ static const struct ice_tunnel_type_scan tnls[] = {* Verifies various attributes of the package file, including length, format * version, and the requirement of at least one segment. */ -enum ice_ddp_state ice_verify_pkg (struct ice_pkg_hdr *pkg,u32 len) +static enum ice_ddp_state ice_verify_pkg (struct ice_pkg_hdr *pkg,u32 len) {u32 seg_count;u32 i;
@@ -118,7 +118,7 @@ static enum ice_ddp_state ice_chk_pkg_version(struct ice_pkg_ver *pkg_ver)* * This helper function validates a buffer's header. */ -struct ice_buf_hdr *ice_pkg_val_buf (struct ice_buf *buf) +static struct ice_buf_hdr *ice_pkg_val_buf (struct ice_buf *buf) {struct ice_buf_hdr *hdr;u16 section_count;
@@ -1152,6 +1152,54 @@ static void ice_release_global_cfg_lock(struct ice_hw *hw)ice_release_res (hw,ICE_GLOBAL_CFG_LOCK_RES_ID ); } +/** +* ice_aq_download_pkg +* @hw: pointer to the hardware structure +* @pkg_buf: the package buffer to transfer +* @buf_size: the size of the package buffer +* @last_buf: last buffer indicator +* @error_offset: returns error offset +* @error_info: returns error information +* @cd: pointer to command details structure or NULL +* +* Download Package (0x0C40) +*/ +static int +ice_aq_download_pkg (struct ice_hw *hw,struct ice_buf_hdr *pkg_buf, +u16 buf_size,bool last_buf,u32 *error_offset, +u32 *error_info,struct ice_sq_cd *cd) +{ +struct ice_aqc_download_pkg *cmd; +struct ice_aq_desc desc; +int status; + +if (error_offset) + *error_offset =0 ; +if (error_info) + *error_info =0 ; + + cmd = &desc.params.download_pkg; +ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_download_pkg); + desc.flags |=cpu_to_le16 (ICE_AQ_FLAG_RD ); + +if (last_buf) + cmd->flags |=ICE_AQC_DOWNLOAD_PKG_LAST_BUF ; + + status =ice_aq_send_cmd (hw, &desc, pkg_buf, buf_size, cd); +if (status == -EIO ) { +/* Read error from buffer only when the FW returned an error */ +struct ice_aqc_download_pkg_resp *resp; + + resp = (struct ice_aqc_download_pkg_resp *)pkg_buf; +if (error_offset) + *error_offset =le32_to_cpu (resp->error_offset); +if (error_info) + *error_info =le32_to_cpu (resp->error_info); + } + +return status; +} +/** * ice_dwnld_cfg_bufs * @hw: pointer to the hardware structure
@@ -1294,20 +1342,20 @@ static enum ice_ddp_state ice_download_pkg(struct ice_hw *hw, }/** -* ice_aq_download_pkg +* ice_aq_update_pkg * @hw: pointer to the hardware structure -* @pkg_buf: the package buffer to transfer -* @buf_size: the size of the package buffer +* @pkg_buf: the package cmd buffer +* @buf_size: the size of the package cmd buffer * @last_buf: last buffer indicator * @error_offset: returns error offset * @error_info: returns error information * @cd: pointer to command details structure or NULL * -* Download Package (0x0C40) +* Update Package (0x0C42) */ -int ice_aq_download_pkg (struct ice_hw *hw,struct ice_buf_hdr *pkg_buf, -u16 buf_size,bool last_buf,u32 *error_offset, -u32 *error_info,struct ice_sq_cd *cd) +static int ice_aq_update_pkg (struct ice_hw *hw,struct ice_buf_hdr *pkg_buf, +u16 buf_size,bool last_buf,u32 *error_offset, +u32 *error_info,struct ice_sq_cd *cd) {struct ice_aqc_download_pkg *cmd;struct ice_aq_desc desc;
@@ -1319,7 +1367,7 @@ int ice_aq_download_pkg(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf, *error_info =0 ; cmd = &desc.params.download_pkg; -ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_download_pkg); +ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_update_pkg); desc.flags |=cpu_to_le16 (ICE_AQ_FLAG_RD );if (last_buf)
@@ -1360,53 +1408,6 @@ int ice_aq_upload_section(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf,return ice_aq_send_cmd (hw, &desc, pkg_buf, buf_size, cd); } -/** -* ice_aq_update_pkg -* @hw: pointer to the hardware structure -* @pkg_buf: the package cmd buffer -* @buf_size: the size of the package cmd buffer -* @last_buf: last buffer indicator -* @error_offset: returns error offset -* @error_info: returns error information -* @cd: pointer to command details structure or NULL -* -* Update Package (0x0C42) -*/ -static int ice_aq_update_pkg (struct ice_hw *hw,struct ice_buf_hdr *pkg_buf, -u16 buf_size,bool last_buf,u32 *error_offset, -u32 *error_info,struct ice_sq_cd *cd) -{ -struct ice_aqc_download_pkg *cmd; -struct ice_aq_desc desc; -int status; - -if (error_offset) - *error_offset =0 ; -if (error_info) - *error_info =0 ; - - cmd = &desc.params.download_pkg; -ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_update_pkg); - desc.flags |=cpu_to_le16 (ICE_AQ_FLAG_RD ); - -if (last_buf) - cmd->flags |=ICE_AQC_DOWNLOAD_PKG_LAST_BUF ; - - status =ice_aq_send_cmd (hw, &desc, pkg_buf, buf_size, cd); -if (status == -EIO ) { -/* Read error from buffer only when the FW returned an error */ -struct ice_aqc_download_pkg_resp *resp; - - resp = (struct ice_aqc_download_pkg_resp *)pkg_buf; -if (error_offset) - *error_offset =le32_to_cpu (resp->error_offset); -if (error_info) - *error_info =le32_to_cpu (resp->error_info); - } - -return status; -} -/** * ice_update_pkg_no_lock * @hw: pointer to the hardware structure
@@ -1470,8 +1471,9 @@ int ice_update_pkg(struct ice_hw *hw, struct ice_buf *bufs, u32 count)* success it returns a pointer to the segment header, otherwise it will * return NULL. */ -struct ice_generic_seg_hdr *ice_find_seg_in_pkg (struct ice_hw *hw,u32 seg_type, -struct ice_pkg_hdr *pkg_hdr) +static struct ice_generic_seg_hdr * +ice_find_seg_in_pkg (struct ice_hw *hw,u32 seg_type, +struct ice_pkg_hdr *pkg_hdr) {u32 i;
drivers/net/ethernet/intel/ice/ice_ddp.h +0 -10
@@ -416,21 +416,13 @@ struct ice_pkg_enum {void *(*handler)(u32 sect_type,void *section,u32 index,u32 *offset); }; -int ice_aq_download_pkg (struct ice_hw *hw,struct ice_buf_hdr *pkg_buf, -u16 buf_size,bool last_buf,u32 *error_offset, -u32 *error_info,struct ice_sq_cd *cd);int ice_aq_upload_section (struct ice_hw *hw,struct ice_buf_hdr *pkg_buf,u16 buf_size,struct ice_sq_cd *cd);void *ice_pkg_buf_alloc_section (struct ice_buf_build *bld,u32 type,u16 size); -enum ice_ddp_state ice_verify_pkg (struct ice_pkg_hdr *pkg,u32 len); -struct ice_buf_build *ice_pkg_buf_alloc (struct ice_hw *hw); -struct ice_generic_seg_hdr *ice_find_seg_in_pkg (struct ice_hw *hw,u32 seg_type, -struct ice_pkg_hdr *pkg_hdr); -int ice_update_pkg_no_lock (struct ice_hw *hw,struct ice_buf *bufs,u32 count);int ice_update_pkg (struct ice_hw *hw,struct ice_buf *bufs,u32 count);
@@ -439,6 +431,4 @@ u16 ice_pkg_buf_get_active_sections(struct ice_buf_build *bld);void *ice_pkg_enum_section (struct ice_seg *ice_seg,struct ice_pkg_enum *state,u32 sect_type); -struct ice_buf_hdr *ice_pkg_val_buf (struct ice_buf *buf); -#endif
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v3 3/7 ice: refactor ice_lib to make functions static
In reply to Jan SokolowskiAs following methods are not used outside of ice_lib, they can be made static:ice_vsi_is_vlan_pruning_ena ice_vsi_cfg_frame_size
--- drivers/net/ethernet/intel/ice/ice_lib.c | 70 ++++++++++++------------ drivers/net/ethernet/intel/ice/ice_lib.h | 3 - 2 files changed, 35 insertions(+), 38 deletions(-)
drivers/net/ethernet/intel/ice/ice_lib.c +35 -35
@@ -1227,6 +1227,20 @@ ice_chnl_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt) ctxt->info.q_mapping[1 ] =cpu_to_le16 (qcount); } +/** +* ice_vsi_is_vlan_pruning_ena - check if VLAN pruning is enabled or not +* @vsi: VSI to check whether or not VLAN pruning is enabled. +* +* returns true if Rx VLAN pruning is enabled and false otherwise. +*/ +static bool ice_vsi_is_vlan_pruning_ena (struct ice_vsi *vsi) +{ +if (!vsi) +return false; + +return (vsi->info.sw_flags2 &ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA ); +} +/** * ice_vsi_init - Create and initialize a VSI * @vsi: the VSI being configured
@@ -1684,6 +1698,27 @@ static void ice_vsi_set_rss_flow_fld(struct ice_vsi *vsi) vsi_num, status); } +/** +* ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length +* @vsi: VSI +*/ +static void ice_vsi_cfg_frame_size (struct ice_vsi *vsi) +{ +if (!vsi->netdev ||test_bit (ICE_FLAG_LEGACY_RX , vsi->back->flags)) { + vsi->max_frame =ICE_MAX_FRAME_LEGACY_RX ; + vsi->rx_buf_len =ICE_RXBUF_1664 ; +#if (PAGE_SIZE <8192 ) + } else if (!ICE_2K_TOO_SMALL_WITH_PADDING && + (vsi->netdev->mtu <=ETH_DATA_LEN )) { + vsi->max_frame =ICE_RXBUF_1536 -NET_IP_ALIGN ; + vsi->rx_buf_len =ICE_RXBUF_1536 -NET_IP_ALIGN ; +#endif + }else { + vsi->max_frame =ICE_AQ_SET_MAC_FRAME_SIZE_MAX ; + vsi->rx_buf_len =ICE_RXBUF_3072 ; + } +} +/** * ice_pf_state_is_nominal - checks the PF for nominal state * @pf: pointer to PF to check
@@ -1758,27 +1793,6 @@ void ice_update_eth_stats(struct ice_vsi *vsi) vsi->stat_offsets_loaded = true; } -/** -* ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length -* @vsi: VSI -*/ -void ice_vsi_cfg_frame_size (struct ice_vsi *vsi) -{ -if (!vsi->netdev ||test_bit (ICE_FLAG_LEGACY_RX , vsi->back->flags)) { - vsi->max_frame =ICE_MAX_FRAME_LEGACY_RX ; - vsi->rx_buf_len =ICE_RXBUF_1664 ; -#if (PAGE_SIZE <8192 ) - } else if (!ICE_2K_TOO_SMALL_WITH_PADDING && - (vsi->netdev->mtu <=ETH_DATA_LEN )) { - vsi->max_frame =ICE_RXBUF_1536 -NET_IP_ALIGN ; - vsi->rx_buf_len =ICE_RXBUF_1536 -NET_IP_ALIGN ; -#endif - }else { - vsi->max_frame =ICE_AQ_SET_MAC_FRAME_SIZE_MAX ; - vsi->rx_buf_len =ICE_RXBUF_3072 ; - } -} -/** * ice_write_qrxflxp_cntxt - write/configure QRXFLXP_CNTXT register * @hw: HW pointer
@@ -2185,20 +2199,6 @@ bool ice_vsi_is_rx_queue_active(struct ice_vsi *vsi)return false; } -/** -* ice_vsi_is_vlan_pruning_ena - check if VLAN pruning is enabled or not -* @vsi: VSI to check whether or not VLAN pruning is enabled. -* -* returns true if Rx VLAN pruning is enabled and false otherwise. -*/ -bool ice_vsi_is_vlan_pruning_ena (struct ice_vsi *vsi) -{ -if (!vsi) -return false; - -return (vsi->info.sw_flags2 &ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA ); -} -static void ice_vsi_set_tc_cfg (struct ice_vsi *vsi) {if (!test_bit (ICE_FLAG_DCB_ENA , vsi->back->flags)) {
drivers/net/ethernet/intel/ice/ice_lib.h +0 -3
@@ -76,8 +76,6 @@ int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi);int ice_vsi_stop_xdp_tx_rings (struct ice_vsi *vsi); -bool ice_vsi_is_vlan_pruning_ena (struct ice_vsi *vsi); -void ice_cfg_sw_lldp (struct ice_vsi *vsi,bool tx,bool create);int ice_set_link (struct ice_vsi *vsi,bool ena);
@@ -128,7 +126,6 @@ void ice_update_tx_ring_stats(struct ice_tx_ring *ring, u64 pkts, u64 bytes);void ice_update_rx_ring_stats (struct ice_rx_ring *ring,u64 pkts,u64 bytes); -void ice_vsi_cfg_frame_size (struct ice_vsi *vsi);void ice_write_intrl (struct ice_q_vector *q_vector,u8 intrl);void ice_write_itr (struct ice_ring_container *rc,u16 itr);void ice_set_q_vector_intrl (struct ice_q_vector *q_vector);
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v3 4/7 ice: refactor ice_vf_lib to make functions static
In reply to Jan SokolowskiAs following methods are not used outside ice_vf_lib, they can be made static:ice_vf_rebuild_host_vlan_cfg ice_vf_rebuild_host_tx_rate_cfg ice_vf_set_host_trust_cfg ice_vf_rebuild_host_mac_cfg ice_vf_rebuild_aggregator_node_cfg ice_vf_rebuild_host_cfg ice_set_vf_state_qs_dis ice_vf_set_initialized
In order to achieve that, the order in which these were defined was reorganized.
--- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 468 +++++++++--------- .../ethernet/intel/ice/ice_vf_lib_private.h | 2 - 2 files changed, 234 insertions(+), 236 deletions(-)
drivers/net/ethernet/intel/ice/ice_vf_lib.c +234 -234
@@ -322,6 +322,240 @@ static int ice_vf_rebuild_vsi(struct ice_vf *vf)return 0 ; } +/** +* ice_vf_rebuild_host_vlan_cfg - add VLAN 0 filter or rebuild the Port VLAN +* @vf: VF to add MAC filters for +* @vsi: Pointer to VSI +* +* Called after a VF VSI has been re-added/rebuilt during reset. The PF driver +* always re-adds either a VLAN 0 or port VLAN based filter after reset. +*/ +static int ice_vf_rebuild_host_vlan_cfg (struct ice_vf *vf,struct ice_vsi *vsi) +{ +struct ice_vsi_vlan_ops *vlan_ops =ice_get_compat_vsi_vlan_ops (vsi); +struct device *dev =ice_pf_to_dev (vf->pf); +int err; + +if (ice_vf_is_port_vlan_ena (vf)) { + err = vlan_ops->set_port_vlan (vsi, &vf->port_vlan_info); +if (err) { +dev_err (dev,"failed to configure port VLAN via VSI parameters for VF %u, error %d\n" , + vf->vf_id, err); +return err; + } + + err = vlan_ops->add_vlan (vsi, &vf->port_vlan_info); + }else { + err =ice_vsi_add_vlan_zero (vsi); + } + +if (err) { +dev_err (dev,"failed to add VLAN %u filter for VF %u during VF rebuild, error %d\n" , +ice_vf_is_port_vlan_ena (vf) ? +ice_vf_get_port_vlan_id (vf) :0 , vf->vf_id, err); +return err; + } + + err = vlan_ops->ena_rx_filtering (vsi); +if (err) +dev_warn (dev,"failed to enable Rx VLAN filtering for VF %d VSI %d during VF rebuild, error %d\n" , + vf->vf_id, vsi->idx, err); + +return 0 ; +} + +/** +* ice_vf_rebuild_host_tx_rate_cfg - re-apply the Tx rate limiting configuration +* @vf: VF to re-apply the configuration for +* +* Called after a VF VSI has been re-added/rebuild during reset. The PF driver +* needs to re-apply the host configured Tx rate limiting configuration. +*/ +static int ice_vf_rebuild_host_tx_rate_cfg (struct ice_vf *vf) +{ +struct device *dev =ice_pf_to_dev (vf->pf); +struct ice_vsi *vsi =ice_get_vf_vsi (vf); +int err; + +if (WARN_ON (!vsi)) +return -EINVAL ; + +if (vf->min_tx_rate) { + err =ice_set_min_bw_limit (vsi, (u64 )vf->min_tx_rate *1000 ); +if (err) { +dev_err (dev,"failed to set min Tx rate to %d Mbps for VF %u, error %d\n" , + vf->min_tx_rate, vf->vf_id, err); +return err; + } + } + +if (vf->max_tx_rate) { + err =ice_set_max_bw_limit (vsi, (u64 )vf->max_tx_rate *1000 ); +if (err) { +dev_err (dev,"failed to set max Tx rate to %d Mbps for VF %u, error %d\n" , + vf->max_tx_rate, vf->vf_id, err); +return err; + } + } + +return 0 ; +} + +/** +* ice_vf_set_host_trust_cfg - set trust setting based on pre-reset value +* @vf: VF to configure trust setting for +*/ +static void ice_vf_set_host_trust_cfg (struct ice_vf *vf) +{ +if (vf->trusted) +set_bit (ICE_VIRTCHNL_VF_CAP_PRIVILEGE , &vf->vf_caps); +else +clear_bit (ICE_VIRTCHNL_VF_CAP_PRIVILEGE , &vf->vf_caps); +} + +/** +* ice_vf_rebuild_host_mac_cfg - add broadcast and the VF's perm_addr/LAA +* @vf: VF to add MAC filters for +* +* Called after a VF VSI has been re-added/rebuilt during reset. The PF driver +* always re-adds a broadcast filter and the VF's perm_addr/LAA after reset. +*/ +static int ice_vf_rebuild_host_mac_cfg (struct ice_vf *vf) +{ +struct device *dev =ice_pf_to_dev (vf->pf); +struct ice_vsi *vsi =ice_get_vf_vsi (vf); +u8 broadcast[ETH_ALEN ]; +int status; + +if (WARN_ON (!vsi)) +return -EINVAL ; + +if (ice_is_eswitch_mode_switchdev (vf->pf)) +return 0 ; + +eth_broadcast_addr (broadcast); + status =ice_fltr_add_mac (vsi, broadcast,ICE_FWD_TO_VSI ); +if (status) { +dev_err (dev,"failed to add broadcast MAC filter for VF %u, error %d\n" , + vf->vf_id, status); +return status; + } + + vf->num_mac++; + +if (is_valid_ether_addr (vf->hw_lan_addr)) { + status =ice_fltr_add_mac (vsi, vf->hw_lan_addr, +ICE_FWD_TO_VSI ); +if (status) { +dev_err (dev,"failed to add default unicast MAC filter %pM for VF %u, error %d\n" , + &vf->hw_lan_addr[0 ], vf->vf_id, + status); +return status; + } + vf->num_mac++; + +ether_addr_copy (vf->dev_lan_addr, vf->hw_lan_addr); + } + +return 0 ; +} + +/** +* ice_vf_rebuild_aggregator_node_cfg - rebuild aggregator node config +* @vsi: Pointer to VSI +* +* This function moves VSI into corresponding scheduler aggregator node +* based on cached value of "aggregator node info" per VSI +*/ +static void ice_vf_rebuild_aggregator_node_cfg (struct ice_vsi *vsi) +{ +struct ice_pf *pf = vsi->back; +struct device *dev; +int status; + +if (!vsi->agg_node) +return ; + + dev =ice_pf_to_dev (pf); +if (vsi->agg_node->num_vsis ==ICE_MAX_VSIS_IN_AGG_NODE ) { +dev_dbg (dev, +"agg_id %u already has reached max_num_vsis %u\n" , + vsi->agg_node->agg_id, vsi->agg_node->num_vsis); +return ; + } + + status =ice_move_vsi_to_agg (pf->hw.port_info, vsi->agg_node->agg_id, + vsi->idx, vsi->tc_cfg.ena_tc); +if (status) +dev_dbg (dev,"unable to move VSI idx %u into aggregator %u node" , + vsi->idx, vsi->agg_node->agg_id); +else + vsi->agg_node->num_vsis++; +} + +/** +* ice_vf_rebuild_host_cfg - host admin configuration is persistent across reset +* @vf: VF to rebuild host configuration on +*/ +static void ice_vf_rebuild_host_cfg (struct ice_vf *vf) +{ +struct device *dev =ice_pf_to_dev (vf->pf); +struct ice_vsi *vsi =ice_get_vf_vsi (vf); + +if (WARN_ON (!vsi)) +return ; + +ice_vf_set_host_trust_cfg (vf); + +if (ice_vf_rebuild_host_mac_cfg (vf)) +dev_err (dev,"failed to rebuild default MAC configuration for VF %d\n" , + vf->vf_id); + +if (ice_vf_rebuild_host_vlan_cfg (vf, vsi)) +dev_err (dev,"failed to rebuild VLAN configuration for VF %u\n" , + vf->vf_id); + +if (ice_vf_rebuild_host_tx_rate_cfg (vf)) +dev_err (dev,"failed to rebuild Tx rate limiting configuration for VF %u\n" , + vf->vf_id); + +if (ice_vsi_apply_spoofchk (vsi, vf->spoofchk)) +dev_err (dev,"failed to rebuild spoofchk configuration for VF %d\n" , + vf->vf_id); + +/* rebuild aggregator node config for main VF VSI */ +ice_vf_rebuild_aggregator_node_cfg (vsi); +} + +/** +* ice_set_vf_state_qs_dis - Set VF queues state to disabled +* @vf: pointer to the VF structure +*/ +static void ice_set_vf_state_qs_dis (struct ice_vf *vf) +{ +/* Clear Rx/Tx enabled queues flag */ +bitmap_zero (vf->txq_ena,ICE_MAX_RSS_QS_PER_VF ); +bitmap_zero (vf->rxq_ena,ICE_MAX_RSS_QS_PER_VF ); +clear_bit (ICE_VF_STATE_QS_ENA , vf->vf_states); +} + +/** +* ice_vf_set_initialized - VF is ready for VIRTCHNL communication +* @vf: VF to set in initialized state +* +* After this function the VF will be ready to receive/handle the +* VIRTCHNL_OP_GET_VF_RESOURCES message +*/ +static void ice_vf_set_initialized (struct ice_vf *vf) +{ +ice_set_vf_state_qs_dis (vf); +clear_bit (ICE_VF_STATE_MC_PROMISC , vf->vf_states); +clear_bit (ICE_VF_STATE_UC_PROMISC , vf->vf_states); +clear_bit (ICE_VF_STATE_DIS , vf->vf_states); +set_bit (ICE_VF_STATE_INIT , vf->vf_states); +memset (&vf->vlan_v2_caps,0 ,sizeof (vf->vlan_v2_caps)); +} +/** * ice_vf_post_vsi_rebuild - Reset tasks that occur after VSI rebuild * @vf: the VF being reset
@@ -725,18 +959,6 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)return err; } -/** -* ice_set_vf_state_qs_dis - Set VF queues state to disabled -* @vf: pointer to the VF structure -*/ -static void ice_set_vf_state_qs_dis (struct ice_vf *vf) -{ -/* Clear Rx/Tx enabled queues flag */ -bitmap_zero (vf->txq_ena,ICE_MAX_RSS_QS_PER_VF ); -bitmap_zero (vf->rxq_ena,ICE_MAX_RSS_QS_PER_VF ); -clear_bit (ICE_VF_STATE_QS_ENA , vf->vf_states); -} -/** * ice_set_vf_state_dis - Set VF state to disabled * @vf: pointer to the VF structure
@@ -977,211 +1199,6 @@ bool ice_is_vf_link_up(struct ice_vf *vf)ICE_AQ_LINK_UP ; } -/** -* ice_vf_set_host_trust_cfg - set trust setting based on pre-reset value -* @vf: VF to configure trust setting for -*/ -static void ice_vf_set_host_trust_cfg (struct ice_vf *vf) -{ -if (vf->trusted) -set_bit (ICE_VIRTCHNL_VF_CAP_PRIVILEGE , &vf->vf_caps); -else -clear_bit (ICE_VIRTCHNL_VF_CAP_PRIVILEGE , &vf->vf_caps); -} - -/** -* ice_vf_rebuild_host_mac_cfg - add broadcast and the VF's perm_addr/LAA -* @vf: VF to add MAC filters for -* -* Called after a VF VSI has been re-added/rebuilt during reset. The PF driver -* always re-adds a broadcast filter and the VF's perm_addr/LAA after reset. -*/ -static int ice_vf_rebuild_host_mac_cfg (struct ice_vf *vf) -{ -struct device *dev =ice_pf_to_dev (vf->pf); -struct ice_vsi *vsi =ice_get_vf_vsi (vf); -u8 broadcast[ETH_ALEN ]; -int status; - -if (WARN_ON (!vsi)) -return -EINVAL ; - -if (ice_is_eswitch_mode_switchdev (vf->pf)) -return 0 ; - -eth_broadcast_addr (broadcast); - status =ice_fltr_add_mac (vsi, broadcast,ICE_FWD_TO_VSI ); -if (status) { -dev_err (dev,"failed to add broadcast MAC filter for VF %u, error %d\n" , - vf->vf_id, status); -return status; - } - - vf->num_mac++; - -if (is_valid_ether_addr (vf->hw_lan_addr)) { - status =ice_fltr_add_mac (vsi, vf->hw_lan_addr, -ICE_FWD_TO_VSI ); -if (status) { -dev_err (dev,"failed to add default unicast MAC filter %pM for VF %u, error %d\n" , - &vf->hw_lan_addr[0 ], vf->vf_id, - status); -return status; - } - vf->num_mac++; - -ether_addr_copy (vf->dev_lan_addr, vf->hw_lan_addr); - } - -return 0 ; -} - -/** -* ice_vf_rebuild_host_vlan_cfg - add VLAN 0 filter or rebuild the Port VLAN -* @vf: VF to add MAC filters for -* @vsi: Pointer to VSI -* -* Called after a VF VSI has been re-added/rebuilt during reset. The PF driver -* always re-adds either a VLAN 0 or port VLAN based filter after reset. -*/ -static int ice_vf_rebuild_host_vlan_cfg (struct ice_vf *vf,struct ice_vsi *vsi) -{ -struct ice_vsi_vlan_ops *vlan_ops =ice_get_compat_vsi_vlan_ops (vsi); -struct device *dev =ice_pf_to_dev (vf->pf); -int err; - -if (ice_vf_is_port_vlan_ena (vf)) { - err = vlan_ops->set_port_vlan (vsi, &vf->port_vlan_info); -if (err) { -dev_err (dev,"failed to configure port VLAN via VSI parameters for VF %u, error %d\n" , - vf->vf_id, err); -return err; - } - - err = vlan_ops->add_vlan (vsi, &vf->port_vlan_info); - }else { - err =ice_vsi_add_vlan_zero (vsi); - } - -if (err) { -dev_err (dev,"failed to add VLAN %u filter for VF %u during VF rebuild, error %d\n" , -ice_vf_is_port_vlan_ena (vf) ? -ice_vf_get_port_vlan_id (vf) :0 , vf->vf_id, err); -return err; - } - - err = vlan_ops->ena_rx_filtering (vsi); -if (err) -dev_warn (dev,"failed to enable Rx VLAN filtering for VF %d VSI %d during VF rebuild, error %d\n" , - vf->vf_id, vsi->idx, err); - -return 0 ; -} - -/** -* ice_vf_rebuild_host_tx_rate_cfg - re-apply the Tx rate limiting configuration -* @vf: VF to re-apply the configuration for -* -* Called after a VF VSI has been re-added/rebuild during reset. The PF driver -* needs to re-apply the host configured Tx rate limiting configuration. -*/ -static int ice_vf_rebuild_host_tx_rate_cfg (struct ice_vf *vf) -{ -struct device *dev =ice_pf_to_dev (vf->pf); -struct ice_vsi *vsi =ice_get_vf_vsi (vf); -int err; - -if (WARN_ON (!vsi)) -return -EINVAL ; - -if (vf->min_tx_rate) { - err =ice_set_min_bw_limit (vsi, (u64 )vf->min_tx_rate *1000 ); -if (err) { -dev_err (dev,"failed to set min Tx rate to %d Mbps for VF %u, error %d\n" , - vf->min_tx_rate, vf->vf_id, err); -return err; - } - } - -if (vf->max_tx_rate) { - err =ice_set_max_bw_limit (vsi, (u64 )vf->max_tx_rate *1000 ); -if (err) { -dev_err (dev,"failed to set max Tx rate to %d Mbps for VF %u, error %d\n" , - vf->max_tx_rate, vf->vf_id, err); -return err; - } - } - -return 0 ; -} - -/** -* ice_vf_rebuild_aggregator_node_cfg - rebuild aggregator node config -* @vsi: Pointer to VSI -* -* This function moves VSI into corresponding scheduler aggregator node -* based on cached value of "aggregator node info" per VSI -*/ -static void ice_vf_rebuild_aggregator_node_cfg (struct ice_vsi *vsi) -{ -struct ice_pf *pf = vsi->back; -struct device *dev; -int status; - -if (!vsi->agg_node) -return ; - - dev =ice_pf_to_dev (pf); -if (vsi->agg_node->num_vsis ==ICE_MAX_VSIS_IN_AGG_NODE ) { -dev_dbg (dev, -"agg_id %u already has reached max_num_vsis %u\n" , - vsi->agg_node->agg_id, vsi->agg_node->num_vsis); -return ; - } - - status =ice_move_vsi_to_agg (pf->hw.port_info, vsi->agg_node->agg_id, - vsi->idx, vsi->tc_cfg.ena_tc); -if (status) -dev_dbg (dev,"unable to move VSI idx %u into aggregator %u node" , - vsi->idx, vsi->agg_node->agg_id); -else - vsi->agg_node->num_vsis++; -} - -/** -* ice_vf_rebuild_host_cfg - host admin configuration is persistent across reset -* @vf: VF to rebuild host configuration on -*/ -void ice_vf_rebuild_host_cfg (struct ice_vf *vf) -{ -struct device *dev =ice_pf_to_dev (vf->pf); -struct ice_vsi *vsi =ice_get_vf_vsi (vf); - -if (WARN_ON (!vsi)) -return ; - -ice_vf_set_host_trust_cfg (vf); - -if (ice_vf_rebuild_host_mac_cfg (vf)) -dev_err (dev,"failed to rebuild default MAC configuration for VF %d\n" , - vf->vf_id); - -if (ice_vf_rebuild_host_vlan_cfg (vf, vsi)) -dev_err (dev,"failed to rebuild VLAN configuration for VF %u\n" , - vf->vf_id); - -if (ice_vf_rebuild_host_tx_rate_cfg (vf)) -dev_err (dev,"failed to rebuild Tx rate limiting configuration for VF %u\n" , - vf->vf_id); - -if (ice_vsi_apply_spoofchk (vsi, vf->spoofchk)) -dev_err (dev,"failed to rebuild spoofchk configuration for VF %d\n" , - vf->vf_id); - -/* rebuild aggregator node config for main VF VSI */ -ice_vf_rebuild_aggregator_node_cfg (vsi); -} -/** * ice_vf_ctrl_invalidate_vsi - invalidate ctrl_vsi_idx to remove VSI access * @vf: VF that control VSI is being invalidated on
@@ -1310,23 +1327,6 @@ void ice_vf_vsi_release(struct ice_vf *vf)ice_vf_invalidate_vsi (vf); } -/** -* ice_vf_set_initialized - VF is ready for VIRTCHNL communication -* @vf: VF to set in initialized state -* -* After this function the VF will be ready to receive/handle the -* VIRTCHNL_OP_GET_VF_RESOURCES message -*/ -void ice_vf_set_initialized (struct ice_vf *vf) -{ -ice_set_vf_state_qs_dis (vf); -clear_bit (ICE_VF_STATE_MC_PROMISC , vf->vf_states); -clear_bit (ICE_VF_STATE_UC_PROMISC , vf->vf_states); -clear_bit (ICE_VF_STATE_DIS , vf->vf_states); -set_bit (ICE_VF_STATE_INIT , vf->vf_states); -memset (&vf->vlan_v2_caps,0 ,sizeof (vf->vlan_v2_caps)); -} -/** * ice_get_vf_ctrl_vsi - Get first VF control VSI pointer * @pf: the PF private structure
drivers/net/ethernet/intel/ice/ice_vf_lib_private.h +0 -2
@@ -32,13 +32,11 @@ int ice_vsi_apply_spoofchk(struct ice_vsi *vsi, bool enable);bool ice_is_vf_trusted (struct ice_vf *vf);bool ice_vf_has_no_qs_ena (struct ice_vf *vf);bool ice_is_vf_link_up (struct ice_vf *vf); -void ice_vf_rebuild_host_cfg (struct ice_vf *vf);void ice_vf_ctrl_invalidate_vsi (struct ice_vf *vf);void ice_vf_ctrl_vsi_release (struct ice_vf *vf);struct ice_vsi *ice_vf_ctrl_vsi_setup (struct ice_vf *vf);int ice_vf_init_host_cfg (struct ice_vf *vf,struct ice_vsi *vsi);void ice_vf_invalidate_vsi (struct ice_vf *vf);void ice_vf_vsi_release (struct ice_vf *vf); -void ice_vf_set_initialized (struct ice_vf *vf);#endif /* _ICE_VF_LIB_PRIVATE_H_ */
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v3 5/7 ice: refactor ice_sched to make functions static
In reply to Jan SokolowskiAs ice_sched_set_node_bw_lmt_per_tc is not used
outside of ice_sched, it can be made static.
--- drivers/net/ethernet/intel/ice/ice_sched.c | 2 +- drivers/net/ethernet/intel/ice/ice_sched.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice_sched.c +1 -1
@@ -3971,7 +3971,7 @@ ice_sched_get_node_by_id_type(struct ice_port_info *pi, u32 id,* This function sets BW limit of VSI or Aggregator scheduling node * based on TC information from passed in argument BW. */ -int +static int ice_sched_set_node_bw_lmt_per_tc (struct ice_port_info *pi,u32 id,enum ice_agg_type agg_type,u8 tc,enum ice_rl_type rl_type,u32 bw)
drivers/net/ethernet/intel/ice/ice_sched.h +0 -4
@@ -141,10 +141,6 @@ ice_cfg_vsi_bw_lmt_per_tc(struct ice_port_info *pi, u16 vsi_handle, u8 tc,int ice_cfg_vsi_bw_dflt_lmt_per_tc (struct ice_port_info *pi,u16 vsi_handle,u8 tc,enum ice_rl_type rl_type); -int -ice_sched_set_node_bw_lmt_per_tc (struct ice_port_info *pi,u32 id, -enum ice_agg_type agg_type,u8 tc, -enum ice_rl_type rl_type,u32 bw);int ice_cfg_rl_burst_size (struct ice_hw *hw,u32 bytes); int ice_sched_suspend_resume_elems(struct ice_hw *hw, u8 num_nodes, u32 *node_teids,
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v3 6/7 ice: refactor ice_ptp_hw to make functions static
In reply to Jan SokolowskiAs following methods are not used outside ice_ptp_hw, they can be made static:ice_read_phy_reg_e822ice_write_phy_reg_e822 ice_ptp_prep_port_adj_e822
--- drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 6 +++--- drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/ice/ice_ptp_hw.c +3 -3
@@ -295,7 +295,7 @@ static bool ice_is_40b_phy_reg_e822(u16 low_addr, u16 *high_addr)* * Read a PHY register for the given port over the device sideband queue. */ -int +static int ice_read_phy_reg_e822 (struct ice_hw *hw,u8 port,u16 offset,u32 *val) {struct ice_sbq_msg_input msg = {0 };
@@ -372,7 +372,7 @@ ice_read_64b_phy_reg_e822(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val)* * Write a PHY register for the given port over the device sideband queue. */ -int +static int ice_write_phy_reg_e822 (struct ice_hw *hw,u8 port,u16 offset,u32 val) {struct ice_sbq_msg_input msg = {0 };
@@ -1089,7 +1089,7 @@ ice_ptp_prep_phy_time_e822(struct ice_hw *hw, u32 time)* * Negative adjustments are supported using 2s complement arithmetic. */ -int +static int ice_ptp_prep_port_adj_e822 (struct ice_hw *hw,u8 port,s64 time) {u32 l_time, u_time;
drivers/net/ethernet/intel/ice/ice_ptp_hw.h +0 -3
@@ -144,11 +144,8 @@ int ice_ptp_init_phc(struct ice_hw *hw);int ice_get_phy_tx_tstamp_ready (struct ice_hw *hw,u8 block,u64 *tstamp_ready);/* E822 family functions */ -int ice_read_phy_reg_e822 (struct ice_hw *hw,u8 port,u16 offset,u32 *val); -int ice_write_phy_reg_e822 (struct ice_hw *hw,u8 port,u16 offset,u32 val);int ice_read_quad_reg_e822 (struct ice_hw *hw,u8 quad,u16 offset,u32 *val);int ice_write_quad_reg_e822 (struct ice_hw *hw,u8 quad,u16 offset,u32 val); -int ice_ptp_prep_port_adj_e822 (struct ice_hw *hw,u8 port,s64 time);void ice_ptp_reset_ts_memory_quad_e822 (struct ice_hw *hw,u8 quad);/**
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v3 7/7 ice: refactor ice_vsi_is_vlan_pruning_ena
In reply to Jan SokolowskiAs this method became static, and is already called with check for vsi being non-null, an unnecessary check along with superfluous parentheses is removed.
--- drivers/net/ethernet/intel/ice/ice_lib.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/intel/ice/ice_lib.c +1 -4
@@ -1235,10 +1235,7 @@ ice_chnl_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)*/ static bool ice_vsi_is_vlan_pruning_ena (struct ice_vsi *vsi) { -if (!vsi) -return false; - -return (vsi->info.sw_flags2 &ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA ); +return vsi->info.sw_flags2 &ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA ; }/**
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 10 lines · Jan Sokolowski
ice: refactor methods to make them static
This series of patches refactor some ice driver files in order to make as many methods as possible static. One additional patch introduced in v3 also refactors one method that can be simplified thanks to being static.
Also there's a minor cleanup of unused methods.
Quoted 9 lines
Jan Sokolowski (7):
ice: remove unused methods
ice: refactorice_ddpto make functions static
ice: refactorice_libto make functions static
ice: refactorice_vf_libto make functions static
ice: refactorice_schedto make functions static
ice: refactorice_ptp_hwto make functions static
ice: refactorice_vsi_is_vlan_pruning_ena
I read through this and it all seems reasonable. Some of the code in ice_vf_lib.c used to be called from other files but later refactors have since eliminated those calls.
Additionally the read PHY register functions in ice_ptp_hw.c also were previously called in other files but no longer.
Thanks for the cleanup.
Quoted 5 lines
drivers/net/ethernet/intel/ice/ice_ddp.c | 120 ++--- drivers/net/ethernet/intel/ice/ice_ddp.h | 10 - drivers/net/ethernet/intel/ice/ice_lib.c | 82 ++- drivers/net/ethernet/intel/ice/ice_lib.h | 5 - drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 25 +-
Quoted 9 lines
drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 4 - drivers/net/ethernet/intel/ice/ice_sched.c | 2 +- drivers/net/ethernet/intel/ice/ice_sched.h | 4 - drivers/net/ethernet/intel/ice/ice_switch.c | 48 -- drivers/net/ethernet/intel/ice/ice_switch.h | 1 - drivers/net/ethernet/intel/ice/ice_vf_lib.c | 468 +++++++++--------- .../ethernet/intel/ice/ice_vf_lib_private.h | 2 - 12 files changed, 331 insertions(+), 440 deletions(-)
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 19 lines · Jan Sokolowski
ice: refactor methods to make them static
This series of patches refactor some ice driver files in order to make as many methods as possible static. One additional patch introduced in v3 also refactors one method that can be simplified thanks to being static.
Also there's a minor cleanup of unused methods.
Jan Sokolowski (7):
ice: remove unused methods
ice: refactorice_ddpto make functions static
ice: refactorice_libto make functions static
ice: refactorice_vf_libto make functions static
ice: refactorice_schedto make functions static
ice: refactorice_ptp_hwto make functions static
ice: refactorice_vsi_is_vlan_pruning_ena
Quoted 14 lines
drivers/net/ethernet/intel/ice/ice_ddp.c | 120 ++--- drivers/net/ethernet/intel/ice/ice_ddp.h | 10 - drivers/net/ethernet/intel/ice/ice_lib.c | 82 ++- drivers/net/ethernet/intel/ice/ice_lib.h | 5 - drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 25 +- drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 4 - drivers/net/ethernet/intel/ice/ice_sched.c | 2 +- drivers/net/ethernet/intel/ice/ice_sched.h | 4 - drivers/net/ethernet/intel/ice/ice_switch.c | 48 -- drivers/net/ethernet/intel/ice/ice_switch.h | 1 - drivers/net/ethernet/intel/ice/ice_vf_lib.c | 468 +++++++++--------- .../ethernet/intel/ice/ice_vf_lib_private.h | 2 - 12 files changed, 331 insertions(+), 440 deletions(-)
Thank you for the effort on this series, including your willingness to make patches easier to read,
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan