diff options
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e.h | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_common.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 29 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 117 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 60 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 222 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 12 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40evf_main.c | 16 |
12 files changed, 313 insertions, 187 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 7ce8e600c13c..1c8bd7c152c2 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h | |||
@@ -177,6 +177,8 @@ struct i40e_lump_tracking { | |||
177 | #define I40E_FDIR_BUFFER_HEAD_ROOM 32 | 177 | #define I40E_FDIR_BUFFER_HEAD_ROOM 32 |
178 | #define I40E_FDIR_BUFFER_HEAD_ROOM_FOR_ATR (I40E_FDIR_BUFFER_HEAD_ROOM * 4) | 178 | #define I40E_FDIR_BUFFER_HEAD_ROOM_FOR_ATR (I40E_FDIR_BUFFER_HEAD_ROOM * 4) |
179 | 179 | ||
180 | #define I40E_HKEY_ARRAY_SIZE ((I40E_PFQF_HKEY_MAX_INDEX + 1) * 4) | ||
181 | |||
180 | enum i40e_fd_stat_idx { | 182 | enum i40e_fd_stat_idx { |
181 | I40E_FD_STAT_ATR, | 183 | I40E_FD_STAT_ATR, |
182 | I40E_FD_STAT_SB, | 184 | I40E_FD_STAT_SB, |
@@ -240,17 +242,17 @@ struct i40e_pf { | |||
240 | bool fc_autoneg_status; | 242 | bool fc_autoneg_status; |
241 | 243 | ||
242 | u16 eeprom_version; | 244 | u16 eeprom_version; |
243 | u16 num_vmdq_vsis; /* num vmdq vsis this pf has set up */ | 245 | u16 num_vmdq_vsis; /* num vmdq vsis this PF has set up */ |
244 | u16 num_vmdq_qps; /* num queue pairs per vmdq pool */ | 246 | u16 num_vmdq_qps; /* num queue pairs per vmdq pool */ |
245 | u16 num_vmdq_msix; /* num queue vectors per vmdq pool */ | 247 | u16 num_vmdq_msix; /* num queue vectors per vmdq pool */ |
246 | u16 num_req_vfs; /* num vfs requested for this vf */ | 248 | u16 num_req_vfs; /* num VFs requested for this VF */ |
247 | u16 num_vf_qps; /* num queue pairs per vf */ | 249 | u16 num_vf_qps; /* num queue pairs per VF */ |
248 | #ifdef I40E_FCOE | 250 | #ifdef I40E_FCOE |
249 | u16 num_fcoe_qps; /* num fcoe queues this pf has set up */ | 251 | u16 num_fcoe_qps; /* num fcoe queues this PF has set up */ |
250 | u16 num_fcoe_msix; /* num queue vectors per fcoe pool */ | 252 | u16 num_fcoe_msix; /* num queue vectors per fcoe pool */ |
251 | #endif /* I40E_FCOE */ | 253 | #endif /* I40E_FCOE */ |
252 | u16 num_lan_qps; /* num lan queues this pf has set up */ | 254 | u16 num_lan_qps; /* num lan queues this PF has set up */ |
253 | u16 num_lan_msix; /* num queue vectors for the base pf vsi */ | 255 | u16 num_lan_msix; /* num queue vectors for the base PF vsi */ |
254 | int queues_left; /* queues left unclaimed */ | 256 | int queues_left; /* queues left unclaimed */ |
255 | u16 rss_size; /* num queues in the RSS array */ | 257 | u16 rss_size; /* num queues in the RSS array */ |
256 | u16 rss_size_max; /* HW defined max RSS queues */ | 258 | u16 rss_size_max; /* HW defined max RSS queues */ |
@@ -612,7 +614,7 @@ static inline bool i40e_rx_is_programming_status(u64 qw) | |||
612 | 614 | ||
613 | /** | 615 | /** |
614 | * i40e_get_fd_cnt_all - get the total FD filter space available | 616 | * i40e_get_fd_cnt_all - get the total FD filter space available |
615 | * @pf: pointer to the pf struct | 617 | * @pf: pointer to the PF struct |
616 | **/ | 618 | **/ |
617 | static inline int i40e_get_fd_cnt_all(struct i40e_pf *pf) | 619 | static inline int i40e_get_fd_cnt_all(struct i40e_pf *pf) |
618 | { | 620 | { |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index fb78bdd2eb95..d9f1fcb9c2be 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c | |||
@@ -691,7 +691,7 @@ i40e_status i40e_get_port_mac_addr(struct i40e_hw *hw, u8 *mac_addr) | |||
691 | /** | 691 | /** |
692 | * i40e_pre_tx_queue_cfg - pre tx queue configure | 692 | * i40e_pre_tx_queue_cfg - pre tx queue configure |
693 | * @hw: pointer to the HW structure | 693 | * @hw: pointer to the HW structure |
694 | * @queue: target pf queue index | 694 | * @queue: target PF queue index |
695 | * @enable: state change request | 695 | * @enable: state change request |
696 | * | 696 | * |
697 | * Handles hw requirement to indicate intention to enable | 697 | * Handles hw requirement to indicate intention to enable |
@@ -955,7 +955,7 @@ void i40e_clear_hw(struct i40e_hw *hw) | |||
955 | u32 val; | 955 | u32 val; |
956 | u32 eol = 0x7ff; | 956 | u32 eol = 0x7ff; |
957 | 957 | ||
958 | /* get number of interrupts, queues, and vfs */ | 958 | /* get number of interrupts, queues, and VFs */ |
959 | val = rd32(hw, I40E_GLPCI_CNF2); | 959 | val = rd32(hw, I40E_GLPCI_CNF2); |
960 | num_pf_int = (val & I40E_GLPCI_CNF2_MSI_X_PF_N_MASK) >> | 960 | num_pf_int = (val & I40E_GLPCI_CNF2_MSI_X_PF_N_MASK) >> |
961 | I40E_GLPCI_CNF2_MSI_X_PF_N_SHIFT; | 961 | I40E_GLPCI_CNF2_MSI_X_PF_N_SHIFT; |
@@ -2017,7 +2017,7 @@ i40e_status i40e_aq_add_macvlan(struct i40e_hw *hw, u16 seid, | |||
2017 | if (count == 0 || !mv_list || !hw) | 2017 | if (count == 0 || !mv_list || !hw) |
2018 | return I40E_ERR_PARAM; | 2018 | return I40E_ERR_PARAM; |
2019 | 2019 | ||
2020 | buf_size = count * sizeof(struct i40e_aqc_add_macvlan_element_data); | 2020 | buf_size = count * sizeof(*mv_list); |
2021 | 2021 | ||
2022 | /* prep the rest of the request */ | 2022 | /* prep the rest of the request */ |
2023 | i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_add_macvlan); | 2023 | i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_add_macvlan); |
@@ -2059,7 +2059,7 @@ i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid, | |||
2059 | if (count == 0 || !mv_list || !hw) | 2059 | if (count == 0 || !mv_list || !hw) |
2060 | return I40E_ERR_PARAM; | 2060 | return I40E_ERR_PARAM; |
2061 | 2061 | ||
2062 | buf_size = count * sizeof(struct i40e_aqc_remove_macvlan_element_data); | 2062 | buf_size = count * sizeof(*mv_list); |
2063 | 2063 | ||
2064 | /* prep the rest of the request */ | 2064 | /* prep the rest of the request */ |
2065 | i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_remove_macvlan); | 2065 | i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_remove_macvlan); |
@@ -2081,7 +2081,7 @@ i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid, | |||
2081 | /** | 2081 | /** |
2082 | * i40e_aq_send_msg_to_vf | 2082 | * i40e_aq_send_msg_to_vf |
2083 | * @hw: pointer to the hardware structure | 2083 | * @hw: pointer to the hardware structure |
2084 | * @vfid: vf id to send msg | 2084 | * @vfid: VF id to send msg |
2085 | * @v_opcode: opcodes for VF-PF communication | 2085 | * @v_opcode: opcodes for VF-PF communication |
2086 | * @v_retval: return error code | 2086 | * @v_retval: return error code |
2087 | * @msg: pointer to the msg buffer | 2087 | * @msg: pointer to the msg buffer |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c index 2f583554a260..400fb28db576 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c +++ b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | |||
@@ -223,7 +223,7 @@ static int i40e_dcbnl_vsi_del_app(struct i40e_vsi *vsi, | |||
223 | 223 | ||
224 | /** | 224 | /** |
225 | * i40e_dcbnl_del_app - Delete APP on all VSIs | 225 | * i40e_dcbnl_del_app - Delete APP on all VSIs |
226 | * @pf: the corresponding pf | 226 | * @pf: the corresponding PF |
227 | * @app: APP to delete | 227 | * @app: APP to delete |
228 | * | 228 | * |
229 | * Delete given APP from all the VSIs for given PF | 229 | * Delete given APP from all the VSIs for given PF |
@@ -268,7 +268,7 @@ static bool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg, | |||
268 | 268 | ||
269 | /** | 269 | /** |
270 | * i40e_dcbnl_flush_apps - Delete all removed APPs | 270 | * i40e_dcbnl_flush_apps - Delete all removed APPs |
271 | * @pf: the corresponding pf | 271 | * @pf: the corresponding PF |
272 | * @old_cfg: old DCBX configuration data | 272 | * @old_cfg: old DCBX configuration data |
273 | * @new_cfg: new DCBX configuration data | 273 | * @new_cfg: new DCBX configuration data |
274 | * | 274 | * |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c index e802b6bc067d..daa88263af66 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c | |||
@@ -35,7 +35,7 @@ static struct dentry *i40e_dbg_root; | |||
35 | 35 | ||
36 | /** | 36 | /** |
37 | * i40e_dbg_find_vsi - searches for the vsi with the given seid | 37 | * i40e_dbg_find_vsi - searches for the vsi with the given seid |
38 | * @pf - the pf structure to search for the vsi | 38 | * @pf - the PF structure to search for the vsi |
39 | * @seid - seid of the vsi it is searching for | 39 | * @seid - seid of the vsi it is searching for |
40 | **/ | 40 | **/ |
41 | static struct i40e_vsi *i40e_dbg_find_vsi(struct i40e_pf *pf, int seid) | 41 | static struct i40e_vsi *i40e_dbg_find_vsi(struct i40e_pf *pf, int seid) |
@@ -54,7 +54,7 @@ static struct i40e_vsi *i40e_dbg_find_vsi(struct i40e_pf *pf, int seid) | |||
54 | 54 | ||
55 | /** | 55 | /** |
56 | * i40e_dbg_find_veb - searches for the veb with the given seid | 56 | * i40e_dbg_find_veb - searches for the veb with the given seid |
57 | * @pf - the pf structure to search for the veb | 57 | * @pf - the PF structure to search for the veb |
58 | * @seid - seid of the veb it is searching for | 58 | * @seid - seid of the veb it is searching for |
59 | **/ | 59 | **/ |
60 | static struct i40e_veb *i40e_dbg_find_veb(struct i40e_pf *pf, int seid) | 60 | static struct i40e_veb *i40e_dbg_find_veb(struct i40e_pf *pf, int seid) |
@@ -112,7 +112,7 @@ static ssize_t i40e_dbg_dump_read(struct file *filp, char __user *buffer, | |||
112 | 112 | ||
113 | /** | 113 | /** |
114 | * i40e_dbg_prep_dump_buf | 114 | * i40e_dbg_prep_dump_buf |
115 | * @pf: the pf we're working with | 115 | * @pf: the PF we're working with |
116 | * @buflen: the desired buffer length | 116 | * @buflen: the desired buffer length |
117 | * | 117 | * |
118 | * Return positive if success, 0 if failed | 118 | * Return positive if success, 0 if failed |
@@ -318,7 +318,7 @@ static const struct file_operations i40e_dbg_dump_fops = { | |||
318 | * setup, adding or removing filters, or other things. Many of | 318 | * setup, adding or removing filters, or other things. Many of |
319 | * these will be useful for some forms of unit testing. | 319 | * these will be useful for some forms of unit testing. |
320 | **************************************************************/ | 320 | **************************************************************/ |
321 | static char i40e_dbg_command_buf[256] = "hello world"; | 321 | static char i40e_dbg_command_buf[256] = ""; |
322 | 322 | ||
323 | /** | 323 | /** |
324 | * i40e_dbg_command_read - read for command datum | 324 | * i40e_dbg_command_read - read for command datum |
@@ -390,6 +390,11 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid) | |||
390 | " netdev_registered = %i, current_netdev_flags = 0x%04x, state = %li flags = 0x%08lx\n", | 390 | " netdev_registered = %i, current_netdev_flags = 0x%04x, state = %li flags = 0x%08lx\n", |
391 | vsi->netdev_registered, | 391 | vsi->netdev_registered, |
392 | vsi->current_netdev_flags, vsi->state, vsi->flags); | 392 | vsi->current_netdev_flags, vsi->state, vsi->flags); |
393 | if (vsi == pf->vsi[pf->lan_vsi]) | ||
394 | dev_info(&pf->pdev->dev, "MAC address: %pM SAN MAC: %pM Port MAC: %pM\n", | ||
395 | pf->hw.mac.addr, | ||
396 | pf->hw.mac.san_addr, | ||
397 | pf->hw.mac.port_addr); | ||
393 | list_for_each_entry(f, &vsi->mac_filter_list, list) { | 398 | list_for_each_entry(f, &vsi->mac_filter_list, list) { |
394 | dev_info(&pf->pdev->dev, | 399 | dev_info(&pf->pdev->dev, |
395 | " mac_filter_list: %pM vid=%d, is_netdev=%d is_vf=%d counter=%d\n", | 400 | " mac_filter_list: %pM vid=%d, is_netdev=%d is_vf=%d counter=%d\n", |
@@ -675,7 +680,7 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid) | |||
675 | vsi->info.resp_reserved[8], vsi->info.resp_reserved[9], | 680 | vsi->info.resp_reserved[8], vsi->info.resp_reserved[9], |
676 | vsi->info.resp_reserved[10], vsi->info.resp_reserved[11]); | 681 | vsi->info.resp_reserved[10], vsi->info.resp_reserved[11]); |
677 | if (vsi->back) | 682 | if (vsi->back) |
678 | dev_info(&pf->pdev->dev, " pf = %p\n", vsi->back); | 683 | dev_info(&pf->pdev->dev, " PF = %p\n", vsi->back); |
679 | dev_info(&pf->pdev->dev, " idx = %d\n", vsi->idx); | 684 | dev_info(&pf->pdev->dev, " idx = %d\n", vsi->idx); |
680 | dev_info(&pf->pdev->dev, | 685 | dev_info(&pf->pdev->dev, |
681 | " tc_config: numtc = %d, enabled_tc = 0x%x\n", | 686 | " tc_config: numtc = %d, enabled_tc = 0x%x\n", |
@@ -946,7 +951,7 @@ static void i40e_dbg_dump_veb_all(struct i40e_pf *pf) | |||
946 | 951 | ||
947 | /** | 952 | /** |
948 | * i40e_dbg_cmd_fd_ctrl - Enable/disable FD sideband/ATR | 953 | * i40e_dbg_cmd_fd_ctrl - Enable/disable FD sideband/ATR |
949 | * @pf: the pf that would be altered | 954 | * @pf: the PF that would be altered |
950 | * @flag: flag that needs enabling or disabling | 955 | * @flag: flag that needs enabling or disabling |
951 | * @enable: Enable/disable FD SD/ATR | 956 | * @enable: Enable/disable FD SD/ATR |
952 | **/ | 957 | **/ |
@@ -958,7 +963,7 @@ static void i40e_dbg_cmd_fd_ctrl(struct i40e_pf *pf, u64 flag, bool enable) | |||
958 | pf->flags &= ~flag; | 963 | pf->flags &= ~flag; |
959 | pf->auto_disable_flags |= flag; | 964 | pf->auto_disable_flags |= flag; |
960 | } | 965 | } |
961 | dev_info(&pf->pdev->dev, "requesting a pf reset\n"); | 966 | dev_info(&pf->pdev->dev, "requesting a PF reset\n"); |
962 | i40e_do_reset_safe(pf, (1 << __I40E_PF_RESET_REQUESTED)); | 967 | i40e_do_reset_safe(pf, (1 << __I40E_PF_RESET_REQUESTED)); |
963 | } | 968 | } |
964 | 969 | ||
@@ -1940,7 +1945,7 @@ static const struct file_operations i40e_dbg_command_fops = { | |||
1940 | * The netdev_ops entry in debugfs is for giving the driver commands | 1945 | * The netdev_ops entry in debugfs is for giving the driver commands |
1941 | * to be executed from the netdev operations. | 1946 | * to be executed from the netdev operations. |
1942 | **************************************************************/ | 1947 | **************************************************************/ |
1943 | static char i40e_dbg_netdev_ops_buf[256] = "hello world"; | 1948 | static char i40e_dbg_netdev_ops_buf[256] = ""; |
1944 | 1949 | ||
1945 | /** | 1950 | /** |
1946 | * i40e_dbg_netdev_ops - read for netdev_ops datum | 1951 | * i40e_dbg_netdev_ops - read for netdev_ops datum |
@@ -2128,8 +2133,8 @@ static const struct file_operations i40e_dbg_netdev_ops_fops = { | |||
2128 | }; | 2133 | }; |
2129 | 2134 | ||
2130 | /** | 2135 | /** |
2131 | * i40e_dbg_pf_init - setup the debugfs directory for the pf | 2136 | * i40e_dbg_pf_init - setup the debugfs directory for the PF |
2132 | * @pf: the pf that is starting up | 2137 | * @pf: the PF that is starting up |
2133 | **/ | 2138 | **/ |
2134 | void i40e_dbg_pf_init(struct i40e_pf *pf) | 2139 | void i40e_dbg_pf_init(struct i40e_pf *pf) |
2135 | { | 2140 | { |
@@ -2165,8 +2170,8 @@ create_failed: | |||
2165 | } | 2170 | } |
2166 | 2171 | ||
2167 | /** | 2172 | /** |
2168 | * i40e_dbg_pf_exit - clear out the pf's debugfs entries | 2173 | * i40e_dbg_pf_exit - clear out the PF's debugfs entries |
2169 | * @pf: the pf that is stopping | 2174 | * @pf: the PF that is stopping |
2170 | **/ | 2175 | **/ |
2171 | void i40e_dbg_pf_exit(struct i40e_pf *pf) | 2176 | void i40e_dbg_pf_exit(struct i40e_pf *pf) |
2172 | { | 2177 | { |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index 01c811c99ff7..b7d0aaac5480 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c | |||
@@ -917,7 +917,9 @@ static int i40e_get_eeprom(struct net_device *netdev, | |||
917 | 917 | ||
918 | cmd = (struct i40e_nvm_access *)eeprom; | 918 | cmd = (struct i40e_nvm_access *)eeprom; |
919 | ret_val = i40e_nvmupd_command(hw, cmd, bytes, &errno); | 919 | ret_val = i40e_nvmupd_command(hw, cmd, bytes, &errno); |
920 | if (ret_val) | 920 | if (ret_val && |
921 | ((hw->aq.asq_last_status != I40E_AQ_RC_EACCES) || | ||
922 | (hw->debug_mask & I40E_DEBUG_NVM))) | ||
921 | dev_info(&pf->pdev->dev, | 923 | dev_info(&pf->pdev->dev, |
922 | "NVMUpdate read failed err=%d status=0x%x errno=%d module=%d offset=0x%x size=%d\n", | 924 | "NVMUpdate read failed err=%d status=0x%x errno=%d module=%d offset=0x%x size=%d\n", |
923 | ret_val, hw->aq.asq_last_status, errno, | 925 | ret_val, hw->aq.asq_last_status, errno, |
@@ -1021,7 +1023,10 @@ static int i40e_set_eeprom(struct net_device *netdev, | |||
1021 | 1023 | ||
1022 | cmd = (struct i40e_nvm_access *)eeprom; | 1024 | cmd = (struct i40e_nvm_access *)eeprom; |
1023 | ret_val = i40e_nvmupd_command(hw, cmd, bytes, &errno); | 1025 | ret_val = i40e_nvmupd_command(hw, cmd, bytes, &errno); |
1024 | if (ret_val && hw->aq.asq_last_status != I40E_AQ_RC_EBUSY) | 1026 | if (ret_val && |
1027 | ((hw->aq.asq_last_status != I40E_AQ_RC_EPERM && | ||
1028 | hw->aq.asq_last_status != I40E_AQ_RC_EBUSY) || | ||
1029 | (hw->debug_mask & I40E_DEBUG_NVM))) | ||
1025 | dev_info(&pf->pdev->dev, | 1030 | dev_info(&pf->pdev->dev, |
1026 | "NVMUpdate write failed err=%d status=0x%x errno=%d module=%d offset=0x%x size=%d\n", | 1031 | "NVMUpdate write failed err=%d status=0x%x errno=%d module=%d offset=0x%x size=%d\n", |
1027 | ret_val, hw->aq.asq_last_status, errno, | 1032 | ret_val, hw->aq.asq_last_status, errno, |
@@ -2370,6 +2375,110 @@ static int i40e_set_channels(struct net_device *dev, | |||
2370 | return -EINVAL; | 2375 | return -EINVAL; |
2371 | } | 2376 | } |
2372 | 2377 | ||
2378 | #define I40E_HLUT_ARRAY_SIZE ((I40E_PFQF_HLUT_MAX_INDEX + 1) * 4) | ||
2379 | /** | ||
2380 | * i40e_get_rxfh_key_size - get the RSS hash key size | ||
2381 | * @netdev: network interface device structure | ||
2382 | * | ||
2383 | * Returns the table size. | ||
2384 | **/ | ||
2385 | static u32 i40e_get_rxfh_key_size(struct net_device *netdev) | ||
2386 | { | ||
2387 | return I40E_HKEY_ARRAY_SIZE; | ||
2388 | } | ||
2389 | |||
2390 | /** | ||
2391 | * i40e_get_rxfh_indir_size - get the rx flow hash indirection table size | ||
2392 | * @netdev: network interface device structure | ||
2393 | * | ||
2394 | * Returns the table size. | ||
2395 | **/ | ||
2396 | static u32 i40e_get_rxfh_indir_size(struct net_device *netdev) | ||
2397 | { | ||
2398 | return I40E_HLUT_ARRAY_SIZE; | ||
2399 | } | ||
2400 | |||
2401 | static int i40e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, | ||
2402 | u8 *hfunc) | ||
2403 | { | ||
2404 | struct i40e_netdev_priv *np = netdev_priv(netdev); | ||
2405 | struct i40e_vsi *vsi = np->vsi; | ||
2406 | struct i40e_pf *pf = vsi->back; | ||
2407 | struct i40e_hw *hw = &pf->hw; | ||
2408 | u32 reg_val; | ||
2409 | int i, j; | ||
2410 | |||
2411 | if (hfunc) | ||
2412 | *hfunc = ETH_RSS_HASH_TOP; | ||
2413 | |||
2414 | if (!indir) | ||
2415 | return 0; | ||
2416 | |||
2417 | for (i = 0, j = 0; i <= I40E_PFQF_HLUT_MAX_INDEX; i++) { | ||
2418 | reg_val = rd32(hw, I40E_PFQF_HLUT(i)); | ||
2419 | indir[j++] = reg_val & 0xff; | ||
2420 | indir[j++] = (reg_val >> 8) & 0xff; | ||
2421 | indir[j++] = (reg_val >> 16) & 0xff; | ||
2422 | indir[j++] = (reg_val >> 24) & 0xff; | ||
2423 | } | ||
2424 | |||
2425 | if (key) { | ||
2426 | for (i = 0, j = 0; i <= I40E_PFQF_HKEY_MAX_INDEX; i++) { | ||
2427 | reg_val = rd32(hw, I40E_PFQF_HKEY(i)); | ||
2428 | key[j++] = (u8)(reg_val & 0xff); | ||
2429 | key[j++] = (u8)((reg_val >> 8) & 0xff); | ||
2430 | key[j++] = (u8)((reg_val >> 16) & 0xff); | ||
2431 | key[j++] = (u8)((reg_val >> 24) & 0xff); | ||
2432 | } | ||
2433 | } | ||
2434 | return 0; | ||
2435 | } | ||
2436 | |||
2437 | /** | ||
2438 | * i40e_set_rxfh - set the rx flow hash indirection table | ||
2439 | * @netdev: network interface device structure | ||
2440 | * @indir: indirection table | ||
2441 | * @key: hash key | ||
2442 | * | ||
2443 | * Returns -EINVAL if the table specifies an inavlid queue id, otherwise | ||
2444 | * returns 0 after programming the table. | ||
2445 | **/ | ||
2446 | static int i40e_set_rxfh(struct net_device *netdev, const u32 *indir, | ||
2447 | const u8 *key, const u8 hfunc) | ||
2448 | { | ||
2449 | struct i40e_netdev_priv *np = netdev_priv(netdev); | ||
2450 | struct i40e_vsi *vsi = np->vsi; | ||
2451 | struct i40e_pf *pf = vsi->back; | ||
2452 | struct i40e_hw *hw = &pf->hw; | ||
2453 | u32 reg_val; | ||
2454 | int i, j; | ||
2455 | |||
2456 | if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP) | ||
2457 | return -EOPNOTSUPP; | ||
2458 | |||
2459 | if (!indir) | ||
2460 | return 0; | ||
2461 | |||
2462 | for (i = 0, j = 0; i <= I40E_PFQF_HLUT_MAX_INDEX; i++) { | ||
2463 | reg_val = indir[j++]; | ||
2464 | reg_val |= indir[j++] << 8; | ||
2465 | reg_val |= indir[j++] << 16; | ||
2466 | reg_val |= indir[j++] << 24; | ||
2467 | wr32(hw, I40E_PFQF_HLUT(i), reg_val); | ||
2468 | } | ||
2469 | |||
2470 | if (key) { | ||
2471 | for (i = 0, j = 0; i <= I40E_PFQF_HKEY_MAX_INDEX; i++) { | ||
2472 | reg_val = key[j++]; | ||
2473 | reg_val |= key[j++] << 8; | ||
2474 | reg_val |= key[j++] << 16; | ||
2475 | reg_val |= key[j++] << 24; | ||
2476 | wr32(hw, I40E_PFQF_HKEY(i), reg_val); | ||
2477 | } | ||
2478 | } | ||
2479 | return 0; | ||
2480 | } | ||
2481 | |||
2373 | /** | 2482 | /** |
2374 | * i40e_get_priv_flags - report device private flags | 2483 | * i40e_get_priv_flags - report device private flags |
2375 | * @dev: network interface device structure | 2484 | * @dev: network interface device structure |
@@ -2421,6 +2530,10 @@ static const struct ethtool_ops i40e_ethtool_ops = { | |||
2421 | .get_ethtool_stats = i40e_get_ethtool_stats, | 2530 | .get_ethtool_stats = i40e_get_ethtool_stats, |
2422 | .get_coalesce = i40e_get_coalesce, | 2531 | .get_coalesce = i40e_get_coalesce, |
2423 | .set_coalesce = i40e_set_coalesce, | 2532 | .set_coalesce = i40e_set_coalesce, |
2533 | .get_rxfh_key_size = i40e_get_rxfh_key_size, | ||
2534 | .get_rxfh_indir_size = i40e_get_rxfh_indir_size, | ||
2535 | .get_rxfh = i40e_get_rxfh, | ||
2536 | .set_rxfh = i40e_set_rxfh, | ||
2424 | .get_channels = i40e_get_channels, | 2537 | .get_channels = i40e_get_channels, |
2425 | .set_channels = i40e_set_channels, | 2538 | .set_channels = i40e_set_channels, |
2426 | .get_ts_info = i40e_get_ts_info, | 2539 | .get_ts_info = i40e_get_ts_info, |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c index 0357b31e4a5c..1ca48458e668 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c +++ b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c | |||
@@ -149,7 +149,7 @@ static inline bool i40e_fcoe_xid_is_valid(u16 xid) | |||
149 | 149 | ||
150 | /** | 150 | /** |
151 | * i40e_fcoe_ddp_unmap - unmap the mapped sglist associated | 151 | * i40e_fcoe_ddp_unmap - unmap the mapped sglist associated |
152 | * @pf: pointer to pf | 152 | * @pf: pointer to PF |
153 | * @ddp: sw DDP context | 153 | * @ddp: sw DDP context |
154 | * | 154 | * |
155 | * Unmap the scatter-gather list associated with the given SW DDP context | 155 | * Unmap the scatter-gather list associated with the given SW DDP context |
@@ -268,7 +268,7 @@ out: | |||
268 | 268 | ||
269 | /** | 269 | /** |
270 | * i40e_fcoe_sw_init - sets up the HW for FCoE | 270 | * i40e_fcoe_sw_init - sets up the HW for FCoE |
271 | * @pf: pointer to pf | 271 | * @pf: pointer to PF |
272 | * | 272 | * |
273 | * Returns 0 if FCoE is supported otherwise the error code | 273 | * Returns 0 if FCoE is supported otherwise the error code |
274 | **/ | 274 | **/ |
@@ -328,7 +328,7 @@ int i40e_init_pf_fcoe(struct i40e_pf *pf) | |||
328 | 328 | ||
329 | /** | 329 | /** |
330 | * i40e_get_fcoe_tc_map - Return TC map for FCoE APP | 330 | * i40e_get_fcoe_tc_map - Return TC map for FCoE APP |
331 | * @pf: pointer to pf | 331 | * @pf: pointer to PF |
332 | * | 332 | * |
333 | **/ | 333 | **/ |
334 | u8 i40e_get_fcoe_tc_map(struct i40e_pf *pf) | 334 | u8 i40e_get_fcoe_tc_map(struct i40e_pf *pf) |
@@ -1531,7 +1531,7 @@ void i40e_fcoe_config_netdev(struct net_device *netdev, struct i40e_vsi *vsi) | |||
1531 | 1531 | ||
1532 | /** | 1532 | /** |
1533 | * i40e_fcoe_vsi_setup - allocate and set up FCoE VSI | 1533 | * i40e_fcoe_vsi_setup - allocate and set up FCoE VSI |
1534 | * @pf: the pf that VSI is associated with | 1534 | * @pf: the PF that VSI is associated with |
1535 | * | 1535 | * |
1536 | **/ | 1536 | **/ |
1537 | void i40e_fcoe_vsi_setup(struct i40e_pf *pf) | 1537 | void i40e_fcoe_vsi_setup(struct i40e_pf *pf) |
@@ -1558,7 +1558,7 @@ void i40e_fcoe_vsi_setup(struct i40e_pf *pf) | |||
1558 | vsi = i40e_vsi_setup(pf, I40E_VSI_FCOE, seid, 0); | 1558 | vsi = i40e_vsi_setup(pf, I40E_VSI_FCOE, seid, 0); |
1559 | if (vsi) { | 1559 | if (vsi) { |
1560 | dev_dbg(&pf->pdev->dev, | 1560 | dev_dbg(&pf->pdev->dev, |
1561 | "Successfully created FCoE VSI seid %d id %d uplink_seid %d pf seid %d\n", | 1561 | "Successfully created FCoE VSI seid %d id %d uplink_seid %d PF seid %d\n", |
1562 | vsi->seid, vsi->id, vsi->uplink_seid, seid); | 1562 | vsi->seid, vsi->id, vsi->uplink_seid, seid); |
1563 | } else { | 1563 | } else { |
1564 | dev_info(&pf->pdev->dev, "Failed to create FCoE VSI\n"); | 1564 | dev_info(&pf->pdev->dev, "Failed to create FCoE VSI\n"); |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 4bed881e3cb6..c1eaab532c15 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -39,7 +39,7 @@ static const char i40e_driver_string[] = | |||
39 | 39 | ||
40 | #define DRV_VERSION_MAJOR 1 | 40 | #define DRV_VERSION_MAJOR 1 |
41 | #define DRV_VERSION_MINOR 2 | 41 | #define DRV_VERSION_MINOR 2 |
42 | #define DRV_VERSION_BUILD 12 | 42 | #define DRV_VERSION_BUILD 37 |
43 | #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ | 43 | #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ |
44 | __stringify(DRV_VERSION_MINOR) "." \ | 44 | __stringify(DRV_VERSION_MINOR) "." \ |
45 | __stringify(DRV_VERSION_BUILD) DRV_KERN | 45 | __stringify(DRV_VERSION_BUILD) DRV_KERN |
@@ -450,7 +450,7 @@ void i40e_vsi_reset_stats(struct i40e_vsi *vsi) | |||
450 | } | 450 | } |
451 | 451 | ||
452 | /** | 452 | /** |
453 | * i40e_pf_reset_stats - Reset all of the stats for the given pf | 453 | * i40e_pf_reset_stats - Reset all of the stats for the given PF |
454 | * @pf: the PF to be reset | 454 | * @pf: the PF to be reset |
455 | **/ | 455 | **/ |
456 | void i40e_pf_reset_stats(struct i40e_pf *pf) | 456 | void i40e_pf_reset_stats(struct i40e_pf *pf) |
@@ -896,7 +896,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) | |||
896 | } | 896 | } |
897 | 897 | ||
898 | /** | 898 | /** |
899 | * i40e_update_pf_stats - Update the pf statistics counters. | 899 | * i40e_update_pf_stats - Update the PF statistics counters. |
900 | * @pf: the PF to be updated | 900 | * @pf: the PF to be updated |
901 | **/ | 901 | **/ |
902 | static void i40e_update_pf_stats(struct i40e_pf *pf) | 902 | static void i40e_update_pf_stats(struct i40e_pf *pf) |
@@ -1128,7 +1128,7 @@ void i40e_update_stats(struct i40e_vsi *vsi) | |||
1128 | * @vsi: the VSI to be searched | 1128 | * @vsi: the VSI to be searched |
1129 | * @macaddr: the MAC address | 1129 | * @macaddr: the MAC address |
1130 | * @vlan: the vlan | 1130 | * @vlan: the vlan |
1131 | * @is_vf: make sure its a vf filter, else doesn't matter | 1131 | * @is_vf: make sure its a VF filter, else doesn't matter |
1132 | * @is_netdev: make sure its a netdev filter, else doesn't matter | 1132 | * @is_netdev: make sure its a netdev filter, else doesn't matter |
1133 | * | 1133 | * |
1134 | * Returns ptr to the filter object or NULL | 1134 | * Returns ptr to the filter object or NULL |
@@ -1156,7 +1156,7 @@ static struct i40e_mac_filter *i40e_find_filter(struct i40e_vsi *vsi, | |||
1156 | * i40e_find_mac - Find a mac addr in the macvlan filters list | 1156 | * i40e_find_mac - Find a mac addr in the macvlan filters list |
1157 | * @vsi: the VSI to be searched | 1157 | * @vsi: the VSI to be searched |
1158 | * @macaddr: the MAC address we are searching for | 1158 | * @macaddr: the MAC address we are searching for |
1159 | * @is_vf: make sure its a vf filter, else doesn't matter | 1159 | * @is_vf: make sure its a VF filter, else doesn't matter |
1160 | * @is_netdev: make sure its a netdev filter, else doesn't matter | 1160 | * @is_netdev: make sure its a netdev filter, else doesn't matter |
1161 | * | 1161 | * |
1162 | * Returns the first filter with the provided MAC address or NULL if | 1162 | * Returns the first filter with the provided MAC address or NULL if |
@@ -1204,7 +1204,7 @@ bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi) | |||
1204 | * i40e_put_mac_in_vlan - Make macvlan filters from macaddrs and vlans | 1204 | * i40e_put_mac_in_vlan - Make macvlan filters from macaddrs and vlans |
1205 | * @vsi: the VSI to be searched | 1205 | * @vsi: the VSI to be searched |
1206 | * @macaddr: the mac address to be filtered | 1206 | * @macaddr: the mac address to be filtered |
1207 | * @is_vf: true if it is a vf | 1207 | * @is_vf: true if it is a VF |
1208 | * @is_netdev: true if it is a netdev | 1208 | * @is_netdev: true if it is a netdev |
1209 | * | 1209 | * |
1210 | * Goes through all the macvlan filters and adds a | 1210 | * Goes through all the macvlan filters and adds a |
@@ -1265,7 +1265,7 @@ static int i40e_rm_default_mac_filter(struct i40e_vsi *vsi, u8 *macaddr) | |||
1265 | * @vsi: the VSI to be searched | 1265 | * @vsi: the VSI to be searched |
1266 | * @macaddr: the MAC address | 1266 | * @macaddr: the MAC address |
1267 | * @vlan: the vlan | 1267 | * @vlan: the vlan |
1268 | * @is_vf: make sure its a vf filter, else doesn't matter | 1268 | * @is_vf: make sure its a VF filter, else doesn't matter |
1269 | * @is_netdev: make sure its a netdev filter, else doesn't matter | 1269 | * @is_netdev: make sure its a netdev filter, else doesn't matter |
1270 | * | 1270 | * |
1271 | * Returns ptr to the filter object or NULL when no memory available. | 1271 | * Returns ptr to the filter object or NULL when no memory available. |
@@ -1325,7 +1325,7 @@ add_filter_out: | |||
1325 | * @vsi: the VSI to be searched | 1325 | * @vsi: the VSI to be searched |
1326 | * @macaddr: the MAC address | 1326 | * @macaddr: the MAC address |
1327 | * @vlan: the vlan | 1327 | * @vlan: the vlan |
1328 | * @is_vf: make sure it's a vf filter, else doesn't matter | 1328 | * @is_vf: make sure it's a VF filter, else doesn't matter |
1329 | * @is_netdev: make sure it's a netdev filter, else doesn't matter | 1329 | * @is_netdev: make sure it's a netdev filter, else doesn't matter |
1330 | **/ | 1330 | **/ |
1331 | void i40e_del_filter(struct i40e_vsi *vsi, | 1331 | void i40e_del_filter(struct i40e_vsi *vsi, |
@@ -1352,7 +1352,7 @@ void i40e_del_filter(struct i40e_vsi *vsi, | |||
1352 | f->counter--; | 1352 | f->counter--; |
1353 | } | 1353 | } |
1354 | } else { | 1354 | } else { |
1355 | /* make sure we don't remove a filter in use by vf or netdev */ | 1355 | /* make sure we don't remove a filter in use by VF or netdev */ |
1356 | int min_f = 0; | 1356 | int min_f = 0; |
1357 | min_f += (f->is_vf ? 1 : 0); | 1357 | min_f += (f->is_vf ? 1 : 0); |
1358 | min_f += (f->is_netdev ? 1 : 0); | 1358 | min_f += (f->is_netdev ? 1 : 0); |
@@ -4029,7 +4029,7 @@ static int i40e_pf_wait_txq_disabled(struct i40e_pf *pf) | |||
4029 | #endif | 4029 | #endif |
4030 | /** | 4030 | /** |
4031 | * i40e_get_iscsi_tc_map - Return TC map for iSCSI APP | 4031 | * i40e_get_iscsi_tc_map - Return TC map for iSCSI APP |
4032 | * @pf: pointer to pf | 4032 | * @pf: pointer to PF |
4033 | * | 4033 | * |
4034 | * Get TC map for ISCSI PF type that will include iSCSI TC | 4034 | * Get TC map for ISCSI PF type that will include iSCSI TC |
4035 | * and LAN TC. | 4035 | * and LAN TC. |
@@ -4204,7 +4204,7 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) | |||
4204 | aq_ret = i40e_aq_query_vsi_bw_config(hw, vsi->seid, &bw_config, NULL); | 4204 | aq_ret = i40e_aq_query_vsi_bw_config(hw, vsi->seid, &bw_config, NULL); |
4205 | if (aq_ret) { | 4205 | if (aq_ret) { |
4206 | dev_info(&pf->pdev->dev, | 4206 | dev_info(&pf->pdev->dev, |
4207 | "couldn't get pf vsi bw config, err %d, aq_err %d\n", | 4207 | "couldn't get PF vsi bw config, err %d, aq_err %d\n", |
4208 | aq_ret, pf->hw.aq.asq_last_status); | 4208 | aq_ret, pf->hw.aq.asq_last_status); |
4209 | return -EINVAL; | 4209 | return -EINVAL; |
4210 | } | 4210 | } |
@@ -4214,7 +4214,7 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) | |||
4214 | NULL); | 4214 | NULL); |
4215 | if (aq_ret) { | 4215 | if (aq_ret) { |
4216 | dev_info(&pf->pdev->dev, | 4216 | dev_info(&pf->pdev->dev, |
4217 | "couldn't get pf vsi ets bw config, err %d, aq_err %d\n", | 4217 | "couldn't get PF vsi ets bw config, err %d, aq_err %d\n", |
4218 | aq_ret, pf->hw.aq.asq_last_status); | 4218 | aq_ret, pf->hw.aq.asq_last_status); |
4219 | return -EINVAL; | 4219 | return -EINVAL; |
4220 | } | 4220 | } |
@@ -4976,7 +4976,7 @@ err_setup_tx: | |||
4976 | 4976 | ||
4977 | /** | 4977 | /** |
4978 | * i40e_fdir_filter_exit - Cleans up the Flow Director accounting | 4978 | * i40e_fdir_filter_exit - Cleans up the Flow Director accounting |
4979 | * @pf: Pointer to pf | 4979 | * @pf: Pointer to PF |
4980 | * | 4980 | * |
4981 | * This function destroys the hlist where all the Flow Director | 4981 | * This function destroys the hlist where all the Flow Director |
4982 | * filters were saved. | 4982 | * filters were saved. |
@@ -5941,7 +5941,7 @@ static void i40e_verify_eeprom(struct i40e_pf *pf) | |||
5941 | 5941 | ||
5942 | /** | 5942 | /** |
5943 | * i40e_enable_pf_switch_lb | 5943 | * i40e_enable_pf_switch_lb |
5944 | * @pf: pointer to the pf structure | 5944 | * @pf: pointer to the PF structure |
5945 | * | 5945 | * |
5946 | * enable switch loop back or die - no point in a return value | 5946 | * enable switch loop back or die - no point in a return value |
5947 | **/ | 5947 | **/ |
@@ -5957,7 +5957,7 @@ static void i40e_enable_pf_switch_lb(struct i40e_pf *pf) | |||
5957 | aq_ret = i40e_aq_get_vsi_params(&pf->hw, &ctxt, NULL); | 5957 | aq_ret = i40e_aq_get_vsi_params(&pf->hw, &ctxt, NULL); |
5958 | if (aq_ret) { | 5958 | if (aq_ret) { |
5959 | dev_info(&pf->pdev->dev, | 5959 | dev_info(&pf->pdev->dev, |
5960 | "%s couldn't get pf vsi config, err %d, aq_err %d\n", | 5960 | "%s couldn't get PF vsi config, err %d, aq_err %d\n", |
5961 | __func__, aq_ret, pf->hw.aq.asq_last_status); | 5961 | __func__, aq_ret, pf->hw.aq.asq_last_status); |
5962 | return; | 5962 | return; |
5963 | } | 5963 | } |
@@ -5975,7 +5975,7 @@ static void i40e_enable_pf_switch_lb(struct i40e_pf *pf) | |||
5975 | 5975 | ||
5976 | /** | 5976 | /** |
5977 | * i40e_disable_pf_switch_lb | 5977 | * i40e_disable_pf_switch_lb |
5978 | * @pf: pointer to the pf structure | 5978 | * @pf: pointer to the PF structure |
5979 | * | 5979 | * |
5980 | * disable switch loop back or die - no point in a return value | 5980 | * disable switch loop back or die - no point in a return value |
5981 | **/ | 5981 | **/ |
@@ -5991,7 +5991,7 @@ static void i40e_disable_pf_switch_lb(struct i40e_pf *pf) | |||
5991 | aq_ret = i40e_aq_get_vsi_params(&pf->hw, &ctxt, NULL); | 5991 | aq_ret = i40e_aq_get_vsi_params(&pf->hw, &ctxt, NULL); |
5992 | if (aq_ret) { | 5992 | if (aq_ret) { |
5993 | dev_info(&pf->pdev->dev, | 5993 | dev_info(&pf->pdev->dev, |
5994 | "%s couldn't get pf vsi config, err %d, aq_err %d\n", | 5994 | "%s couldn't get PF vsi config, err %d, aq_err %d\n", |
5995 | __func__, aq_ret, pf->hw.aq.asq_last_status); | 5995 | __func__, aq_ret, pf->hw.aq.asq_last_status); |
5996 | return; | 5996 | return; |
5997 | } | 5997 | } |
@@ -6245,7 +6245,7 @@ static void i40e_fdir_teardown(struct i40e_pf *pf) | |||
6245 | * i40e_prep_for_reset - prep for the core to reset | 6245 | * i40e_prep_for_reset - prep for the core to reset |
6246 | * @pf: board private structure | 6246 | * @pf: board private structure |
6247 | * | 6247 | * |
6248 | * Close up the VFs and other things in prep for pf Reset. | 6248 | * Close up the VFs and other things in prep for PF Reset. |
6249 | **/ | 6249 | **/ |
6250 | static void i40e_prep_for_reset(struct i40e_pf *pf) | 6250 | static void i40e_prep_for_reset(struct i40e_pf *pf) |
6251 | { | 6251 | { |
@@ -6471,7 +6471,7 @@ clear_recovery: | |||
6471 | } | 6471 | } |
6472 | 6472 | ||
6473 | /** | 6473 | /** |
6474 | * i40e_handle_reset_warning - prep for the pf to reset, reset and rebuild | 6474 | * i40e_handle_reset_warning - prep for the PF to reset, reset and rebuild |
6475 | * @pf: board private structure | 6475 | * @pf: board private structure |
6476 | * | 6476 | * |
6477 | * Close up the VFs and other things in prep for a Core Reset, | 6477 | * Close up the VFs and other things in prep for a Core Reset, |
@@ -6485,7 +6485,7 @@ static void i40e_handle_reset_warning(struct i40e_pf *pf) | |||
6485 | 6485 | ||
6486 | /** | 6486 | /** |
6487 | * i40e_handle_mdd_event | 6487 | * i40e_handle_mdd_event |
6488 | * @pf: pointer to the pf structure | 6488 | * @pf: pointer to the PF structure |
6489 | * | 6489 | * |
6490 | * Called from the MDD irq handler to identify possibly malicious vfs | 6490 | * Called from the MDD irq handler to identify possibly malicious vfs |
6491 | **/ | 6491 | **/ |
@@ -6514,7 +6514,7 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf) | |||
6514 | I40E_GL_MDET_TX_QUEUE_SHIFT) - | 6514 | I40E_GL_MDET_TX_QUEUE_SHIFT) - |
6515 | pf->hw.func_caps.base_queue; | 6515 | pf->hw.func_caps.base_queue; |
6516 | if (netif_msg_tx_err(pf)) | 6516 | if (netif_msg_tx_err(pf)) |
6517 | dev_info(&pf->pdev->dev, "Malicious Driver Detection event 0x%02x on TX queue %d pf number 0x%02x vf number 0x%02x\n", | 6517 | dev_info(&pf->pdev->dev, "Malicious Driver Detection event 0x%02x on TX queue %d PF number 0x%02x VF number 0x%02x\n", |
6518 | event, queue, pf_num, vf_num); | 6518 | event, queue, pf_num, vf_num); |
6519 | wr32(hw, I40E_GL_MDET_TX, 0xffffffff); | 6519 | wr32(hw, I40E_GL_MDET_TX, 0xffffffff); |
6520 | mdd_detected = true; | 6520 | mdd_detected = true; |
@@ -6917,7 +6917,7 @@ static int i40e_vsi_clear(struct i40e_vsi *vsi) | |||
6917 | goto unlock_vsi; | 6917 | goto unlock_vsi; |
6918 | } | 6918 | } |
6919 | 6919 | ||
6920 | /* updates the pf for this cleared vsi */ | 6920 | /* updates the PF for this cleared vsi */ |
6921 | i40e_put_lump(pf->qp_pile, vsi->base_queue, vsi->idx); | 6921 | i40e_put_lump(pf->qp_pile, vsi->base_queue, vsi->idx); |
6922 | i40e_put_lump(pf->irq_pile, vsi->base_vector, vsi->idx); | 6922 | i40e_put_lump(pf->irq_pile, vsi->base_vector, vsi->idx); |
6923 | 6923 | ||
@@ -7491,7 +7491,7 @@ i40e_status i40e_set_npar_bw_setting(struct i40e_pf *pf) | |||
7491 | struct i40e_aqc_configure_partition_bw_data bw_data; | 7491 | struct i40e_aqc_configure_partition_bw_data bw_data; |
7492 | i40e_status status; | 7492 | i40e_status status; |
7493 | 7493 | ||
7494 | /* Set the valid bit for this pf */ | 7494 | /* Set the valid bit for this PF */ |
7495 | bw_data.pf_valid_bits = cpu_to_le16(1 << pf->hw.pf_id); | 7495 | bw_data.pf_valid_bits = cpu_to_le16(1 << pf->hw.pf_id); |
7496 | bw_data.max_bw[pf->hw.pf_id] = pf->npar_max_bw & I40E_ALT_BW_VALUE_MASK; | 7496 | bw_data.max_bw[pf->hw.pf_id] = pf->npar_max_bw & I40E_ALT_BW_VALUE_MASK; |
7497 | bw_data.min_bw[pf->hw.pf_id] = pf->npar_min_bw & I40E_ALT_BW_VALUE_MASK; | 7497 | bw_data.min_bw[pf->hw.pf_id] = pf->npar_min_bw & I40E_ALT_BW_VALUE_MASK; |
@@ -7649,11 +7649,11 @@ static int i40e_sw_init(struct i40e_pf *pf) | |||
7649 | (pf->hw.func_caps.fd_filters_best_effort > 0)) { | 7649 | (pf->hw.func_caps.fd_filters_best_effort > 0)) { |
7650 | pf->flags |= I40E_FLAG_FD_ATR_ENABLED; | 7650 | pf->flags |= I40E_FLAG_FD_ATR_ENABLED; |
7651 | pf->atr_sample_rate = I40E_DEFAULT_ATR_SAMPLE_RATE; | 7651 | pf->atr_sample_rate = I40E_DEFAULT_ATR_SAMPLE_RATE; |
7652 | /* Setup a counter for fd_atr per pf */ | 7652 | /* Setup a counter for fd_atr per PF */ |
7653 | pf->fd_atr_cnt_idx = I40E_FD_ATR_STAT_IDX(pf->hw.pf_id); | 7653 | pf->fd_atr_cnt_idx = I40E_FD_ATR_STAT_IDX(pf->hw.pf_id); |
7654 | if (!(pf->flags & I40E_FLAG_MFP_ENABLED)) { | 7654 | if (!(pf->flags & I40E_FLAG_MFP_ENABLED)) { |
7655 | pf->flags |= I40E_FLAG_FD_SB_ENABLED; | 7655 | pf->flags |= I40E_FLAG_FD_SB_ENABLED; |
7656 | /* Setup a counter for fd_sb per pf */ | 7656 | /* Setup a counter for fd_sb per PF */ |
7657 | pf->fd_sb_cnt_idx = I40E_FD_SB_STAT_IDX(pf->hw.pf_id); | 7657 | pf->fd_sb_cnt_idx = I40E_FD_SB_STAT_IDX(pf->hw.pf_id); |
7658 | } else { | 7658 | } else { |
7659 | dev_info(&pf->pdev->dev, | 7659 | dev_info(&pf->pdev->dev, |
@@ -8257,7 +8257,7 @@ static int i40e_add_vsi(struct i40e_vsi *vsi) | |||
8257 | ctxt.flags = I40E_AQ_VSI_TYPE_PF; | 8257 | ctxt.flags = I40E_AQ_VSI_TYPE_PF; |
8258 | if (ret) { | 8258 | if (ret) { |
8259 | dev_info(&pf->pdev->dev, | 8259 | dev_info(&pf->pdev->dev, |
8260 | "couldn't get pf vsi config, err %d, aq_err %d\n", | 8260 | "couldn't get PF vsi config, err %d, aq_err %d\n", |
8261 | ret, pf->hw.aq.asq_last_status); | 8261 | ret, pf->hw.aq.asq_last_status); |
8262 | return -ENOENT; | 8262 | return -ENOENT; |
8263 | } | 8263 | } |
@@ -9158,7 +9158,7 @@ err_alloc: | |||
9158 | } | 9158 | } |
9159 | 9159 | ||
9160 | /** | 9160 | /** |
9161 | * i40e_setup_pf_switch_element - set pf vars based on switch type | 9161 | * i40e_setup_pf_switch_element - set PF vars based on switch type |
9162 | * @pf: board private structure | 9162 | * @pf: board private structure |
9163 | * @ele: element we are building info from | 9163 | * @ele: element we are building info from |
9164 | * @num_reported: total number of elements | 9164 | * @num_reported: total number of elements |
@@ -9491,7 +9491,7 @@ static void i40e_determine_queue_usage(struct i40e_pf *pf) | |||
9491 | * i40e_setup_pf_filter_control - Setup PF static filter control | 9491 | * i40e_setup_pf_filter_control - Setup PF static filter control |
9492 | * @pf: PF to be setup | 9492 | * @pf: PF to be setup |
9493 | * | 9493 | * |
9494 | * i40e_setup_pf_filter_control sets up a pf's initial filter control | 9494 | * i40e_setup_pf_filter_control sets up a PF's initial filter control |
9495 | * settings. If PE/FCoE are enabled then it will also set the per PF | 9495 | * settings. If PE/FCoE are enabled then it will also set the per PF |
9496 | * based filter sizes required for them. It also enables Flow director, | 9496 | * based filter sizes required for them. It also enables Flow director, |
9497 | * ethertype and macvlan type filter settings for the pf. | 9497 | * ethertype and macvlan type filter settings for the pf. |
@@ -9568,8 +9568,8 @@ static void i40e_print_features(struct i40e_pf *pf) | |||
9568 | * @pdev: PCI device information struct | 9568 | * @pdev: PCI device information struct |
9569 | * @ent: entry in i40e_pci_tbl | 9569 | * @ent: entry in i40e_pci_tbl |
9570 | * | 9570 | * |
9571 | * i40e_probe initializes a pf identified by a pci_dev structure. | 9571 | * i40e_probe initializes a PF identified by a pci_dev structure. |
9572 | * The OS initialization, configuring of the pf private structure, | 9572 | * The OS initialization, configuring of the PF private structure, |
9573 | * and a hardware reset occur. | 9573 | * and a hardware reset occur. |
9574 | * | 9574 | * |
9575 | * Returns 0 on success, negative on failure | 9575 | * Returns 0 on success, negative on failure |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index f5a50b9366cb..9b11f2e7e361 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -45,7 +45,7 @@ static inline __le64 build_ctob(u32 td_cmd, u32 td_offset, unsigned int size, | |||
45 | * i40e_program_fdir_filter - Program a Flow Director filter | 45 | * i40e_program_fdir_filter - Program a Flow Director filter |
46 | * @fdir_data: Packet data that will be filter parameters | 46 | * @fdir_data: Packet data that will be filter parameters |
47 | * @raw_packet: the pre-allocated packet buffer for FDir | 47 | * @raw_packet: the pre-allocated packet buffer for FDir |
48 | * @pf: The pf pointer | 48 | * @pf: The PF pointer |
49 | * @add: True for add/update, False for remove | 49 | * @add: True for add/update, False for remove |
50 | **/ | 50 | **/ |
51 | int i40e_program_fdir_filter(struct i40e_fdir_filter *fdir_data, u8 *raw_packet, | 51 | int i40e_program_fdir_filter(struct i40e_fdir_filter *fdir_data, u8 *raw_packet, |
@@ -859,6 +859,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget) | |||
859 | static void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector) | 859 | static void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector) |
860 | { | 860 | { |
861 | u32 val = I40E_PFINT_DYN_CTLN_INTENA_MASK | | 861 | u32 val = I40E_PFINT_DYN_CTLN_INTENA_MASK | |
862 | I40E_PFINT_DYN_CTLN_ITR_INDX_MASK | /* set noitr */ | ||
862 | I40E_PFINT_DYN_CTLN_SWINT_TRIG_MASK | | 863 | I40E_PFINT_DYN_CTLN_SWINT_TRIG_MASK | |
863 | I40E_PFINT_DYN_CTLN_SW_ITR_INDX_ENA_MASK; | 864 | I40E_PFINT_DYN_CTLN_SW_ITR_INDX_ENA_MASK; |
864 | /* allow 00 to be written to the index */ | 865 | /* allow 00 to be written to the index */ |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index 7cc635e4c2e4..0a93684130b9 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | |||
@@ -30,8 +30,8 @@ | |||
30 | 30 | ||
31 | /** | 31 | /** |
32 | * i40e_vc_disable_vf | 32 | * i40e_vc_disable_vf |
33 | * @pf: pointer to the pf info | 33 | * @pf: pointer to the PF info |
34 | * @vf: pointer to the vf info | 34 | * @vf: pointer to the VF info |
35 | * | 35 | * |
36 | * Disable the VF through a SW reset | 36 | * Disable the VF through a SW reset |
37 | **/ | 37 | **/ |
@@ -48,10 +48,10 @@ static inline void i40e_vc_disable_vf(struct i40e_pf *pf, struct i40e_vf *vf) | |||
48 | 48 | ||
49 | /** | 49 | /** |
50 | * i40e_vc_isvalid_vsi_id | 50 | * i40e_vc_isvalid_vsi_id |
51 | * @vf: pointer to the vf info | 51 | * @vf: pointer to the VF info |
52 | * @vsi_id: vf relative vsi id | 52 | * @vsi_id: VF relative VSI id |
53 | * | 53 | * |
54 | * check for the valid vsi id | 54 | * check for the valid VSI id |
55 | **/ | 55 | **/ |
56 | static inline bool i40e_vc_isvalid_vsi_id(struct i40e_vf *vf, u8 vsi_id) | 56 | static inline bool i40e_vc_isvalid_vsi_id(struct i40e_vf *vf, u8 vsi_id) |
57 | { | 57 | { |
@@ -62,7 +62,7 @@ static inline bool i40e_vc_isvalid_vsi_id(struct i40e_vf *vf, u8 vsi_id) | |||
62 | 62 | ||
63 | /** | 63 | /** |
64 | * i40e_vc_isvalid_queue_id | 64 | * i40e_vc_isvalid_queue_id |
65 | * @vf: pointer to the vf info | 65 | * @vf: pointer to the VF info |
66 | * @vsi_id: vsi id | 66 | * @vsi_id: vsi id |
67 | * @qid: vsi relative queue id | 67 | * @qid: vsi relative queue id |
68 | * | 68 | * |
@@ -78,8 +78,8 @@ static inline bool i40e_vc_isvalid_queue_id(struct i40e_vf *vf, u8 vsi_id, | |||
78 | 78 | ||
79 | /** | 79 | /** |
80 | * i40e_vc_isvalid_vector_id | 80 | * i40e_vc_isvalid_vector_id |
81 | * @vf: pointer to the vf info | 81 | * @vf: pointer to the VF info |
82 | * @vector_id: vf relative vector id | 82 | * @vector_id: VF relative vector id |
83 | * | 83 | * |
84 | * check for the valid vector id | 84 | * check for the valid vector id |
85 | **/ | 85 | **/ |
@@ -94,11 +94,11 @@ static inline bool i40e_vc_isvalid_vector_id(struct i40e_vf *vf, u8 vector_id) | |||
94 | 94 | ||
95 | /** | 95 | /** |
96 | * i40e_vc_get_pf_queue_id | 96 | * i40e_vc_get_pf_queue_id |
97 | * @vf: pointer to the vf info | 97 | * @vf: pointer to the VF info |
98 | * @vsi_idx: index of VSI in PF struct | 98 | * @vsi_idx: index of VSI in PF struct |
99 | * @vsi_queue_id: vsi relative queue id | 99 | * @vsi_queue_id: vsi relative queue id |
100 | * | 100 | * |
101 | * return pf relative queue id | 101 | * return PF relative queue id |
102 | **/ | 102 | **/ |
103 | static u16 i40e_vc_get_pf_queue_id(struct i40e_vf *vf, u8 vsi_idx, | 103 | static u16 i40e_vc_get_pf_queue_id(struct i40e_vf *vf, u8 vsi_idx, |
104 | u8 vsi_queue_id) | 104 | u8 vsi_queue_id) |
@@ -120,7 +120,7 @@ static u16 i40e_vc_get_pf_queue_id(struct i40e_vf *vf, u8 vsi_idx, | |||
120 | 120 | ||
121 | /** | 121 | /** |
122 | * i40e_config_irq_link_list | 122 | * i40e_config_irq_link_list |
123 | * @vf: pointer to the vf info | 123 | * @vf: pointer to the VF info |
124 | * @vsi_idx: index of VSI in PF struct | 124 | * @vsi_idx: index of VSI in PF struct |
125 | * @vecmap: irq map info | 125 | * @vecmap: irq map info |
126 | * | 126 | * |
@@ -220,7 +220,7 @@ irq_list_done: | |||
220 | 220 | ||
221 | /** | 221 | /** |
222 | * i40e_config_vsi_tx_queue | 222 | * i40e_config_vsi_tx_queue |
223 | * @vf: pointer to the vf info | 223 | * @vf: pointer to the VF info |
224 | * @vsi_idx: index of VSI in PF struct | 224 | * @vsi_idx: index of VSI in PF struct |
225 | * @vsi_queue_id: vsi relative queue index | 225 | * @vsi_queue_id: vsi relative queue index |
226 | * @info: config. info | 226 | * @info: config. info |
@@ -287,7 +287,7 @@ error_context: | |||
287 | 287 | ||
288 | /** | 288 | /** |
289 | * i40e_config_vsi_rx_queue | 289 | * i40e_config_vsi_rx_queue |
290 | * @vf: pointer to the vf info | 290 | * @vf: pointer to the VF info |
291 | * @vsi_idx: index of VSI in PF struct | 291 | * @vsi_idx: index of VSI in PF struct |
292 | * @vsi_queue_id: vsi relative queue index | 292 | * @vsi_queue_id: vsi relative queue index |
293 | * @info: config. info | 293 | * @info: config. info |
@@ -378,10 +378,10 @@ error_param: | |||
378 | 378 | ||
379 | /** | 379 | /** |
380 | * i40e_alloc_vsi_res | 380 | * i40e_alloc_vsi_res |
381 | * @vf: pointer to the vf info | 381 | * @vf: pointer to the VF info |
382 | * @type: type of VSI to allocate | 382 | * @type: type of VSI to allocate |
383 | * | 383 | * |
384 | * alloc vf vsi context & resources | 384 | * alloc VF vsi context & resources |
385 | **/ | 385 | **/ |
386 | static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type) | 386 | static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type) |
387 | { | 387 | { |
@@ -394,7 +394,7 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type) | |||
394 | 394 | ||
395 | if (!vsi) { | 395 | if (!vsi) { |
396 | dev_err(&pf->pdev->dev, | 396 | dev_err(&pf->pdev->dev, |
397 | "add vsi failed for vf %d, aq_err %d\n", | 397 | "add vsi failed for VF %d, aq_err %d\n", |
398 | vf->vf_id, pf->hw.aq.asq_last_status); | 398 | vf->vf_id, pf->hw.aq.asq_last_status); |
399 | ret = -ENOENT; | 399 | ret = -ENOENT; |
400 | goto error_alloc_vsi_res; | 400 | goto error_alloc_vsi_res; |
@@ -443,9 +443,9 @@ error_alloc_vsi_res: | |||
443 | 443 | ||
444 | /** | 444 | /** |
445 | * i40e_enable_vf_mappings | 445 | * i40e_enable_vf_mappings |
446 | * @vf: pointer to the vf info | 446 | * @vf: pointer to the VF info |
447 | * | 447 | * |
448 | * enable vf mappings | 448 | * enable VF mappings |
449 | **/ | 449 | **/ |
450 | static void i40e_enable_vf_mappings(struct i40e_vf *vf) | 450 | static void i40e_enable_vf_mappings(struct i40e_vf *vf) |
451 | { | 451 | { |
@@ -493,9 +493,9 @@ static void i40e_enable_vf_mappings(struct i40e_vf *vf) | |||
493 | 493 | ||
494 | /** | 494 | /** |
495 | * i40e_disable_vf_mappings | 495 | * i40e_disable_vf_mappings |
496 | * @vf: pointer to the vf info | 496 | * @vf: pointer to the VF info |
497 | * | 497 | * |
498 | * disable vf mappings | 498 | * disable VF mappings |
499 | **/ | 499 | **/ |
500 | static void i40e_disable_vf_mappings(struct i40e_vf *vf) | 500 | static void i40e_disable_vf_mappings(struct i40e_vf *vf) |
501 | { | 501 | { |
@@ -513,9 +513,9 @@ static void i40e_disable_vf_mappings(struct i40e_vf *vf) | |||
513 | 513 | ||
514 | /** | 514 | /** |
515 | * i40e_free_vf_res | 515 | * i40e_free_vf_res |
516 | * @vf: pointer to the vf info | 516 | * @vf: pointer to the VF info |
517 | * | 517 | * |
518 | * free vf resources | 518 | * free VF resources |
519 | **/ | 519 | **/ |
520 | static void i40e_free_vf_res(struct i40e_vf *vf) | 520 | static void i40e_free_vf_res(struct i40e_vf *vf) |
521 | { | 521 | { |
@@ -568,9 +568,9 @@ static void i40e_free_vf_res(struct i40e_vf *vf) | |||
568 | 568 | ||
569 | /** | 569 | /** |
570 | * i40e_alloc_vf_res | 570 | * i40e_alloc_vf_res |
571 | * @vf: pointer to the vf info | 571 | * @vf: pointer to the VF info |
572 | * | 572 | * |
573 | * allocate vf resources | 573 | * allocate VF resources |
574 | **/ | 574 | **/ |
575 | static int i40e_alloc_vf_res(struct i40e_vf *vf) | 575 | static int i40e_alloc_vf_res(struct i40e_vf *vf) |
576 | { | 576 | { |
@@ -586,11 +586,11 @@ static int i40e_alloc_vf_res(struct i40e_vf *vf) | |||
586 | set_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps); | 586 | set_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps); |
587 | 587 | ||
588 | /* store the total qps number for the runtime | 588 | /* store the total qps number for the runtime |
589 | * vf req validation | 589 | * VF req validation |
590 | */ | 590 | */ |
591 | vf->num_queue_pairs = total_queue_pairs; | 591 | vf->num_queue_pairs = total_queue_pairs; |
592 | 592 | ||
593 | /* vf is now completely initialized */ | 593 | /* VF is now completely initialized */ |
594 | set_bit(I40E_VF_STAT_INIT, &vf->vf_states); | 594 | set_bit(I40E_VF_STAT_INIT, &vf->vf_states); |
595 | 595 | ||
596 | error_alloc: | 596 | error_alloc: |
@@ -604,7 +604,7 @@ error_alloc: | |||
604 | #define VF_TRANS_PENDING_MASK 0x20 | 604 | #define VF_TRANS_PENDING_MASK 0x20 |
605 | /** | 605 | /** |
606 | * i40e_quiesce_vf_pci | 606 | * i40e_quiesce_vf_pci |
607 | * @vf: pointer to the vf structure | 607 | * @vf: pointer to the VF structure |
608 | * | 608 | * |
609 | * Wait for VF PCI transactions to be cleared after reset. Returns -EIO | 609 | * Wait for VF PCI transactions to be cleared after reset. Returns -EIO |
610 | * if the transactions never clear. | 610 | * if the transactions never clear. |
@@ -631,10 +631,10 @@ static int i40e_quiesce_vf_pci(struct i40e_vf *vf) | |||
631 | 631 | ||
632 | /** | 632 | /** |
633 | * i40e_reset_vf | 633 | * i40e_reset_vf |
634 | * @vf: pointer to the vf structure | 634 | * @vf: pointer to the VF structure |
635 | * @flr: VFLR was issued or not | 635 | * @flr: VFLR was issued or not |
636 | * | 636 | * |
637 | * reset the vf | 637 | * reset the VF |
638 | **/ | 638 | **/ |
639 | void i40e_reset_vf(struct i40e_vf *vf, bool flr) | 639 | void i40e_reset_vf(struct i40e_vf *vf, bool flr) |
640 | { | 640 | { |
@@ -654,7 +654,7 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr) | |||
654 | * just need to clean up, so don't hit the VFRTRIG register. | 654 | * just need to clean up, so don't hit the VFRTRIG register. |
655 | */ | 655 | */ |
656 | if (!flr) { | 656 | if (!flr) { |
657 | /* reset vf using VPGEN_VFRTRIG reg */ | 657 | /* reset VF using VPGEN_VFRTRIG reg */ |
658 | reg = rd32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id)); | 658 | reg = rd32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id)); |
659 | reg |= I40E_VPGEN_VFRTRIG_VFSWR_MASK; | 659 | reg |= I40E_VPGEN_VFRTRIG_VFSWR_MASK; |
660 | wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg); | 660 | wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg); |
@@ -697,7 +697,7 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr) | |||
697 | 697 | ||
698 | i40e_vsi_control_rings(pf->vsi[vf->lan_vsi_index], false); | 698 | i40e_vsi_control_rings(pf->vsi[vf->lan_vsi_index], false); |
699 | complete_reset: | 699 | complete_reset: |
700 | /* reallocate vf resources to reset the VSI state */ | 700 | /* reallocate VF resources to reset the VSI state */ |
701 | i40e_free_vf_res(vf); | 701 | i40e_free_vf_res(vf); |
702 | i40e_alloc_vf_res(vf); | 702 | i40e_alloc_vf_res(vf); |
703 | i40e_enable_vf_mappings(vf); | 703 | i40e_enable_vf_mappings(vf); |
@@ -711,9 +711,9 @@ complete_reset: | |||
711 | 711 | ||
712 | /** | 712 | /** |
713 | * i40e_free_vfs | 713 | * i40e_free_vfs |
714 | * @pf: pointer to the pf structure | 714 | * @pf: pointer to the PF structure |
715 | * | 715 | * |
716 | * free vf resources | 716 | * free VF resources |
717 | **/ | 717 | **/ |
718 | void i40e_free_vfs(struct i40e_pf *pf) | 718 | void i40e_free_vfs(struct i40e_pf *pf) |
719 | { | 719 | { |
@@ -735,7 +735,7 @@ void i40e_free_vfs(struct i40e_pf *pf) | |||
735 | 735 | ||
736 | msleep(20); /* let any messages in transit get finished up */ | 736 | msleep(20); /* let any messages in transit get finished up */ |
737 | 737 | ||
738 | /* free up vf resources */ | 738 | /* free up VF resources */ |
739 | tmp = pf->num_alloc_vfs; | 739 | tmp = pf->num_alloc_vfs; |
740 | pf->num_alloc_vfs = 0; | 740 | pf->num_alloc_vfs = 0; |
741 | for (i = 0; i < tmp; i++) { | 741 | for (i = 0; i < tmp; i++) { |
@@ -771,10 +771,10 @@ void i40e_free_vfs(struct i40e_pf *pf) | |||
771 | #ifdef CONFIG_PCI_IOV | 771 | #ifdef CONFIG_PCI_IOV |
772 | /** | 772 | /** |
773 | * i40e_alloc_vfs | 773 | * i40e_alloc_vfs |
774 | * @pf: pointer to the pf structure | 774 | * @pf: pointer to the PF structure |
775 | * @num_alloc_vfs: number of vfs to allocate | 775 | * @num_alloc_vfs: number of VFs to allocate |
776 | * | 776 | * |
777 | * allocate vf resources | 777 | * allocate VF resources |
778 | **/ | 778 | **/ |
779 | int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs) | 779 | int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs) |
780 | { | 780 | { |
@@ -811,10 +811,10 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs) | |||
811 | /* assign default capabilities */ | 811 | /* assign default capabilities */ |
812 | set_bit(I40E_VIRTCHNL_VF_CAP_L2, &vfs[i].vf_caps); | 812 | set_bit(I40E_VIRTCHNL_VF_CAP_L2, &vfs[i].vf_caps); |
813 | vfs[i].spoofchk = true; | 813 | vfs[i].spoofchk = true; |
814 | /* vf resources get allocated during reset */ | 814 | /* VF resources get allocated during reset */ |
815 | i40e_reset_vf(&vfs[i], false); | 815 | i40e_reset_vf(&vfs[i], false); |
816 | 816 | ||
817 | /* enable vf vplan_qtable mappings */ | 817 | /* enable VF vplan_qtable mappings */ |
818 | i40e_enable_vf_mappings(&vfs[i]); | 818 | i40e_enable_vf_mappings(&vfs[i]); |
819 | } | 819 | } |
820 | pf->num_alloc_vfs = num_alloc_vfs; | 820 | pf->num_alloc_vfs = num_alloc_vfs; |
@@ -832,7 +832,7 @@ err_iov: | |||
832 | /** | 832 | /** |
833 | * i40e_pci_sriov_enable | 833 | * i40e_pci_sriov_enable |
834 | * @pdev: pointer to a pci_dev structure | 834 | * @pdev: pointer to a pci_dev structure |
835 | * @num_vfs: number of vfs to allocate | 835 | * @num_vfs: number of VFs to allocate |
836 | * | 836 | * |
837 | * Enable or change the number of VFs | 837 | * Enable or change the number of VFs |
838 | **/ | 838 | **/ |
@@ -872,7 +872,7 @@ err_out: | |||
872 | /** | 872 | /** |
873 | * i40e_pci_sriov_configure | 873 | * i40e_pci_sriov_configure |
874 | * @pdev: pointer to a pci_dev structure | 874 | * @pdev: pointer to a pci_dev structure |
875 | * @num_vfs: number of vfs to allocate | 875 | * @num_vfs: number of VFs to allocate |
876 | * | 876 | * |
877 | * Enable or change the number of VFs. Called when the user updates the number | 877 | * Enable or change the number of VFs. Called when the user updates the number |
878 | * of VFs in sysfs. | 878 | * of VFs in sysfs. |
@@ -897,13 +897,13 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs) | |||
897 | 897 | ||
898 | /** | 898 | /** |
899 | * i40e_vc_send_msg_to_vf | 899 | * i40e_vc_send_msg_to_vf |
900 | * @vf: pointer to the vf info | 900 | * @vf: pointer to the VF info |
901 | * @v_opcode: virtual channel opcode | 901 | * @v_opcode: virtual channel opcode |
902 | * @v_retval: virtual channel return value | 902 | * @v_retval: virtual channel return value |
903 | * @msg: pointer to the msg buffer | 903 | * @msg: pointer to the msg buffer |
904 | * @msglen: msg length | 904 | * @msglen: msg length |
905 | * | 905 | * |
906 | * send msg to vf | 906 | * send msg to VF |
907 | **/ | 907 | **/ |
908 | static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode, | 908 | static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode, |
909 | u32 v_retval, u8 *msg, u16 msglen) | 909 | u32 v_retval, u8 *msg, u16 msglen) |
@@ -952,11 +952,11 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode, | |||
952 | 952 | ||
953 | /** | 953 | /** |
954 | * i40e_vc_send_resp_to_vf | 954 | * i40e_vc_send_resp_to_vf |
955 | * @vf: pointer to the vf info | 955 | * @vf: pointer to the VF info |
956 | * @opcode: operation code | 956 | * @opcode: operation code |
957 | * @retval: return value | 957 | * @retval: return value |
958 | * | 958 | * |
959 | * send resp msg to vf | 959 | * send resp msg to VF |
960 | **/ | 960 | **/ |
961 | static int i40e_vc_send_resp_to_vf(struct i40e_vf *vf, | 961 | static int i40e_vc_send_resp_to_vf(struct i40e_vf *vf, |
962 | enum i40e_virtchnl_ops opcode, | 962 | enum i40e_virtchnl_ops opcode, |
@@ -967,9 +967,9 @@ static int i40e_vc_send_resp_to_vf(struct i40e_vf *vf, | |||
967 | 967 | ||
968 | /** | 968 | /** |
969 | * i40e_vc_get_version_msg | 969 | * i40e_vc_get_version_msg |
970 | * @vf: pointer to the vf info | 970 | * @vf: pointer to the VF info |
971 | * | 971 | * |
972 | * called from the vf to request the API version used by the PF | 972 | * called from the VF to request the API version used by the PF |
973 | **/ | 973 | **/ |
974 | static int i40e_vc_get_version_msg(struct i40e_vf *vf) | 974 | static int i40e_vc_get_version_msg(struct i40e_vf *vf) |
975 | { | 975 | { |
@@ -985,11 +985,11 @@ static int i40e_vc_get_version_msg(struct i40e_vf *vf) | |||
985 | 985 | ||
986 | /** | 986 | /** |
987 | * i40e_vc_get_vf_resources_msg | 987 | * i40e_vc_get_vf_resources_msg |
988 | * @vf: pointer to the vf info | 988 | * @vf: pointer to the VF info |
989 | * @msg: pointer to the msg buffer | 989 | * @msg: pointer to the msg buffer |
990 | * @msglen: msg length | 990 | * @msglen: msg length |
991 | * | 991 | * |
992 | * called from the vf to request its resources | 992 | * called from the VF to request its resources |
993 | **/ | 993 | **/ |
994 | static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf) | 994 | static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf) |
995 | { | 995 | { |
@@ -1036,7 +1036,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf) | |||
1036 | set_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states); | 1036 | set_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states); |
1037 | 1037 | ||
1038 | err: | 1038 | err: |
1039 | /* send the response back to the vf */ | 1039 | /* send the response back to the VF */ |
1040 | ret = i40e_vc_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_GET_VF_RESOURCES, | 1040 | ret = i40e_vc_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_GET_VF_RESOURCES, |
1041 | aq_ret, (u8 *)vfres, len); | 1041 | aq_ret, (u8 *)vfres, len); |
1042 | 1042 | ||
@@ -1046,13 +1046,13 @@ err: | |||
1046 | 1046 | ||
1047 | /** | 1047 | /** |
1048 | * i40e_vc_reset_vf_msg | 1048 | * i40e_vc_reset_vf_msg |
1049 | * @vf: pointer to the vf info | 1049 | * @vf: pointer to the VF info |
1050 | * @msg: pointer to the msg buffer | 1050 | * @msg: pointer to the msg buffer |
1051 | * @msglen: msg length | 1051 | * @msglen: msg length |
1052 | * | 1052 | * |
1053 | * called from the vf to reset itself, | 1053 | * called from the VF to reset itself, |
1054 | * unlike other virtchnl messages, pf driver | 1054 | * unlike other virtchnl messages, PF driver |
1055 | * doesn't send the response back to the vf | 1055 | * doesn't send the response back to the VF |
1056 | **/ | 1056 | **/ |
1057 | static void i40e_vc_reset_vf_msg(struct i40e_vf *vf) | 1057 | static void i40e_vc_reset_vf_msg(struct i40e_vf *vf) |
1058 | { | 1058 | { |
@@ -1062,12 +1062,12 @@ static void i40e_vc_reset_vf_msg(struct i40e_vf *vf) | |||
1062 | 1062 | ||
1063 | /** | 1063 | /** |
1064 | * i40e_vc_config_promiscuous_mode_msg | 1064 | * i40e_vc_config_promiscuous_mode_msg |
1065 | * @vf: pointer to the vf info | 1065 | * @vf: pointer to the VF info |
1066 | * @msg: pointer to the msg buffer | 1066 | * @msg: pointer to the msg buffer |
1067 | * @msglen: msg length | 1067 | * @msglen: msg length |
1068 | * | 1068 | * |
1069 | * called from the vf to configure the promiscuous mode of | 1069 | * called from the VF to configure the promiscuous mode of |
1070 | * vf vsis | 1070 | * VF vsis |
1071 | **/ | 1071 | **/ |
1072 | static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf, | 1072 | static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf, |
1073 | u8 *msg, u16 msglen) | 1073 | u8 *msg, u16 msglen) |
@@ -1094,7 +1094,7 @@ static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf, | |||
1094 | allmulti, NULL); | 1094 | allmulti, NULL); |
1095 | 1095 | ||
1096 | error_param: | 1096 | error_param: |
1097 | /* send the response to the vf */ | 1097 | /* send the response to the VF */ |
1098 | return i40e_vc_send_resp_to_vf(vf, | 1098 | return i40e_vc_send_resp_to_vf(vf, |
1099 | I40E_VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, | 1099 | I40E_VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, |
1100 | aq_ret); | 1100 | aq_ret); |
@@ -1102,11 +1102,11 @@ error_param: | |||
1102 | 1102 | ||
1103 | /** | 1103 | /** |
1104 | * i40e_vc_config_queues_msg | 1104 | * i40e_vc_config_queues_msg |
1105 | * @vf: pointer to the vf info | 1105 | * @vf: pointer to the VF info |
1106 | * @msg: pointer to the msg buffer | 1106 | * @msg: pointer to the msg buffer |
1107 | * @msglen: msg length | 1107 | * @msglen: msg length |
1108 | * | 1108 | * |
1109 | * called from the vf to configure the rx/tx | 1109 | * called from the VF to configure the rx/tx |
1110 | * queues | 1110 | * queues |
1111 | **/ | 1111 | **/ |
1112 | static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | 1112 | static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) |
@@ -1148,22 +1148,22 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1148 | goto error_param; | 1148 | goto error_param; |
1149 | } | 1149 | } |
1150 | } | 1150 | } |
1151 | /* set vsi num_queue_pairs in use to num configured by vf */ | 1151 | /* set vsi num_queue_pairs in use to num configured by VF */ |
1152 | pf->vsi[vf->lan_vsi_index]->num_queue_pairs = qci->num_queue_pairs; | 1152 | pf->vsi[vf->lan_vsi_index]->num_queue_pairs = qci->num_queue_pairs; |
1153 | 1153 | ||
1154 | error_param: | 1154 | error_param: |
1155 | /* send the response to the vf */ | 1155 | /* send the response to the VF */ |
1156 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES, | 1156 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES, |
1157 | aq_ret); | 1157 | aq_ret); |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | /** | 1160 | /** |
1161 | * i40e_vc_config_irq_map_msg | 1161 | * i40e_vc_config_irq_map_msg |
1162 | * @vf: pointer to the vf info | 1162 | * @vf: pointer to the VF info |
1163 | * @msg: pointer to the msg buffer | 1163 | * @msg: pointer to the msg buffer |
1164 | * @msglen: msg length | 1164 | * @msglen: msg length |
1165 | * | 1165 | * |
1166 | * called from the vf to configure the irq to | 1166 | * called from the VF to configure the irq to |
1167 | * queue map | 1167 | * queue map |
1168 | **/ | 1168 | **/ |
1169 | static int i40e_vc_config_irq_map_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | 1169 | static int i40e_vc_config_irq_map_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) |
@@ -1215,18 +1215,18 @@ static int i40e_vc_config_irq_map_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1215 | i40e_config_irq_link_list(vf, vsi_id, map); | 1215 | i40e_config_irq_link_list(vf, vsi_id, map); |
1216 | } | 1216 | } |
1217 | error_param: | 1217 | error_param: |
1218 | /* send the response to the vf */ | 1218 | /* send the response to the VF */ |
1219 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP, | 1219 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP, |
1220 | aq_ret); | 1220 | aq_ret); |
1221 | } | 1221 | } |
1222 | 1222 | ||
1223 | /** | 1223 | /** |
1224 | * i40e_vc_enable_queues_msg | 1224 | * i40e_vc_enable_queues_msg |
1225 | * @vf: pointer to the vf info | 1225 | * @vf: pointer to the VF info |
1226 | * @msg: pointer to the msg buffer | 1226 | * @msg: pointer to the msg buffer |
1227 | * @msglen: msg length | 1227 | * @msglen: msg length |
1228 | * | 1228 | * |
1229 | * called from the vf to enable all or specific queue(s) | 1229 | * called from the VF to enable all or specific queue(s) |
1230 | **/ | 1230 | **/ |
1231 | static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | 1231 | static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) |
1232 | { | 1232 | { |
@@ -1253,18 +1253,18 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1253 | if (i40e_vsi_control_rings(pf->vsi[vsi_id], true)) | 1253 | if (i40e_vsi_control_rings(pf->vsi[vsi_id], true)) |
1254 | aq_ret = I40E_ERR_TIMEOUT; | 1254 | aq_ret = I40E_ERR_TIMEOUT; |
1255 | error_param: | 1255 | error_param: |
1256 | /* send the response to the vf */ | 1256 | /* send the response to the VF */ |
1257 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_ENABLE_QUEUES, | 1257 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_ENABLE_QUEUES, |
1258 | aq_ret); | 1258 | aq_ret); |
1259 | } | 1259 | } |
1260 | 1260 | ||
1261 | /** | 1261 | /** |
1262 | * i40e_vc_disable_queues_msg | 1262 | * i40e_vc_disable_queues_msg |
1263 | * @vf: pointer to the vf info | 1263 | * @vf: pointer to the VF info |
1264 | * @msg: pointer to the msg buffer | 1264 | * @msg: pointer to the msg buffer |
1265 | * @msglen: msg length | 1265 | * @msglen: msg length |
1266 | * | 1266 | * |
1267 | * called from the vf to disable all or specific | 1267 | * called from the VF to disable all or specific |
1268 | * queue(s) | 1268 | * queue(s) |
1269 | **/ | 1269 | **/ |
1270 | static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | 1270 | static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) |
@@ -1293,18 +1293,18 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1293 | aq_ret = I40E_ERR_TIMEOUT; | 1293 | aq_ret = I40E_ERR_TIMEOUT; |
1294 | 1294 | ||
1295 | error_param: | 1295 | error_param: |
1296 | /* send the response to the vf */ | 1296 | /* send the response to the VF */ |
1297 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_DISABLE_QUEUES, | 1297 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_DISABLE_QUEUES, |
1298 | aq_ret); | 1298 | aq_ret); |
1299 | } | 1299 | } |
1300 | 1300 | ||
1301 | /** | 1301 | /** |
1302 | * i40e_vc_get_stats_msg | 1302 | * i40e_vc_get_stats_msg |
1303 | * @vf: pointer to the vf info | 1303 | * @vf: pointer to the VF info |
1304 | * @msg: pointer to the msg buffer | 1304 | * @msg: pointer to the msg buffer |
1305 | * @msglen: msg length | 1305 | * @msglen: msg length |
1306 | * | 1306 | * |
1307 | * called from the vf to get vsi stats | 1307 | * called from the VF to get vsi stats |
1308 | **/ | 1308 | **/ |
1309 | static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | 1309 | static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) |
1310 | { | 1310 | { |
@@ -1336,14 +1336,14 @@ static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1336 | stats = vsi->eth_stats; | 1336 | stats = vsi->eth_stats; |
1337 | 1337 | ||
1338 | error_param: | 1338 | error_param: |
1339 | /* send the response back to the vf */ | 1339 | /* send the response back to the VF */ |
1340 | return i40e_vc_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_GET_STATS, aq_ret, | 1340 | return i40e_vc_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_GET_STATS, aq_ret, |
1341 | (u8 *)&stats, sizeof(stats)); | 1341 | (u8 *)&stats, sizeof(stats)); |
1342 | } | 1342 | } |
1343 | 1343 | ||
1344 | /** | 1344 | /** |
1345 | * i40e_check_vf_permission | 1345 | * i40e_check_vf_permission |
1346 | * @vf: pointer to the vf info | 1346 | * @vf: pointer to the VF info |
1347 | * @macaddr: pointer to the MAC Address being checked | 1347 | * @macaddr: pointer to the MAC Address being checked |
1348 | * | 1348 | * |
1349 | * Check if the VF has permission to add or delete unicast MAC address | 1349 | * Check if the VF has permission to add or delete unicast MAC address |
@@ -1377,7 +1377,7 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf, u8 *macaddr) | |||
1377 | 1377 | ||
1378 | /** | 1378 | /** |
1379 | * i40e_vc_add_mac_addr_msg | 1379 | * i40e_vc_add_mac_addr_msg |
1380 | * @vf: pointer to the vf info | 1380 | * @vf: pointer to the VF info |
1381 | * @msg: pointer to the msg buffer | 1381 | * @msg: pointer to the msg buffer |
1382 | * @msglen: msg length | 1382 | * @msglen: msg length |
1383 | * | 1383 | * |
@@ -1434,14 +1434,14 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1434 | dev_err(&pf->pdev->dev, "Unable to program VF MAC filters\n"); | 1434 | dev_err(&pf->pdev->dev, "Unable to program VF MAC filters\n"); |
1435 | 1435 | ||
1436 | error_param: | 1436 | error_param: |
1437 | /* send the response to the vf */ | 1437 | /* send the response to the VF */ |
1438 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS, | 1438 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS, |
1439 | ret); | 1439 | ret); |
1440 | } | 1440 | } |
1441 | 1441 | ||
1442 | /** | 1442 | /** |
1443 | * i40e_vc_del_mac_addr_msg | 1443 | * i40e_vc_del_mac_addr_msg |
1444 | * @vf: pointer to the vf info | 1444 | * @vf: pointer to the VF info |
1445 | * @msg: pointer to the msg buffer | 1445 | * @msg: pointer to the msg buffer |
1446 | * @msglen: msg length | 1446 | * @msglen: msg length |
1447 | * | 1447 | * |
@@ -1485,14 +1485,14 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1485 | dev_err(&pf->pdev->dev, "Unable to program VF MAC filters\n"); | 1485 | dev_err(&pf->pdev->dev, "Unable to program VF MAC filters\n"); |
1486 | 1486 | ||
1487 | error_param: | 1487 | error_param: |
1488 | /* send the response to the vf */ | 1488 | /* send the response to the VF */ |
1489 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS, | 1489 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS, |
1490 | ret); | 1490 | ret); |
1491 | } | 1491 | } |
1492 | 1492 | ||
1493 | /** | 1493 | /** |
1494 | * i40e_vc_add_vlan_msg | 1494 | * i40e_vc_add_vlan_msg |
1495 | * @vf: pointer to the vf info | 1495 | * @vf: pointer to the VF info |
1496 | * @msg: pointer to the msg buffer | 1496 | * @msg: pointer to the msg buffer |
1497 | * @msglen: msg length | 1497 | * @msglen: msg length |
1498 | * | 1498 | * |
@@ -1540,13 +1540,13 @@ static int i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1540 | } | 1540 | } |
1541 | 1541 | ||
1542 | error_param: | 1542 | error_param: |
1543 | /* send the response to the vf */ | 1543 | /* send the response to the VF */ |
1544 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_ADD_VLAN, aq_ret); | 1544 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_ADD_VLAN, aq_ret); |
1545 | } | 1545 | } |
1546 | 1546 | ||
1547 | /** | 1547 | /** |
1548 | * i40e_vc_remove_vlan_msg | 1548 | * i40e_vc_remove_vlan_msg |
1549 | * @vf: pointer to the vf info | 1549 | * @vf: pointer to the VF info |
1550 | * @msg: pointer to the msg buffer | 1550 | * @msg: pointer to the msg buffer |
1551 | * @msglen: msg length | 1551 | * @msglen: msg length |
1552 | * | 1552 | * |
@@ -1591,13 +1591,13 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1591 | } | 1591 | } |
1592 | 1592 | ||
1593 | error_param: | 1593 | error_param: |
1594 | /* send the response to the vf */ | 1594 | /* send the response to the VF */ |
1595 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_DEL_VLAN, aq_ret); | 1595 | return i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_DEL_VLAN, aq_ret); |
1596 | } | 1596 | } |
1597 | 1597 | ||
1598 | /** | 1598 | /** |
1599 | * i40e_vc_validate_vf_msg | 1599 | * i40e_vc_validate_vf_msg |
1600 | * @vf: pointer to the vf info | 1600 | * @vf: pointer to the VF info |
1601 | * @msg: pointer to the msg buffer | 1601 | * @msg: pointer to the msg buffer |
1602 | * @msglen: msg length | 1602 | * @msglen: msg length |
1603 | * @msghndl: msg handle | 1603 | * @msghndl: msg handle |
@@ -1703,14 +1703,14 @@ static int i40e_vc_validate_vf_msg(struct i40e_vf *vf, u32 v_opcode, | |||
1703 | 1703 | ||
1704 | /** | 1704 | /** |
1705 | * i40e_vc_process_vf_msg | 1705 | * i40e_vc_process_vf_msg |
1706 | * @pf: pointer to the pf structure | 1706 | * @pf: pointer to the PF structure |
1707 | * @vf_id: source vf id | 1707 | * @vf_id: source VF id |
1708 | * @msg: pointer to the msg buffer | 1708 | * @msg: pointer to the msg buffer |
1709 | * @msglen: msg length | 1709 | * @msglen: msg length |
1710 | * @msghndl: msg handle | 1710 | * @msghndl: msg handle |
1711 | * | 1711 | * |
1712 | * called from the common aeq/arq handler to | 1712 | * called from the common aeq/arq handler to |
1713 | * process request from vf | 1713 | * process request from VF |
1714 | **/ | 1714 | **/ |
1715 | int i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id, u32 v_opcode, | 1715 | int i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id, u32 v_opcode, |
1716 | u32 v_retval, u8 *msg, u16 msglen) | 1716 | u32 v_retval, u8 *msg, u16 msglen) |
@@ -1728,7 +1728,7 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id, u32 v_opcode, | |||
1728 | ret = i40e_vc_validate_vf_msg(vf, v_opcode, v_retval, msg, msglen); | 1728 | ret = i40e_vc_validate_vf_msg(vf, v_opcode, v_retval, msg, msglen); |
1729 | 1729 | ||
1730 | if (ret) { | 1730 | if (ret) { |
1731 | dev_err(&pf->pdev->dev, "Invalid message from vf %d, opcode %d, len %d\n", | 1731 | dev_err(&pf->pdev->dev, "Invalid message from VF %d, opcode %d, len %d\n", |
1732 | local_vf_id, v_opcode, msglen); | 1732 | local_vf_id, v_opcode, msglen); |
1733 | return ret; | 1733 | return ret; |
1734 | } | 1734 | } |
@@ -1776,7 +1776,7 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id, u32 v_opcode, | |||
1776 | break; | 1776 | break; |
1777 | case I40E_VIRTCHNL_OP_UNKNOWN: | 1777 | case I40E_VIRTCHNL_OP_UNKNOWN: |
1778 | default: | 1778 | default: |
1779 | dev_err(&pf->pdev->dev, "Unsupported opcode %d from vf %d\n", | 1779 | dev_err(&pf->pdev->dev, "Unsupported opcode %d from VF %d\n", |
1780 | v_opcode, local_vf_id); | 1780 | v_opcode, local_vf_id); |
1781 | ret = i40e_vc_send_resp_to_vf(vf, v_opcode, | 1781 | ret = i40e_vc_send_resp_to_vf(vf, v_opcode, |
1782 | I40E_ERR_NOT_IMPLEMENTED); | 1782 | I40E_ERR_NOT_IMPLEMENTED); |
@@ -1788,10 +1788,10 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id, u32 v_opcode, | |||
1788 | 1788 | ||
1789 | /** | 1789 | /** |
1790 | * i40e_vc_process_vflr_event | 1790 | * i40e_vc_process_vflr_event |
1791 | * @pf: pointer to the pf structure | 1791 | * @pf: pointer to the PF structure |
1792 | * | 1792 | * |
1793 | * called from the vlfr irq handler to | 1793 | * called from the vlfr irq handler to |
1794 | * free up vf resources and state variables | 1794 | * free up VF resources and state variables |
1795 | **/ | 1795 | **/ |
1796 | int i40e_vc_process_vflr_event(struct i40e_pf *pf) | 1796 | int i40e_vc_process_vflr_event(struct i40e_pf *pf) |
1797 | { | 1797 | { |
@@ -1812,7 +1812,7 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf) | |||
1812 | for (vf_id = 0; vf_id < pf->num_alloc_vfs; vf_id++) { | 1812 | for (vf_id = 0; vf_id < pf->num_alloc_vfs; vf_id++) { |
1813 | reg_idx = (hw->func_caps.vf_base_id + vf_id) / 32; | 1813 | reg_idx = (hw->func_caps.vf_base_id + vf_id) / 32; |
1814 | bit_idx = (hw->func_caps.vf_base_id + vf_id) % 32; | 1814 | bit_idx = (hw->func_caps.vf_base_id + vf_id) % 32; |
1815 | /* read GLGEN_VFLRSTAT register to find out the flr vfs */ | 1815 | /* read GLGEN_VFLRSTAT register to find out the flr VFs */ |
1816 | vf = &pf->vf[vf_id]; | 1816 | vf = &pf->vf[vf_id]; |
1817 | reg = rd32(hw, I40E_GLGEN_VFLRSTAT(reg_idx)); | 1817 | reg = rd32(hw, I40E_GLGEN_VFLRSTAT(reg_idx)); |
1818 | if (reg & (1 << bit_idx)) { | 1818 | if (reg & (1 << bit_idx)) { |
@@ -1829,7 +1829,7 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf) | |||
1829 | 1829 | ||
1830 | /** | 1830 | /** |
1831 | * i40e_vc_vf_broadcast | 1831 | * i40e_vc_vf_broadcast |
1832 | * @pf: pointer to the pf structure | 1832 | * @pf: pointer to the PF structure |
1833 | * @opcode: operation code | 1833 | * @opcode: operation code |
1834 | * @retval: return value | 1834 | * @retval: return value |
1835 | * @msg: pointer to the msg buffer | 1835 | * @msg: pointer to the msg buffer |
@@ -1848,7 +1848,7 @@ static void i40e_vc_vf_broadcast(struct i40e_pf *pf, | |||
1848 | 1848 | ||
1849 | for (i = 0; i < pf->num_alloc_vfs; i++, vf++) { | 1849 | for (i = 0; i < pf->num_alloc_vfs; i++, vf++) { |
1850 | int abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id; | 1850 | int abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id; |
1851 | /* Not all vfs are enabled so skip the ones that are not */ | 1851 | /* Not all VFs are enabled so skip the ones that are not */ |
1852 | if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states) && | 1852 | if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states) && |
1853 | !test_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states)) | 1853 | !test_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states)) |
1854 | continue; | 1854 | continue; |
@@ -1863,7 +1863,7 @@ static void i40e_vc_vf_broadcast(struct i40e_pf *pf, | |||
1863 | 1863 | ||
1864 | /** | 1864 | /** |
1865 | * i40e_vc_notify_link_state | 1865 | * i40e_vc_notify_link_state |
1866 | * @pf: pointer to the pf structure | 1866 | * @pf: pointer to the PF structure |
1867 | * | 1867 | * |
1868 | * send a link status message to all VFs on a given PF | 1868 | * send a link status message to all VFs on a given PF |
1869 | **/ | 1869 | **/ |
@@ -1896,7 +1896,7 @@ void i40e_vc_notify_link_state(struct i40e_pf *pf) | |||
1896 | 1896 | ||
1897 | /** | 1897 | /** |
1898 | * i40e_vc_notify_reset | 1898 | * i40e_vc_notify_reset |
1899 | * @pf: pointer to the pf structure | 1899 | * @pf: pointer to the PF structure |
1900 | * | 1900 | * |
1901 | * indicate a pending reset to all VFs on a given PF | 1901 | * indicate a pending reset to all VFs on a given PF |
1902 | **/ | 1902 | **/ |
@@ -1912,7 +1912,7 @@ void i40e_vc_notify_reset(struct i40e_pf *pf) | |||
1912 | 1912 | ||
1913 | /** | 1913 | /** |
1914 | * i40e_vc_notify_vf_reset | 1914 | * i40e_vc_notify_vf_reset |
1915 | * @vf: pointer to the vf structure | 1915 | * @vf: pointer to the VF structure |
1916 | * | 1916 | * |
1917 | * indicate a pending reset to the given VF | 1917 | * indicate a pending reset to the given VF |
1918 | **/ | 1918 | **/ |
@@ -1942,10 +1942,10 @@ void i40e_vc_notify_vf_reset(struct i40e_vf *vf) | |||
1942 | /** | 1942 | /** |
1943 | * i40e_ndo_set_vf_mac | 1943 | * i40e_ndo_set_vf_mac |
1944 | * @netdev: network interface device structure | 1944 | * @netdev: network interface device structure |
1945 | * @vf_id: vf identifier | 1945 | * @vf_id: VF identifier |
1946 | * @mac: mac address | 1946 | * @mac: mac address |
1947 | * | 1947 | * |
1948 | * program vf mac address | 1948 | * program VF mac address |
1949 | **/ | 1949 | **/ |
1950 | int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac) | 1950 | int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac) |
1951 | { | 1951 | { |
@@ -2010,11 +2010,11 @@ error_param: | |||
2010 | /** | 2010 | /** |
2011 | * i40e_ndo_set_vf_port_vlan | 2011 | * i40e_ndo_set_vf_port_vlan |
2012 | * @netdev: network interface device structure | 2012 | * @netdev: network interface device structure |
2013 | * @vf_id: vf identifier | 2013 | * @vf_id: VF identifier |
2014 | * @vlan_id: mac address | 2014 | * @vlan_id: mac address |
2015 | * @qos: priority setting | 2015 | * @qos: priority setting |
2016 | * | 2016 | * |
2017 | * program vf vlan id and/or qos | 2017 | * program VF vlan id and/or qos |
2018 | **/ | 2018 | **/ |
2019 | int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, | 2019 | int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, |
2020 | int vf_id, u16 vlan_id, u8 qos) | 2020 | int vf_id, u16 vlan_id, u8 qos) |
@@ -2123,10 +2123,10 @@ error_pvid: | |||
2123 | /** | 2123 | /** |
2124 | * i40e_ndo_set_vf_bw | 2124 | * i40e_ndo_set_vf_bw |
2125 | * @netdev: network interface device structure | 2125 | * @netdev: network interface device structure |
2126 | * @vf_id: vf identifier | 2126 | * @vf_id: VF identifier |
2127 | * @tx_rate: tx rate | 2127 | * @tx_rate: Tx rate |
2128 | * | 2128 | * |
2129 | * configure vf tx rate | 2129 | * configure VF Tx rate |
2130 | **/ | 2130 | **/ |
2131 | int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate, | 2131 | int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate, |
2132 | int max_tx_rate) | 2132 | int max_tx_rate) |
@@ -2146,7 +2146,7 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate, | |||
2146 | } | 2146 | } |
2147 | 2147 | ||
2148 | if (min_tx_rate) { | 2148 | if (min_tx_rate) { |
2149 | dev_err(&pf->pdev->dev, "Invalid min tx rate (%d) (greater than 0) specified for vf %d.\n", | 2149 | dev_err(&pf->pdev->dev, "Invalid min tx rate (%d) (greater than 0) specified for VF %d.\n", |
2150 | min_tx_rate, vf_id); | 2150 | min_tx_rate, vf_id); |
2151 | return -EINVAL; | 2151 | return -EINVAL; |
2152 | } | 2152 | } |
@@ -2174,7 +2174,7 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate, | |||
2174 | } | 2174 | } |
2175 | 2175 | ||
2176 | if (max_tx_rate > speed) { | 2176 | if (max_tx_rate > speed) { |
2177 | dev_err(&pf->pdev->dev, "Invalid max tx rate %d specified for vf %d.", | 2177 | dev_err(&pf->pdev->dev, "Invalid max tx rate %d specified for VF %d.", |
2178 | max_tx_rate, vf->vf_id); | 2178 | max_tx_rate, vf->vf_id); |
2179 | ret = -EINVAL; | 2179 | ret = -EINVAL; |
2180 | goto error; | 2180 | goto error; |
@@ -2203,10 +2203,10 @@ error: | |||
2203 | /** | 2203 | /** |
2204 | * i40e_ndo_get_vf_config | 2204 | * i40e_ndo_get_vf_config |
2205 | * @netdev: network interface device structure | 2205 | * @netdev: network interface device structure |
2206 | * @vf_id: vf identifier | 2206 | * @vf_id: VF identifier |
2207 | * @ivi: vf configuration structure | 2207 | * @ivi: VF configuration structure |
2208 | * | 2208 | * |
2209 | * return vf configuration | 2209 | * return VF configuration |
2210 | **/ | 2210 | **/ |
2211 | int i40e_ndo_get_vf_config(struct net_device *netdev, | 2211 | int i40e_ndo_get_vf_config(struct net_device *netdev, |
2212 | int vf_id, struct ifla_vf_info *ivi) | 2212 | int vf_id, struct ifla_vf_info *ivi) |
@@ -2258,7 +2258,7 @@ error_param: | |||
2258 | /** | 2258 | /** |
2259 | * i40e_ndo_set_vf_link_state | 2259 | * i40e_ndo_set_vf_link_state |
2260 | * @netdev: network interface device structure | 2260 | * @netdev: network interface device structure |
2261 | * @vf_id: vf identifier | 2261 | * @vf_id: VF identifier |
2262 | * @link: required link state | 2262 | * @link: required link state |
2263 | * | 2263 | * |
2264 | * Set the link state of a specified VF, regardless of physical link state | 2264 | * Set the link state of a specified VF, regardless of physical link state |
@@ -2321,7 +2321,7 @@ error_out: | |||
2321 | /** | 2321 | /** |
2322 | * i40e_ndo_set_vf_spoofchk | 2322 | * i40e_ndo_set_vf_spoofchk |
2323 | * @netdev: network interface device structure | 2323 | * @netdev: network interface device structure |
2324 | * @vf_id: vf identifier | 2324 | * @vf_id: VF identifier |
2325 | * @enable: flag to enable or disable feature | 2325 | * @enable: flag to enable or disable feature |
2326 | * | 2326 | * |
2327 | * Enable or disable VF spoof checking | 2327 | * Enable or disable VF spoof checking |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h index 21db113a64fa..9c3a41040835 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | |||
@@ -71,12 +71,12 @@ enum i40e_vf_capabilities { | |||
71 | struct i40e_vf { | 71 | struct i40e_vf { |
72 | struct i40e_pf *pf; | 72 | struct i40e_pf *pf; |
73 | 73 | ||
74 | /* vf id in the pf space */ | 74 | /* VF id in the PF space */ |
75 | u16 vf_id; | 75 | u16 vf_id; |
76 | /* all vf vsis connect to the same parent */ | 76 | /* all VF vsis connect to the same parent */ |
77 | enum i40e_switch_element_types parent_type; | 77 | enum i40e_switch_element_types parent_type; |
78 | 78 | ||
79 | /* vf Port Extender (PE) stag if used */ | 79 | /* VF Port Extender (PE) stag if used */ |
80 | u16 stag; | 80 | u16 stag; |
81 | 81 | ||
82 | struct i40e_virtchnl_ether_addr default_lan_addr; | 82 | struct i40e_virtchnl_ether_addr default_lan_addr; |
@@ -91,7 +91,7 @@ struct i40e_vf { | |||
91 | u8 lan_vsi_index; /* index into PF struct */ | 91 | u8 lan_vsi_index; /* index into PF struct */ |
92 | u8 lan_vsi_id; /* ID as used by firmware */ | 92 | u8 lan_vsi_id; /* ID as used by firmware */ |
93 | 93 | ||
94 | u8 num_queue_pairs; /* num of qps assigned to vf vsis */ | 94 | u8 num_queue_pairs; /* num of qps assigned to VF vsis */ |
95 | u64 num_mdd_events; /* num of mdd events detected */ | 95 | u64 num_mdd_events; /* num of mdd events detected */ |
96 | u64 num_invalid_msgs; /* num of malformed or invalid msgs detected */ | 96 | u64 num_invalid_msgs; /* num of malformed or invalid msgs detected */ |
97 | u64 num_valid_msgs; /* num of valid msgs detected */ | 97 | u64 num_valid_msgs; /* num of valid msgs detected */ |
@@ -100,7 +100,7 @@ struct i40e_vf { | |||
100 | unsigned long vf_states; /* vf's runtime states */ | 100 | unsigned long vf_states; /* vf's runtime states */ |
101 | unsigned int tx_rate; /* Tx bandwidth limit in Mbps */ | 101 | unsigned int tx_rate; /* Tx bandwidth limit in Mbps */ |
102 | bool link_forced; | 102 | bool link_forced; |
103 | bool link_up; /* only valid if vf link is forced */ | 103 | bool link_up; /* only valid if VF link is forced */ |
104 | bool spoofchk; | 104 | bool spoofchk; |
105 | }; | 105 | }; |
106 | 106 | ||
@@ -113,7 +113,7 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf); | |||
113 | void i40e_reset_vf(struct i40e_vf *vf, bool flr); | 113 | void i40e_reset_vf(struct i40e_vf *vf, bool flr); |
114 | void i40e_vc_notify_vf_reset(struct i40e_vf *vf); | 114 | void i40e_vc_notify_vf_reset(struct i40e_vf *vf); |
115 | 115 | ||
116 | /* vf configuration related iplink handlers */ | 116 | /* VF configuration related iplink handlers */ |
117 | int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac); | 117 | int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac); |
118 | int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, | 118 | int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, |
119 | int vf_id, u16 vlan_id, u8 qos); | 119 | int vf_id, u16 vlan_id, u8 qos); |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c index d9f3db542c5f..f41da5d8047b 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c | |||
@@ -371,6 +371,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget) | |||
371 | static void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector) | 371 | static void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector) |
372 | { | 372 | { |
373 | u32 val = I40E_VFINT_DYN_CTLN_INTENA_MASK | | 373 | u32 val = I40E_VFINT_DYN_CTLN_INTENA_MASK | |
374 | I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK | /* set noitr */ | ||
374 | I40E_VFINT_DYN_CTLN_SWINT_TRIG_MASK | | 375 | I40E_VFINT_DYN_CTLN_SWINT_TRIG_MASK | |
375 | I40E_VFINT_DYN_CTLN_SW_ITR_INDX_ENA_MASK; | 376 | I40E_VFINT_DYN_CTLN_SW_ITR_INDX_ENA_MASK; |
376 | /* allow 00 to be written to the index */ | 377 | /* allow 00 to be written to the index */ |
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index f44911df286a..812b1200f35c 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c | |||
@@ -36,7 +36,7 @@ char i40evf_driver_name[] = "i40evf"; | |||
36 | static const char i40evf_driver_string[] = | 36 | static const char i40evf_driver_string[] = |
37 | "Intel(R) XL710/X710 Virtual Function Network Driver"; | 37 | "Intel(R) XL710/X710 Virtual Function Network Driver"; |
38 | 38 | ||
39 | #define DRV_VERSION "1.2.6" | 39 | #define DRV_VERSION "1.2.25" |
40 | const char i40evf_driver_version[] = DRV_VERSION; | 40 | const char i40evf_driver_version[] = DRV_VERSION; |
41 | static const char i40evf_copyright[] = | 41 | static const char i40evf_copyright[] = |
42 | "Copyright (c) 2013 - 2014 Intel Corporation."; | 42 | "Copyright (c) 2013 - 2014 Intel Corporation."; |
@@ -244,6 +244,7 @@ void i40evf_irq_enable_queues(struct i40evf_adapter *adapter, u32 mask) | |||
244 | if (mask & (1 << (i - 1))) { | 244 | if (mask & (1 << (i - 1))) { |
245 | wr32(hw, I40E_VFINT_DYN_CTLN1(i - 1), | 245 | wr32(hw, I40E_VFINT_DYN_CTLN1(i - 1), |
246 | I40E_VFINT_DYN_CTLN1_INTENA_MASK | | 246 | I40E_VFINT_DYN_CTLN1_INTENA_MASK | |
247 | I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK | | ||
247 | I40E_VFINT_DYN_CTLN_CLEARPBA_MASK); | 248 | I40E_VFINT_DYN_CTLN_CLEARPBA_MASK); |
248 | } | 249 | } |
249 | } | 250 | } |
@@ -263,6 +264,7 @@ static void i40evf_fire_sw_int(struct i40evf_adapter *adapter, u32 mask) | |||
263 | if (mask & 1) { | 264 | if (mask & 1) { |
264 | dyn_ctl = rd32(hw, I40E_VFINT_DYN_CTL01); | 265 | dyn_ctl = rd32(hw, I40E_VFINT_DYN_CTL01); |
265 | dyn_ctl |= I40E_VFINT_DYN_CTLN_SWINT_TRIG_MASK | | 266 | dyn_ctl |= I40E_VFINT_DYN_CTLN_SWINT_TRIG_MASK | |
267 | I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK | | ||
266 | I40E_VFINT_DYN_CTLN_CLEARPBA_MASK; | 268 | I40E_VFINT_DYN_CTLN_CLEARPBA_MASK; |
267 | wr32(hw, I40E_VFINT_DYN_CTL01, dyn_ctl); | 269 | wr32(hw, I40E_VFINT_DYN_CTL01, dyn_ctl); |
268 | } | 270 | } |
@@ -270,6 +272,7 @@ static void i40evf_fire_sw_int(struct i40evf_adapter *adapter, u32 mask) | |||
270 | if (mask & (1 << i)) { | 272 | if (mask & (1 << i)) { |
271 | dyn_ctl = rd32(hw, I40E_VFINT_DYN_CTLN1(i - 1)); | 273 | dyn_ctl = rd32(hw, I40E_VFINT_DYN_CTLN1(i - 1)); |
272 | dyn_ctl |= I40E_VFINT_DYN_CTLN_SWINT_TRIG_MASK | | 274 | dyn_ctl |= I40E_VFINT_DYN_CTLN_SWINT_TRIG_MASK | |
275 | I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK | | ||
273 | I40E_VFINT_DYN_CTLN_CLEARPBA_MASK; | 276 | I40E_VFINT_DYN_CTLN_CLEARPBA_MASK; |
274 | wr32(hw, I40E_VFINT_DYN_CTLN1(i - 1), dyn_ctl); | 277 | wr32(hw, I40E_VFINT_DYN_CTLN1(i - 1), dyn_ctl); |
275 | } | 278 | } |
@@ -1578,13 +1581,14 @@ continue_reset: | |||
1578 | adapter->flags &= ~I40EVF_FLAG_RESET_PENDING; | 1581 | adapter->flags &= ~I40EVF_FLAG_RESET_PENDING; |
1579 | 1582 | ||
1580 | i40evf_irq_disable(adapter); | 1583 | i40evf_irq_disable(adapter); |
1581 | i40evf_napi_disable_all(adapter); | ||
1582 | |||
1583 | netif_tx_disable(netdev); | ||
1584 | 1584 | ||
1585 | netif_tx_stop_all_queues(netdev); | 1585 | if (netif_running(adapter->netdev)) { |
1586 | i40evf_napi_disable_all(adapter); | ||
1587 | netif_tx_disable(netdev); | ||
1588 | netif_tx_stop_all_queues(netdev); | ||
1589 | netif_carrier_off(netdev); | ||
1590 | } | ||
1586 | 1591 | ||
1587 | netif_carrier_off(netdev); | ||
1588 | adapter->state = __I40EVF_RESETTING; | 1592 | adapter->state = __I40EVF_RESETTING; |
1589 | 1593 | ||
1590 | /* kill and reinit the admin queue */ | 1594 | /* kill and reinit the admin queue */ |