i40e: Neatening and object size reductions
Subsystems (3)
cover i40e: Neatening and object size reductions
Just some potential cleanings...
Joe Perches (4):
i40e: Whitespace cleaning
i40e: Add and use pf_<level>
i40e: pf_<level> remove "%s: " ... __func__
i40e: Convert pf_<level> macros to functions
drivers/net/ethernet/intel/i40e/i40e.h | 149 +-- drivers/net/ethernet/intel/i40e/i40e_common.c | 20 +- drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 1133 ++++++++------------ drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 47 +- drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c | 24 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 652 +++++------ drivers/net/ethernet/intel/i40e/i40e_nvm.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_sysfs.c | 24 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 +- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 15 +- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 217 ++-- 11 files changed, 928 insertions(+), 1366 deletions(-)
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
PATCH 1/4 i40e: Whitespace cleaning
Mostly done via:
$ checkpatch --strict --fix -f drivers/net/ethernet/intel/i40e/*.[ch]
Removed externs from .h function prototypes Aligned multiline statements to open parenthesis Removed some blank lines before and after braces Added a set of braces
Used sizeof(*foo)
Moved logical continuations from start to end of line
--- drivers/net/ethernet/intel/i40e/i40e.h | 140 +++--- drivers/net/ethernet/intel/i40e/i40e_common.c | 20 +- drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 533 ++++++++++----------- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 19 +- drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c | 24 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 128 +++-- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_sysfs.c | 12 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 +- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 15 +- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 13 +- 11 files changed, 448 insertions(+), 469 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +68 -72
@@ -95,16 +95,16 @@#define prefetch (X )#endif -#define I40E_RX_DESC (R , i) \ - ((ring_is_16byte_desc_enabled(R)) \ - ? (union i40e_32byte_rx_desc *) \ - (&(((union i40e_16byte_rx_desc *)((R)->desc))[i])) \ - : (&(((union i40e_32byte_rx_desc *)((R)->desc))[i]))) -#define I40E_TX_DESC (R , i) \ +#define I40E_RX_DESC (R , i) \ + (((ring_is_16byte_desc_enabled(R)) \ + ? (union i40e_32byte_rx_desc *) \ + (&(((union i40e_16byte_rx_desc *)((R)->desc))[i])) \ + : (&(((union i40e_32byte_rx_desc *)((R)->desc))[i])))) +#define I40E_TX_DESC (R , i) \ (&(((struct i40e_tx_desc *)((R)->desc))[i])) -#define I40E_TX_CTXTDESC (R , i) \ +#define I40E_TX_CTXTDESC (R , i) \ (&(((struct i40e_tx_context_desc *)((R)->desc))[i])) -#define I40E_TX_FDIRDESC (R , i) \ +#define I40E_TX_FDIRDESC (R , i) \ (&(((struct i40e_filter_program_desc *)((R)->desc))[i]))/* default to trying for four seconds */
@@ -491,80 +491,76 @@ static inline bool i40e_rx_is_programming_status(u64 qw) }/* needed by i40e_ethtool.c */ -extern int i40e_up (struct i40e_vsi *vsi); -extern void i40e_down (struct i40e_vsi *vsi); +int i40e_up (struct i40e_vsi *vsi); +void i40e_down (struct i40e_vsi *vsi);extern const char i40e_driver_name[];extern const char i40e_driver_version_str[]; -extern void i40e_do_reset (struct i40e_pf *pf,u32 reset_flags); -extern void i40e_update_stats (struct i40e_vsi *vsi); -extern void i40e_update_eth_stats (struct i40e_vsi *vsi); -extern struct rtnl_link_stats64 *i40e_get_vsi_stats_struct (struct i40e_vsi *vsi); -extern s32 i40e_fetch_switch_configuration (struct i40e_pf *pf, -bool printconfig); +void i40e_do_reset (struct i40e_pf *pf,u32 reset_flags); +void i40e_update_stats (struct i40e_vsi *vsi); +void i40e_update_eth_stats (struct i40e_vsi *vsi); +struct rtnl_link_stats64 *i40e_get_vsi_stats_struct (struct i40e_vsi *vsi); +s32 i40e_fetch_switch_configuration (struct i40e_pf *pf,bool printconfig);/* needed by i40e_main.c */ -extern void i40e_add_fdir_filter (struct i40e_fdir_data fdir_data, -struct i40e_ring *tx_ring); -extern void i40e_add_remove_filter (struct i40e_fdir_data fdir_data, -struct i40e_ring *tx_ring); -extern void i40e_update_fdir_filter (struct i40e_fdir_data fdir_data, -struct i40e_ring *tx_ring); -extern i40e_status i40e_program_fdir_filter (struct i40e_fdir_data *fdir_data, -struct i40e_pf *pf,bool add); - -extern void i40e_set_ethtool_ops (struct net_device *netdev); -extern struct i40e_mac_filter *i40e_add_filter (struct i40e_vsi *vsi, -u8 *macaddr,s16 vlan, -bool is_vf,bool is_netdev); -extern void i40e_del_filter (struct i40e_vsi *vsi, -u8 *macaddr,s16 vlan, -bool is_vf,bool is_netdev); -extern i40e_status i40e_sync_vsi_filters (struct i40e_vsi *vsi); -extern i40e_status __i40e_sync_vsi_filters_locked (struct i40e_vsi *); -extern struct i40e_vsi *i40e_vsi_setup (struct i40e_pf *pf,u8 type, -u16 uplink,u32 param1); -extern s32 i40e_vsi_release (struct i40e_vsi *vsi); -extern struct i40e_vsi *i40e_vsi_lookup (struct i40e_pf *pf, -enum i40e_vsi_type type, -struct i40e_vsi *start_vsi); -extern struct i40e_veb *i40e_veb_setup (struct i40e_pf *pf,u16 flags, -u16 uplink_seid,u16 downlink_seid, -u8 enabled_tc); -extern s32 i40e_veb_release (struct i40e_veb *veb); - -extern i40e_status i40e_sys_add_vsi (struct i40e_vsi *vsi); -extern void i40e_sys_del_vsi (struct i40e_vsi *vsi); -extern i40e_status i40e_sys_add_veb (struct i40e_veb *veb); -extern void i40e_sys_del_veb (struct i40e_veb *veb); -extern i40e_status i40e_sys_init (struct i40e_pf *pf); -extern void i40e_sys_exit (struct i40e_pf *pf); -extern i40e_status i40e_vsi_add_pvid (struct i40e_vsi *vsi,u16 vid); -extern i40e_status i40e_vsi_remove_pvid (struct i40e_vsi *vsi); -extern void i40e_vsi_reset_stats (struct i40e_vsi *vsi); -extern void i40e_pf_reset_stats (struct i40e_pf *pf); +void i40e_add_fdir_filter (struct i40e_fdir_data fdir_data, +struct i40e_ring *tx_ring); +void i40e_add_remove_filter (struct i40e_fdir_data fdir_data, +struct i40e_ring *tx_ring); +void i40e_update_fdir_filter (struct i40e_fdir_data fdir_data, +struct i40e_ring *tx_ring); +i40e_status i40e_program_fdir_filter (struct i40e_fdir_data *fdir_data, +struct i40e_pf *pf,bool add); + +void i40e_set_ethtool_ops (struct net_device *netdev); +struct i40e_mac_filter *i40e_add_filter (struct i40e_vsi *vsi, +u8 *macaddr,s16 vlan, +bool is_vf,bool is_netdev); +void i40e_del_filter (struct i40e_vsi *vsi,u8 *macaddr,s16 vlan, +bool is_vf,bool is_netdev); +i40e_status i40e_sync_vsi_filters (struct i40e_vsi *vsi); +i40e_status __i40e_sync_vsi_filters_locked (struct i40e_vsi *); +struct i40e_vsi *i40e_vsi_setup (struct i40e_pf *pf,u8 type, +u16 uplink,u32 param1); +s32 i40e_vsi_release (struct i40e_vsi *vsi); +struct i40e_vsi *i40e_vsi_lookup (struct i40e_pf *pf, +enum i40e_vsi_type type, +struct i40e_vsi *start_vsi); +struct i40e_veb *i40e_veb_setup (struct i40e_pf *pf,u16 flags, +u16 uplink_seid,u16 downlink_seid, +u8 enabled_tc); +s32 i40e_veb_release (struct i40e_veb *veb); + +i40e_status i40e_sys_add_vsi (struct i40e_vsi *vsi); +void i40e_sys_del_vsi (struct i40e_vsi *vsi); +i40e_status i40e_sys_add_veb (struct i40e_veb *veb); +void i40e_sys_del_veb (struct i40e_veb *veb); +i40e_status i40e_sys_init (struct i40e_pf *pf); +void i40e_sys_exit (struct i40e_pf *pf); +i40e_status i40e_vsi_add_pvid (struct i40e_vsi *vsi,u16 vid); +i40e_status i40e_vsi_remove_pvid (struct i40e_vsi *vsi); +void i40e_vsi_reset_stats (struct i40e_vsi *vsi); +void i40e_pf_reset_stats (struct i40e_pf *pf);#ifdef CONFIG_DEBUG_FS -extern void i40e_dbg_pf_init (struct i40e_pf *pf); -extern void i40e_dbg_pf_exit (struct i40e_pf *pf); -extern void i40e_dbg_init (void ); -extern void i40e_dbg_exit (void ); +void i40e_dbg_pf_init (struct i40e_pf *pf); +void i40e_dbg_pf_exit (struct i40e_pf *pf); +void i40e_dbg_init (void ); +void i40e_dbg_exit (void );#else static inline void i40e_dbg_pf_init (struct i40e_pf *pf) {}static inline void i40e_dbg_pf_exit (struct i40e_pf *pf) {}static inline void i40e_dbg_init (void ) {}static inline void i40e_dbg_exit (void ) {}#endif /* CONFIG_DEBUG_FS*/ -extern void i40e_irq_dynamic_enable (struct i40e_vsi *vsi,int vector); -extern int i40e_ioctl (struct net_device *netdev,struct ifreq *ifr,int cmd); -extern void i40e_vlan_stripping_disable (struct i40e_vsi *vsi); -extern int i40e_vsi_add_vlan (struct i40e_vsi *vsi,s16 vid); -extern int i40e_vsi_kill_vlan (struct i40e_vsi *vsi,s16 vid); -extern i40e_status i40e_put_mac_in_vlan (struct i40e_vsi *vsi, -u8 *macaddr, -bool is_vf,bool is_netdev); -extern bool i40e_is_vsi_in_vlan (struct i40e_vsi *vsi); -extern struct i40e_mac_filter *i40e_find_mac (struct i40e_vsi *vsi, -u8 *macaddr, -bool is_vf,bool is_netdev); -extern void i40e_vlan_stripping_enable (struct i40e_vsi *vsi); +void i40e_irq_dynamic_enable (struct i40e_vsi *vsi,int vector); +int i40e_ioctl (struct net_device *netdev,struct ifreq *ifr,int cmd); +void i40e_vlan_stripping_disable (struct i40e_vsi *vsi); +int i40e_vsi_add_vlan (struct i40e_vsi *vsi,s16 vid); +int i40e_vsi_kill_vlan (struct i40e_vsi *vsi,s16 vid); +i40e_status i40e_put_mac_in_vlan (struct i40e_vsi *vsi,u8 *macaddr, +bool is_vf,bool is_netdev); +bool i40e_is_vsi_in_vlan (struct i40e_vsi *vsi); +struct i40e_mac_filter *i40e_find_mac (struct i40e_vsi *vsi,u8 *macaddr, +bool is_vf,bool is_netdev); +void i40e_vlan_stripping_enable (struct i40e_vsi *vsi);#endif /* _I40E_H_ */
drivers/net/ethernet/intel/i40e/i40e_common.c +11 -9
@@ -68,7 +68,7 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw) }hw_dbg (hw,"i40e_set_mac_type found mac: %d, returns: %d\n" , - hw->mac.type, status); + hw->mac.type, status);return status; }
@@ -564,7 +564,8 @@ aq_add_vsi_exit:* @cmd_details: pointer to command details structure or NULL **/ i40e_status i40e_aq_set_vsi_unicast_promiscuous (struct i40e_hw *hw, -u16 seid,bool set,struct i40e_asq_cmd_details *cmd_details) +u16 seid,bool set, +struct i40e_asq_cmd_details *cmd_details) {struct i40e_aq_desc desc; struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
@@ -573,7 +574,7 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,u16 flags =0 ;i40e_fill_default_direct_cmd_desc (&desc, - i40e_aqc_opc_set_vsi_promiscuous_modes); + i40e_aqc_opc_set_vsi_promiscuous_modes);if (set) flags |=I40E_AQC_SET_VSI_PROMISC_UNICAST ;
@@ -596,7 +597,8 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,* @cmd_details: pointer to command details structure or NULL **/ i40e_status i40e_aq_set_vsi_multicast_promiscuous (struct i40e_hw *hw, -u16 seid,bool set,struct i40e_asq_cmd_details *cmd_details) +u16 seid,bool set, +struct i40e_asq_cmd_details *cmd_details) {struct i40e_aq_desc desc; struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
@@ -605,7 +607,7 @@ i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,u16 flags =0 ;i40e_fill_default_direct_cmd_desc (&desc, - i40e_aqc_opc_set_vsi_promiscuous_modes); + i40e_aqc_opc_set_vsi_promiscuous_modes);if (set) flags |=I40E_AQC_SET_VSI_PROMISC_MULTICAST ;
@@ -639,7 +641,7 @@ i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,i40e_status status;i40e_fill_default_direct_cmd_desc (&desc, - i40e_aqc_opc_set_vsi_promiscuous_modes); + i40e_aqc_opc_set_vsi_promiscuous_modes);if (set_filter) cmd->promiscuous_flags
@@ -1191,7 +1193,7 @@ i40e_status i40e_aq_set_hmc_resource_profile(struct i40e_hw *hw,i40e_status status;i40e_fill_default_direct_cmd_desc (&desc, - i40e_aqc_opc_set_hmc_resource_profile); + i40e_aqc_opc_set_hmc_resource_profile); cmd->pm_profile = (u8 )profile; cmd->pe_vf_enabled = pe_vf_enabled_count;
@@ -1366,7 +1368,7 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,u32 i =0 ;u16 id; - cap = (struct i40e_aqc_list_capabilities_element_resp *) buff; + cap = (struct i40e_aqc_list_capabilities_element_resp *)buff;if (list_type_opc == i40e_aqc_opc_list_dev_capabilities) p = (struct i40e_hw_capabilities *)&hw->dev_caps;
@@ -1522,7 +1524,7 @@ i40e_status i40e_aq_discover_capabilities(struct i40e_hw *hw,i40e_status status =I40E_SUCCESS ;if (list_type_opc != i40e_aqc_opc_list_func_capabilities && - list_type_opc != i40e_aqc_opc_list_dev_capabilities) { + list_type_opc != i40e_aqc_opc_list_dev_capabilities) { status =I40E_ERR_PARAM ; goto exit; }
drivers/net/ethernet/intel/i40e/i40e_debugfs.c +266 -267
655 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +9 -10
@@ -322,7 +322,6 @@ static void i40e_get_regs(struct net_device *netdev, struct ethtool_regs *regs, reg_buf[ri++] =rd32 (hw, reg); } } - } static int i40e_get_eeprom(struct net_device *netdev,
@@ -652,7 +651,7 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,if (vsi == pf->vsi[pf->lan_vsi]) {for (i =0 ; i <I40E_GLOBAL_STATS_LEN ; i++) {snprintf (p,ETH_GSTRING_LEN ,"port.%s" , - i40e_gstrings_stats[i].stat_string); + i40e_gstrings_stats[i].stat_string); p +=ETH_GSTRING_LEN ; }for (i =0 ; i <I40E_MAX_USER_PRIORITY ; i++) {
@@ -1166,12 +1165,12 @@ static i40e_status i40e_add_del_fdir_udpv4(struct i40e_vsi *vsi,if (ret !=I40E_SUCCESS ) {dev_info (&pf->pdev->dev, -"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , +"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , __func__, fd_data->pctype, ret); err = true; }else {dev_info (&pf->pdev->dev, -"%s: Filter OK for PCTYPE %d (ret = %d)\n" , +"%s: Filter OK for PCTYPE %d (ret = %d)\n" , __func__, fd_data->pctype, ret); }
@@ -1212,7 +1211,7 @@ static i40e_status i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,if (ret !=I40E_SUCCESS ) {dev_info (&pf->pdev->dev, -"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , +"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , __func__, fd_data->pctype, ret); err = true; }else {
@@ -1227,12 +1226,12 @@ static i40e_status i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,if (ret !=I40E_SUCCESS ) {dev_info (&pf->pdev->dev, -"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , +"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , __func__, fd_data->pctype, ret); err = true; }else {dev_info (&pf->pdev->dev, -"%s: Filter OK for PCTYPE %d (ret = %d)\n" , +"%s: Filter OK for PCTYPE %d (ret = %d)\n" , __func__, fd_data->pctype, ret); }
@@ -1290,12 +1289,12 @@ static i40e_status i40e_add_del_fdir_ipv4(struct i40e_vsi *vsi,if (ret !=I40E_SUCCESS ) {dev_info (&pf->pdev->dev, -"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , +"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , __func__, fd_data->pctype, ret); err = true; }else {dev_info (&pf->pdev->dev, -"%s: Filter OK for PCTYPE %d (ret = %d)\n" , +"%s: Filter OK for PCTYPE %d (ret = %d)\n" , __func__, fd_data->pctype, ret); } }
@@ -1338,7 +1337,7 @@ static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi,if (!fd_data.raw_packet) {dev_info (&pf->pdev->dev, -"%s: Could not allocate memory\n" , __func__); +"%s: Could not allocate memory\n" , __func__);return -ENOMEM ; }
drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c +12 -12
@@ -136,7 +136,7 @@ i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,if (txq_num > obj->max_cnt) { ret_code =I40E_ERR_INVALID_HMC_OBJ_COUNT ;hw_dbg (hw,"i40e_init_lan_hmc: Tx context: asks for 0x%x but max allowed is 0x%x, returns error %d\n" , - txq_num, obj->max_cnt, ret_code); + txq_num, obj->max_cnt, ret_code); goto init_lan_hmc_out; }
@@ -159,7 +159,7 @@ i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,if (rxq_num > obj->max_cnt) { ret_code =I40E_ERR_INVALID_HMC_OBJ_COUNT ;hw_dbg (hw,"i40e_init_lan_hmc: Rx context: asks for 0x%x but max allowed is 0x%x, returns error %d\n" , - rxq_num, obj->max_cnt, ret_code); + rxq_num, obj->max_cnt, ret_code); goto init_lan_hmc_out; }
@@ -182,7 +182,7 @@ i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,if (fcoe_cntx_num > obj->max_cnt) { ret_code =I40E_ERR_INVALID_HMC_OBJ_COUNT ;hw_dbg (hw,"i40e_init_lan_hmc: FCoE context: asks for 0x%x but max allowed is 0x%x, returns error %d\n" , - fcoe_cntx_num, obj->max_cnt, ret_code); + fcoe_cntx_num, obj->max_cnt, ret_code); goto init_lan_hmc_out; }
@@ -205,7 +205,7 @@ i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,if (fcoe_filt_num > obj->max_cnt) { ret_code =I40E_ERR_INVALID_HMC_OBJ_COUNT ;hw_dbg (hw,"i40e_init_lan_hmc: FCoE filter: asks for 0x%x but max allowed is 0x%x, returns error %d\n" , - fcoe_filt_num, obj->max_cnt, ret_code); + fcoe_filt_num, obj->max_cnt, ret_code); goto init_lan_hmc_out; }
@@ -330,14 +330,14 @@ static i40e_status i40e_create_lan_hmc_object(struct i40e_hw *hw,if (info->start_idx >= info->hmc_info->hmc_obj[info->rsrc_type].cnt) { ret_code =I40E_ERR_INVALID_HMC_OBJ_INDEX ;hw_dbg (hw,"i40e_create_lan_hmc_object: returns error %d\n" , - ret_code); + ret_code); goto exit; }if ((info->start_idx + info->count) > info->hmc_info->hmc_obj[info->rsrc_type].cnt) { ret_code =I40E_ERR_INVALID_HMC_OBJ_COUNT ;hw_dbg (hw,"i40e_create_lan_hmc_object: returns error %d\n" , - ret_code); + ret_code); goto exit; }
@@ -408,7 +408,7 @@ static i40e_status i40e_create_lan_hmc_object(struct i40e_hw *hw,switch (sd_entry->entry_type) {case I40E_SD_TYPE_PAGED :I40E_SET_PF_SD_ENTRY (hw, - sd_entry->u.pd_table.pd_page_addr.pa, + sd_entry->u.pd_table.pd_page_addr.pa, j, sd_entry->entry_type);break ;case I40E_SD_TYPE_DIRECT :
@@ -506,7 +506,7 @@ try_type_paged:/* unsupported type */ ret_code =I40E_ERR_INVALID_SD_TYPE ;hw_dbg (hw,"i40e_configure_lan_hmc: Unknown SD type: %d\n" , - ret_code); + ret_code); goto configure_lan_hmc_out;break ; }
@@ -528,7 +528,7 @@ try_type_paged:/* FCoE contexts */ obj = &hw->hmc.hmc_obj[I40E_HMC_FCOE_CTX ];wr32 (hw,I40E_GLHMC_FCOEDDPBASE (hmc_fn_id), - (u32)((obj->base &I40E_GLHMC_FCOEDDPBASE_FPMFCOEDDPBASE_MASK ) /512 )); + (u32)((obj->base &I40E_GLHMC_FCOEDDPBASE_FPMFCOEDDPBASE_MASK ) /512 ));wr32 (hw,I40E_GLHMC_FCOEDDPCNT (hmc_fn_id), obj->cnt);/* FCoE filters */
@@ -590,7 +590,7 @@ static i40e_status i40e_delete_lan_hmc_object(struct i40e_hw *hw,if (info->start_idx >= info->hmc_info->hmc_obj[info->rsrc_type].cnt) { ret_code =I40E_ERR_INVALID_HMC_OBJ_INDEX ;hw_dbg (hw,"i40e_delete_hmc_object: returns error %d\n" , - ret_code); + ret_code); goto exit; }
@@ -598,7 +598,7 @@ static i40e_status i40e_delete_lan_hmc_object(struct i40e_hw *hw, info->hmc_info->hmc_obj[info->rsrc_type].cnt) { ret_code =I40E_ERR_INVALID_HMC_OBJ_COUNT ;hw_dbg (hw,"i40e_delete_hmc_object: returns error %d\n" , - ret_code); + ret_code); goto exit; }
@@ -895,7 +895,7 @@ i40e_status i40e_hmc_get_object_va(struct i40e_hmc_info *hmc_info, }if (obj_idx >= hmc_info->hmc_obj[rsrc_type].cnt) {hw_dbg (hw,"i40e_hmc_get_object_va: returns error %d\n" , - ret_code); + ret_code); ret_code =I40E_ERR_INVALID_HMC_OBJ_INDEX ; goto exit; }
drivers/net/ethernet/intel/i40e/i40e_main.c +58 -70
427 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_nvm.c +2 -2
@@ -120,7 +120,7 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw, hw->nvm.hw_semaphore_wait =I40E_MS_TO_GTIME (time) + gtime;hw_dbg (hw,"NVM acquire timed out, wait %llu ms before trying again.\n" , - time); + time); } }
@@ -204,7 +204,7 @@ static i40e_status i40e_read_nvm_srctl(struct i40e_hw *hw, u16 offset, }if (ret_code !=I40E_SUCCESS )hw_dbg (hw,"NVM read error: Couldn't access Shadow RAM address: 0x%x\n" , - offset); + offset); read_nvm_exit:return ret_code;
drivers/net/ethernet/intel/i40e/i40e_sysfs.c +6 -6
@@ -396,10 +396,10 @@ static struct attribute_group i40e_sys_veb_attr_group = {/* hw-switch attributes */ static struct kobj_attribute i40e_sys_hw_switch_hash_ptypes_attr =__ATTR (hash_ptypes,0644 , i40e_sys_hw_switch_hash_ptypes_read, - i40e_sys_hw_switch_hash_ptypes_write); + i40e_sys_hw_switch_hash_ptypes_write);static struct kobj_attribute i40e_sys_hw_switch_hash_type_attr =__ATTR (hash_type,S_IWUSR |S_IRUGO , i40e_sys_hw_switch_hash_type_read, - i40e_sys_hw_switch_hash_type_write); + i40e_sys_hw_switch_hash_type_write);static struct attribute *i40e_sys_hw_switch_attrs[] = { &i40e_sys_hw_switch_hash_ptypes_attr.attr,
@@ -440,8 +440,8 @@ i40e_status i40e_sys_add_vsi(struct i40e_vsi *vsi) }else {/* find the parent kobj */ for (parent_veb =0 ; parent_veb <I40E_MAX_VEB ; parent_veb++) { -if (pf->veb[parent_veb] - && pf->veb[parent_veb]->seid == vsi->uplink_seid) +if (pf->veb[parent_veb] && + pf->veb[parent_veb]->seid == vsi->uplink_seid)break ; } if ((parent_veb == I40E_MAX_VEB) ||
@@ -512,8 +512,8 @@ i40e_status i40e_sys_add_veb(struct i40e_veb *veb) kobj = pf->switch_kobj; }else {for (parent_veb =0 ; parent_veb <I40E_MAX_VEB ; parent_veb++) { -if (pf->veb[parent_veb] - && pf->veb[parent_veb]->seid == veb->uplink_seid) +if (pf->veb[parent_veb] && + pf->veb[parent_veb]->seid == veb->uplink_seid)break ; } if ((parent_veb != I40E_MAX_VEB) &&
drivers/net/ethernet/intel/i40e/i40e_txrx.c +3 -6
@@ -301,7 +301,7 @@ static bool i40e_check_tx_hang(struct i40e_ring *tx_ring)* pending but without time to complete it yet. */ if ((tx_ring->tx_stats.tx_done_old == tx_ring->tx_stats.packets) && - tx_pending) { + tx_pending) {/* make sure it is true for two checks in a row */ ret =test_and_set_bit (__I40E_HANG_CHECK_ARMED, &tx_ring->state);
@@ -406,7 +406,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)netif_stop_subqueue (tx_ring->netdev, tx_ring->queue_index);dev_info (tx_ring->dev, -"tx hang detected on queue %d, resetting adapter\n" , +"tx hang detected on queue %d, resetting adapter\n" , tx_ring->queue_index); tx_ring->netdev->netdev_ops->ndo_tx_timeout (tx_ring->netdev);
@@ -962,7 +962,6 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)/* Get the rest of the data if this was a header split */ if (ring_is_ps_enabled (rx_ring) && rx_packet_len) { - skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags, rx_bi->page, rx_bi->page_offset,
@@ -1103,7 +1102,7 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)if (!test_bit (__I40E_DOWN, &vsi->state)) {if (vsi->back->flags &I40E_FLAG_MSIX_ENABLED ) {i40e_irq_dynamic_enable (vsi, - q_vector->v_idx + vsi->base_vector); + q_vector->v_idx + vsi->base_vector); }else {struct i40e_hw *hw = &vsi->back->hw;/* We re-enable the queue 0 cause, but
@@ -1337,7 +1336,6 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb, tcph->check = ~csum_tcpudp_magic (iph->saddr, iph->daddr,0 ,IPPROTO_TCP ,0 ); }else if (skb_is_gso_v6 (skb)) { - ipv6h = skb->encapsulation ?inner_ipv6_hdr (skb) :ipv6_hdr (skb); tcph = skb->encapsulation ?inner_tcp_hdr (skb) :tcp_hdr (skb);
@@ -1388,7 +1386,6 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 tx_flags, this_tcp_hdrlen =inner_tcp_hdrlen (skb);if (tx_flags &I40E_TX_FLAGS_IPV4 ) { -if (tx_flags &I40E_TX_FLAGS_TSO ) { *cd_tunneling |=I40E_TX_CTX_EXT_IP_IPV4 ;ip_hdr (skb)->check =0 ;
drivers/net/ethernet/intel/i40e/i40e_txrx.h +7 -8
@@ -247,13 +247,12 @@ struct i40e_ring_container {u16 itr; }; -extern void i40e_alloc_rx_buffers (struct i40e_ring *rxr,u16 cleaned_count); -extern netdev_tx_t i40e_lan_xmit_frame (struct sk_buff *skb, -struct net_device *netdev); +void i40e_alloc_rx_buffers (struct i40e_ring *rxr,u16 cleaned_count); +netdev_tx_t i40e_lan_xmit_frame (struct sk_buff *skb,struct net_device *netdev);void i40e_clean_tx_ring (struct i40e_ring *tx_ring);void i40e_clean_rx_ring (struct i40e_ring *rx_ring); -extern int i40e_setup_tx_descriptors (struct i40e_ring *tx_ring); -extern int i40e_setup_rx_descriptors (struct i40e_ring *rx_ring); -extern void i40e_free_tx_resources (struct i40e_ring *tx_ring); -extern void i40e_free_rx_resources (struct i40e_ring *rx_ring); -extern int i40e_napi_poll (struct napi_struct *napi,int budget); +int i40e_setup_tx_descriptors (struct i40e_ring *tx_ring); +int i40e_setup_rx_descriptors (struct i40e_ring *rx_ring); +void i40e_free_tx_resources (struct i40e_ring *tx_ring); +void i40e_free_rx_resources (struct i40e_ring *rx_ring); +int i40e_napi_poll (struct napi_struct *napi,int budget);
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +6 -7
@@ -884,9 +884,9 @@ i40e_status i40e_free_vfs(struct i40e_pf *pf)/* Re-enable interrupt 0. */ wr32 (hw,I40E_PFINT_DYN_CTL0 , -I40E_PFINT_DYN_CTL0_INTENA_MASK | -I40E_PFINT_DYN_CTL0_CLEARPBA_MASK | - (I40E_ITR_NONE <<I40E_PFINT_DYN_CTL0_ITR_INDX_SHIFT )); +I40E_PFINT_DYN_CTL0_INTENA_MASK | +I40E_PFINT_DYN_CTL0_CLEARPBA_MASK | + (I40E_ITR_NONE <<I40E_PFINT_DYN_CTL0_ITR_INDX_SHIFT ));i40e_flush (hw);return ret; }
@@ -1150,7 +1150,7 @@ static i40e_status i40e_vc_get_vf_resources_msg(struct i40e_vf *vf) err:/* send the response back to the vf */ ret =i40e_vc_send_msg_to_vf (vf,I40E_VIRTCHNL_OP_GET_VF_RESOURCES , - ret, (u8 *) vfres, len); + ret, (u8 *)vfres, len);kfree (vfres);return ret;
@@ -1832,8 +1832,8 @@ static i40e_status i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg, ret =i40e_vsi_kill_vlan (vsi, vfl->vlan_id[i]);if (I40E_SUCCESS != ret)dev_err (&pf->pdev->dev, -"%s: Unable to delete vlan filter %d, error %d\n" , - __func__, vfl->vlan_id[i], ret); +"%s: Unable to delete vlan filter %d, error %d\n" , + __func__, vfl->vlan_id[i], ret); } error_param:
@@ -2108,7 +2108,6 @@ i40e_status i40e_vc_process_vflr_event(struct i40e_pf *pf) ret =i40e_enable_vf_mappings (vf); } - }/* re-enable vflr interrupt cause */
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
PATCH 2/4 i40e: Add and use pf_<level>
In reply to Joe PerchesConvert dev_<level>(&pf->pdev->dev to a macro to simplify and possibly reduce the size of logging messages.
--- drivers/net/ethernet/intel/i40e/i40e.h | 9 + drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 1510 +++++++++----------- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 40 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 585 ++++---- drivers/net/ethernet/intel/i40e/i40e_sysfs.c | 13 +- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 215 ++- 6 files changed, 998 insertions(+), 1374 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +9 -0
@@ -563,4 +563,13 @@ struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr, bool is_vf, bool is_netdev);void i40e_vlan_stripping_enable (struct i40e_vsi *vsi); +/* i40e_pf message logging */ + +#define pf_err (pf, fmt, ...) \ + dev_err(&(pf)->pdev->dev, fmt, ##__VA_ARGS__) +#define pf_warn (pf, fmt, ...) \ + dev_warn(&(pf)->pdev->dev, fmt, ##__VA_ARGS__) +#define pf_info (pf, fmt, ...) \ + dev_info(&(pf)->pdev->dev, fmt, ##__VA_ARGS__) +#endif /* _I40E_H_ */
drivers/net/ethernet/intel/i40e/i40e_debugfs.c +642 -868
2,098 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +15 -25
@@ -1164,15 +1164,12 @@ static i40e_status i40e_add_del_fdir_udpv4(struct i40e_vsi *vsi, ret =i40e_program_fdir_filter (fd_data, pf, add);if (ret !=I40E_SUCCESS ) { -dev_info (&pf->pdev->dev, -"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , +pf_info (pf,"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , __func__, fd_data->pctype, ret); err = true; }else { -dev_info (&pf->pdev->dev, -"%s: Filter OK for PCTYPE %d (ret = %d)\n" , - __func__, - fd_data->pctype, ret); +pf_info (pf,"%s: Filter OK for PCTYPE %d (ret = %d)\n" , + __func__, fd_data->pctype, ret); } }
@@ -1210,13 +1207,12 @@ static i40e_status i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi, ret =i40e_program_fdir_filter (fd_data, pf, add);if (ret !=I40E_SUCCESS ) { -dev_info (&pf->pdev->dev, -"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , + __func__, fd_data->pctype, ret); err = true; }else { -dev_info (&pf->pdev->dev,"%s: Filter OK for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"%s: Filter OK for PCTYPE %d (ret = %d)\n" , + __func__, fd_data->pctype, ret); } ip->saddr = fsp->h_u.tcp_ip4_spec.ip4src;
@@ -1225,14 +1221,12 @@ static i40e_status i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi, fd_data->pctype =I40E_FILTER_PCTYPE_NONF_IPV4_TCP ;if (ret !=I40E_SUCCESS ) { -dev_info (&pf->pdev->dev, -"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , +pf_info (pf,"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , __func__, fd_data->pctype, ret); err = true; }else { -dev_info (&pf->pdev->dev, -"%s: Filter OK for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"%s: Filter OK for PCTYPE %d (ret = %d)\n" , + __func__, fd_data->pctype, ret); }return err ? -EOPNOTSUPP :I40E_SUCCESS ;
@@ -1288,14 +1282,12 @@ static i40e_status i40e_add_del_fdir_ipv4(struct i40e_vsi *vsi, ret =i40e_program_fdir_filter (fd_data, pf, add);if (ret !=I40E_SUCCESS ) { -dev_info (&pf->pdev->dev, -"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , +pf_info (pf,"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , __func__, fd_data->pctype, ret); err = true; }else { -dev_info (&pf->pdev->dev, -"%s: Filter OK for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"%s: Filter OK for PCTYPE %d (ret = %d)\n" , + __func__, fd_data->pctype, ret); } }
@@ -1336,8 +1328,7 @@ static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi, GFP_KERNEL);if (!fd_data.raw_packet) { -dev_info (&pf->pdev->dev, -"%s: Could not allocate memory\n" , __func__); +pf_info (pf,"%s: Could not allocate memory\n" , __func__);return -ENOMEM ; }
@@ -1380,8 +1371,7 @@ static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi, }break ;default : -dev_info (&pf->pdev->dev,"%s: Could not specify spec type\n" , - __func__); +pf_info (pf,"%s: Could not specify spec type\n" , __func__); ret = -EINVAL ; }
drivers/net/ethernet/intel/i40e/i40e_main.c +242 -343
802 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_sysfs.c +5 -8
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +85 -130
215 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 14 lines
1.8.1.2.459.gbcd45b4.dirty ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ E1000-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/e1000-devel To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
Part of the diff is not shown here. View the raw message.
PATCH 3/4 i40e: pf_<level> remove "%s: " ... __func__
In reply to Joe PerchesRemove the uses of "%s: " ..., __func__ from
the uses of pf_<level> and add it to the macros
instead.
This is preliminary to converting the macros
to functions and saving some text.
--- drivers/net/ethernet/intel/i40e/i40e.h | 6 +- drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 518 ++++++++++----------- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 36 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 406 ++++++++-------- drivers/net/ethernet/intel/i40e/i40e_sysfs.c | 9 +- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 157 +++---- 6 files changed, 523 insertions(+), 609 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +3 -3
@@ -566,10 +566,10 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi);/* i40e_pf message logging */ #define pf_err (pf, fmt, ...) \ - dev_err(&(pf)->pdev->dev, fmt, ##__VA_ARGS__) + dev_err(&(pf)->pdev->dev, "%s: " fmt, __func__, ##__VA_ARGS__)#define pf_warn (pf, fmt, ...) \ - dev_warn(&(pf)->pdev->dev, fmt, ##__VA_ARGS__) + dev_warn(&(pf)->pdev->dev, "%s: " fmt, __func__, ##__VA_ARGS__)#define pf_info (pf, fmt, ...) \ - dev_info(&(pf)->pdev->dev, fmt, ##__VA_ARGS__) + dev_info(&(pf)->pdev->dev, "%s: " fmt, __func__, ##__VA_ARGS__)#endif /* _I40E_H_ */
drivers/net/ethernet/intel/i40e/i40e_debugfs.c +237 -281
1,063 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +18 -18
@@ -1164,12 +1164,12 @@ static i40e_status i40e_add_del_fdir_udpv4(struct i40e_vsi *vsi, ret =i40e_program_fdir_filter (fd_data, pf, add);if (ret !=I40E_SUCCESS ) { -pf_info (pf,"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"Filter command send failed for PCTYPE %d (ret = %d)\n" , + fd_data->pctype, ret); err = true; }else { -pf_info (pf,"%s: Filter OK for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"Filter OK for PCTYPE %d (ret = %d)\n" , + fd_data->pctype, ret); } }
@@ -1207,12 +1207,12 @@ static i40e_status i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi, ret =i40e_program_fdir_filter (fd_data, pf, add);if (ret !=I40E_SUCCESS ) { -pf_info (pf,"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"Filter command send failed for PCTYPE %d (ret = %d)\n" , + fd_data->pctype, ret); err = true; }else { -pf_info (pf,"%s: Filter OK for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"Filter OK for PCTYPE %d (ret = %d)\n" , + fd_data->pctype, ret); } ip->saddr = fsp->h_u.tcp_ip4_spec.ip4src;
@@ -1221,12 +1221,12 @@ static i40e_status i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi, fd_data->pctype =I40E_FILTER_PCTYPE_NONF_IPV4_TCP ;if (ret !=I40E_SUCCESS ) { -pf_info (pf,"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"Filter command send failed for PCTYPE %d (ret = %d)\n" , + fd_data->pctype, ret); err = true; }else { -pf_info (pf,"%s: Filter OK for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"Filter OK for PCTYPE %d (ret = %d)\n" , + fd_data->pctype, ret); }return err ? -EOPNOTSUPP :I40E_SUCCESS ;
@@ -1282,12 +1282,12 @@ static i40e_status i40e_add_del_fdir_ipv4(struct i40e_vsi *vsi, ret =i40e_program_fdir_filter (fd_data, pf, add);if (ret !=I40E_SUCCESS ) { -pf_info (pf,"%s: Filter command send failed for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"Filter command send failed for PCTYPE %d (ret = %d)\n" , + fd_data->pctype, ret); err = true; }else { -pf_info (pf,"%s: Filter OK for PCTYPE %d (ret = %d)\n" , - __func__, fd_data->pctype, ret); +pf_info (pf,"Filter OK for PCTYPE %d (ret = %d)\n" , + fd_data->pctype, ret); } }
@@ -1328,7 +1328,7 @@ static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi, GFP_KERNEL);if (!fd_data.raw_packet) { -pf_info (pf,"%s: Could not allocate memory\n" , __func__); +pf_info (pf,"Could not allocate memory\n" );return -ENOMEM ; }
@@ -1371,7 +1371,7 @@ static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi, }break ;default : -pf_info (pf,"%s: Could not specify spec type\n" , __func__); +pf_info (pf,"Could not specify spec type\n" ); ret = -EINVAL ; }
drivers/net/ethernet/intel/i40e/i40e_main.c +186 -220
1,079 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_sysfs.c +4 -5
@@ -455,13 +455,12 @@ i40e_status i40e_sys_add_vsi(struct i40e_vsi *vsi) ret =sysfs_create_group (vsi->kobj, &i40e_sys_vsi_attr_group);if (ret <0 ) -pf_info (pf,"%s: create_group failed: %d\n" , __func__, ret); +pf_info (pf,"create_group failed: %d\n" , ret);if (vsi->netdev) { ret =sysfs_create_link (vsi->kobj, &vsi->netdev->dev.kobj,"net" );if (ret <0 ) -pf_info (pf,"%s: create_link failed: %d\n" , - __func__, ret); +pf_info (pf,"create_link failed: %d\n" , ret); }return I40E_SUCCESS ;
@@ -535,7 +534,7 @@ i40e_status i40e_sys_add_veb(struct i40e_veb *veb) ret =sysfs_create_group (veb->kobj, &i40e_sys_veb_attr_group);if (ret <0 ) -pf_info (pf,"%s: create_group failed: %d\n" , __func__, ret); +pf_info (pf,"create_group failed: %d\n" , ret);return I40E_SUCCESS ; }
@@ -577,7 +576,7 @@ static i40e_status i40e_sys_add_switch(struct i40e_pf *pf) ret =sysfs_create_group (pf->switch_kobj, &i40e_sys_hw_switch_attr_group);if (ret <0 ) -pf_info (pf,"%s: create_group failed: %d\n" , __func__, ret); +pf_info (pf,"create_group failed: %d\n" , ret);i40e_sys_add_vsi (pf->vsi[pf->lan_vsi]);
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +75 -82
424 lines not on this page · raw message
Signature · 14 lines
1.8.1.2.459.gbcd45b4.dirty ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ E1000-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/e1000-devel To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
PATCH 4/4 i40e: Convert pf_<level> macros to functions
In reply to Joe PerchesReduces object size ~10KB by removing "%s: ", __func__ and using the %pf extension and __builtin_return_address(0) to emit the function name.
$ size drivers/net/ethernet/intel/i40e/built-in.o* text data bss dec hex filename 166271 36043 50032 252346 3d9ba drivers/net/ethernet/intel/i40e/built-in.o.new 177030 35867 49936 262833 402b1 drivers/net/ethernet/intel/i40e/built-in.o.old
--- drivers/net/ethernet/intel/i40e/i40e.h | 12 ++++---- drivers/net/ethernet/intel/i40e/i40e_main.c | 45 +++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +6 -6
@@ -565,11 +565,11 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi);/* i40e_pf message logging */ -#define pf_err (pf, fmt, ...) \ - dev_err(&(pf)->pdev->dev, "%s: " fmt, __func__, ##__VA_ARGS__) -#define pf_warn (pf, fmt, ...) \ - dev_warn(&(pf)->pdev->dev, "%s: " fmt, __func__, ##__VA_ARGS__) -#define pf_info (pf, fmt, ...) \ - dev_info(&(pf)->pdev->dev, "%s: " fmt, __func__, ##__VA_ARGS__) +__printf(2, 3) +void pf_err (const struct i40e_pf *pf,const char *fmt, ...); +__printf(2, 3) +void pf_warn (const struct i40e_pf *pf,const char *fmt, ...); +__printf(2, 3) +void pf_info (const struct i40e_pf *pf,const char *fmt, ...);#endif /* _I40E_H_ */
drivers/net/ethernet/intel/i40e/i40e_main.c +45 -0
48 lines not on this page · raw message
Signature · 14 lines
1.8.1.2.459.gbcd45b4.dirty ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ E1000-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/e1000-devel To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
PATCH 1/1 i40e: Fix 32 bit shift compilation warnings
When dma_addr_t is a 32 bit value, >> 32 emits compiler warnings Use ((addr>>16) >>16) to avoid this.
I presume the macro should actually use the kernel.h macro upper_32_bits() eventually.
--- drivers/net/ethernet/intel/i40e/i40e_hmc.h | 2 +- drivers/net/ethernet/intel/i40e/i40e_type.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_hmc.h +1 -1
@@ -123,7 +123,7 @@ struct i40e_hmc_info {#define I40E_SET_PF_SD_ENTRY (hw, pa, sd_index, type) \ { \ u32 val1, val2, val3; \ - val1 = (u32)((pa) >> sizeof(u32) * 8); \ + val1 = (u32)(I40E_HI_DWORD(pa)); \ val2 = (u32)(pa) | (I40E_HMC_MAX_BP_COUNT << \ I40E_PFHMC_SDDATALOW_PMSDBPCOUNT_SHIFT) | \ ((((type) == I40E_SD_TYPE_PAGED) ? 0 : 1) << \
drivers/net/ethernet/intel/i40e/i40e_type.h +2 -2
@@ -78,8 +78,8 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);#define I40E_ETH_LENGTH_OF_ADDRESS 6/* Data type manipulation macros. */ -#define I40E_HI_DWORD (x) ((u32)(((x)>>32)&0xFFFFFFFF)) -#define I40E_LO_DWORD (x) ((u32)((x)&0xFFFFFFFF)) +#define I40E_HI_DWORD (x) ((u32)((((x) >> 16) >> 16) & 0xFFFFFFFF)) +#define I40E_LO_DWORD (x) ((u32)((x) & 0xFFFFFFFF))#define I40E_HI_WORD (x) ((u16)(((x)>>16)&0xFFFF))#define I40E_DESC_UNUSED (R ) \
Re: [PATCH] i40e: Fix 32 bit shift compilation warnings
Quoted 11 lines · Joe Perches
When
dma_addr_tis a 32 bit value, >> 32 emits compiler warnings Use ((addr>>16) >>16) to avoid this.I presume the macro should actually use the
kernel.hmacroupper_32_bits()eventually.Signed-off-by Joe Perches <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_hmc.h | 2 +- drivers/net/ethernet/intel/i40e/i40e_type.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Thanks again, I will add this patch as well to my queue.
Re: [E1000-devel] [PATCH] i40e: Fix 32 bit shift compilation warnings
In reply to Joe PerchesQuoted 30 lines · On Fri, 30 Aug 2013 18:47:35 -0700 Joe Perches <[email protected]> wrote:
When
dma_addr_tis a 32 bit value, >> 32 emits compiler warnings Use ((addr>>16) >>16) to avoid this.I presume the macro should actually use the
kernel.hmacroupper_32_bits()eventually.Signed-off-by Joe Perches <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_hmc.h | 2 +- drivers/net/ethernet/intel/i40e/i40e_type.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/net/ethernet/intel/i40e/i40e_hmc.h +1
-1@@ -123,7 +123,7 @@ struct i40e_hmc_info {#define I40E_SET_PF_SD_ENTRY (hw, pa, sd_index, type) \ { \ u32 val1, val2, val3; \ - val1 = (u32)((pa) >> sizeof(u32) * 8); \ + val1 = (u32)(I40E_HI_DWORD(pa)); \ val2 = (u32)(pa) | (I40E_HMC_MAX_BP_COUNT << \ I40E_PFHMC_SDDATALOW_PMSDBPCOUNT_SHIFT) | \ ((((type) == I40E_SD_TYPE_PAGED) ? 0 : 1) << \drivers/net/ethernet/intel/i40e/i40e_type.h +0
-0
drivers/net/ethernet/intel/i40e/i40e_type.h typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *); · line 85
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_type.h +2
-2@@ -78,8 +78,8 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);#define I40E_ETH_LENGTH_OF_ADDRESS 6/* Data type manipulation macros. */ -#define I40E_HI_DWORD (x) ((u32)(((x)>>32)&0xFFFFFFFF)) -#define I40E_LO_DWORD (x) ((u32)((x)&0xFFFFFFFF)) +#define I40E_HI_DWORD (x) ((u32)((((x) >> 16) >> 16) & 0xFFFFFFFF)) +#define I40E_LO_DWORD (x) ((u32)((x) & 0xFFFFFFFF))#define I40E_HI_WORD (x) ((u16)(((x)>>16)&0xFFFF))#define I40E_DESC_UNUSED (R ) \
After seeing this before in other drivers, a standard set of macros was added called upper_32bits and lower_32bits. These should be used instead of masking.
Quoted 7 lines · Joe Perches
Just some potential cleanings...
Joe Perches (4):
i40e: Whitespace cleaning
i40e: Add and use pf_<level>
i40e: pf_<level> remove "%s: " ...__func__
i40e: Convert pf_<level> macros to functions
Thanks Joe, I will add these to my queue.
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
Quoted 7 lines
-----Original Message-----
From: Joe Perches [mailto:[email protected]]
Sent: Friday, August 30, 2013 4:06 PMJust some potential cleanings...
i40e: Whitespace cleaning
Hmmm, we hadn't noticed the new experimental "--fix" option before. There are a lot of good suggestions there, but obviously it needs a lot of reading and tweaking before it can be used. There are cases here where function call parameters are adjusted to line up with the opening '(' but that pushes the parameter(s) beyond 80 columns - we're trying to stay within the 80 column line and checkpatch clean. Also, there are several where the first continued parameter line indent is changed but the next line or two are not.
We'll spend time going through these and try to take care of what makes sense.
Quoted 1 line
i40e: Add and use pf_<level>
We had considered this kind of macro awhile ago, but nixed it for a few different reasons, but primarily because it seems like yet-another-print-macro and not necessarily worth the effort.
Quoted 1 line
i40e: pf_<level> remove "%s: " ...
__func__
We're beginning to remove many of the __func__ uses, so these prints are no longer all doing the __func__ thing. We originally had them there for early development and debugging and are currently removing them from the normal path messages.
Quoted 1 line
i40e: Convert pf_<level> macros to functions
Doesn't this create a problem with polluting the kernel namespace? These don't apply to any other driver. I suppose we could lessen the namespace problem with i40e_ prefix, but I'm still not sold on it. I suspect we can still get much of the text savings replacing the __func__ with __builtin_return_address(0) where needed, and remove them where no longer needed. Does that work for you?
Quoted 1 line
i40e: Fix 32 bit shift compilation warnings
Sure.
sln
On Wed, 2013-09-04 at 01:00 +0000, Nelson, Shannon wrote:
Hi Shannon.
Quoted 15 lines
Quoted 1 line
-----Original Message----- > From: Joe Perches
[mailto:[email protected]] > Sent: Friday, August 30, 2013 4:06 PM > > Just some potential cleanings...
Quoted 1 line
i40e: Whitespace cleaning
Hmmm, we hadn't noticed the new experimental "--fix" option before. There are a lot of good suggestions there, but obviously it needs a lot of reading and tweaking before it can be used. There are cases here where function call parameters are adjusted to line up with the opening '(' but that pushes the parameter(s) beyond 80 columns - we're trying to stay within the 80 column line and checkpatch clean. Also, there are several where the first continued parameter line indent is changed but the next line or two are not.
Quoted 2 lines
We'll spend time going through these and try to take care of what makes sense.
Swell. All these are your choice to fix as you want.
Exceeding 80 columns doesn't bother me much. Keeping alignment appropriate for multi-line statements needs work inside checkpatch. I played with it a bit but it's unfortunately complicated by intermixed insertions and deletions.
Quoted 6 lines
Quoted 1 line
i40e: Add and use pf_<level>
We had considered this kind of macro awhile ago, but nixed it for a few different reasons, but primarily because it seems like yet-another-print-macro and not necessarily worth the effort.
Quoted 6 lines
Quoted 1 line
i40e: pf_<level> remove "%s: " ...
__func__We're beginning to remove many of the
__func__uses, so these prints are no longer all doing the__func__thing. We originally had them there for early development and debugging and are currently removing them from the normal path messages.
Fine by me. I think __func__ is nearly always pretty useless myself.
Quoted 8 lines
Quoted 1 line
i40e: Convert pf_<level> macros to functions
Doesn't this create a problem with polluting the kernel namespace? These don't apply to any other driver. I suppose we could lessen the namespace problem with
i40e_prefix, but I'm still not sold on it. I suspect we can still get much of the text savings replacing the__func__with__builtin_return_address(0)where needed, and remove them where no longer needed. Does that work for you?
I think you could just as soon whatever combinations of the other standard logging mechanisms without using pf_<level>
wiphy_<level> netif_<level> netdev_<level> dev_<level> pr_<level>
as appropriate. I did that only because there was ~10K of what I think of as not too useful function names out of a defconfig size of 140k.
Quoted 3 lines
Quoted 1 line
i40e: Fix 32 bit shift compilation warnings
Sure.
I think you should use the kernel.h standard macros for lower_32_bits and upper_32_bits instead.
cheers, Joe
Quoted 25 lines
-----Original Message-----
From: Joe Perches [mailto:[email protected]]
Sent: Tuesday, September 03, 2013 6:31 PMOn Wed, 2013-09-04 at 01:00 +0000, Nelson, Shannon wrote:
Hi Shannon.
Quoted 8 lines
Quoted 1 line
-----Original Message----- > From: Joe Perches
[mailto:[email protected]] > Sent: Friday, August 30, 2013 4:06 PM > > Just some potential cleanings...
Quoted 1 line
i40e: Whitespace cleaning
Hmmm, we hadn't noticed the new experimental "--fix" option before. There are a lot of good suggestions there, but obviously it needs a
lot
Quoted 2 lines
of reading and tweaking before it can be used. There are cases here where function call parameters are adjusted to line up with the
opening
Quoted 5 lines
'(' but that pushes the parameter(s) beyond 80 columns - we're trying to stay within the 80 column line and checkpatch clean. Also, there are several where the first continued parameter line indent is changed but the next line or two are not.
Quoted 7 lines
Quoted 1 line
We'll spend time going through these and try to take care of what
makes
Quoted 1 line
sense.
Swell. All these are your choice to fix as you want.
Exceeding 80 columns doesn't bother me much.
We should perhaps become a little more flexible ourselves, but we've finally got a good process going internally, including this as a check. I don't dare disturb the machine now that it is working :-).
Quoted 4 lines
Keeping alignment appropriate for multi-line statements needs work inside checkpatch. I played with it a bit but it's unfortunately complicated by intermixed insertions and deletions.
Yeah, it all gets a little funky after a while.
Quoted 10 lines
Quoted 4 lines
Quoted 2 lines
i40e: Add and use pf_<level>
We had considered this kind of macro awhile ago, but nixed it for a
few
Quoted 5 lines
different reasons, but primarily because it seems like yet-another-print-macro and not necessarily worth the effort.
Quoted 1 line
i40e: pf_<level> remove "%s: " ...
__func__
Quoted 7 lines
Quoted 4 lines
We're beginning to remove many of the
__func__uses, so these prints are no longer all doing the__func__thing. We originally had them there for early development and debugging and are currently removing them from the normal path messages.Fine by me. I think
__func__is nearly always pretty useless myself.
It was useful for a while, but it is time to be pulling it out.
Quoted 20 lines
Quoted 8 lines
Quoted 2 lines
i40e: Convert pf_<level> macros to functions
Doesn't this create a problem with polluting the kernel namespace? These don't apply to any other driver. I suppose we could lessen the namespace problem with
i40e_prefix, but I'm still not sold on it. I suspect we can still get much of the text savings replacing the__func__with__builtin_return_address(0)where needed, and removethem
Quoted 1 line
where no longer needed. Does that work for you?
I think you could just as soon whatever combinations of the other standard logging mechanisms without using pf_<level>
wiphy_<level> netif_<level> netdev_<level> dev_<level> pr_<level>
Quoted 3 lines
as appropriate. I did that only because there was ~10K of what I think of as not too useful function names out of a defconfig size of 140k.
Yes, and I think removing much of the __func__ or using __builtin_return_address(0) will help.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
i40e: Fix 32 bit shift compilation warnings
Sure.
I think you should use the
kernel.hstandard macros forlower_32_bitsandupper_32_bitsinstead.
Yep.
Quoted 2 lines
cheers, Joe
Quoted 3 lines · Shannon
we hadn't noticed the new experimental "--fix" option before. There are a lot of good suggestions there, but obviously it needs a lot of reading and tweaking before it can be used.
Yes, I think --fix works best on patches.
When you use -f and --fix together, it can do inappropriate things.
Using multiple passes of -f --fix --types=<ONE_SPECIFIC_TYPE> and changing the "ONE_SPECIFIC_TYPE" can produce more reasonable patch sequences.
If you do try it, and please remember it is experimental, do let me know how well it works or doesn't work for you all.
Bug reports (and patches) welcome.
cheers, Joe