diff options
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e.h | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_adminq.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_common.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 15 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 216 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_prototype.h | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.c | 88 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 14 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_common.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_prototype.h | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 |
16 files changed, 301 insertions, 98 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 801da392a20e..4e97ba1b04de 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h | |||
@@ -144,6 +144,7 @@ enum i40e_state_t { | |||
144 | __I40E_PTP_TX_IN_PROGRESS, | 144 | __I40E_PTP_TX_IN_PROGRESS, |
145 | __I40E_BAD_EEPROM, | 145 | __I40E_BAD_EEPROM, |
146 | __I40E_DOWN_REQUESTED, | 146 | __I40E_DOWN_REQUESTED, |
147 | __I40E_FD_FLUSH_REQUESTED, | ||
147 | }; | 148 | }; |
148 | 149 | ||
149 | enum i40e_interrupt_policy { | 150 | enum i40e_interrupt_policy { |
@@ -250,6 +251,11 @@ struct i40e_pf { | |||
250 | u16 fdir_pf_active_filters; | 251 | u16 fdir_pf_active_filters; |
251 | u16 fd_sb_cnt_idx; | 252 | u16 fd_sb_cnt_idx; |
252 | u16 fd_atr_cnt_idx; | 253 | u16 fd_atr_cnt_idx; |
254 | unsigned long fd_flush_timestamp; | ||
255 | u32 fd_flush_cnt; | ||
256 | u32 fd_add_err; | ||
257 | u32 fd_atr_cnt; | ||
258 | u32 fd_tcp_rule; | ||
253 | 259 | ||
254 | #ifdef CONFIG_I40E_VXLAN | 260 | #ifdef CONFIG_I40E_VXLAN |
255 | __be16 vxlan_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS]; | 261 | __be16 vxlan_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS]; |
@@ -310,6 +316,7 @@ struct i40e_pf { | |||
310 | u32 tx_timeout_count; | 316 | u32 tx_timeout_count; |
311 | u32 tx_timeout_recovery_level; | 317 | u32 tx_timeout_recovery_level; |
312 | unsigned long tx_timeout_last_recovery; | 318 | unsigned long tx_timeout_last_recovery; |
319 | u32 tx_sluggish_count; | ||
313 | u32 hw_csum_rx_error; | 320 | u32 hw_csum_rx_error; |
314 | u32 led_status; | 321 | u32 led_status; |
315 | u16 corer_count; /* Core reset count */ | 322 | u16 corer_count; /* Core reset count */ |
@@ -608,6 +615,7 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi, | |||
608 | void i40e_fdir_check_and_reenable(struct i40e_pf *pf); | 615 | void i40e_fdir_check_and_reenable(struct i40e_pf *pf); |
609 | int i40e_get_current_fd_count(struct i40e_pf *pf); | 616 | int i40e_get_current_fd_count(struct i40e_pf *pf); |
610 | int i40e_get_cur_guaranteed_fd_count(struct i40e_pf *pf); | 617 | int i40e_get_cur_guaranteed_fd_count(struct i40e_pf *pf); |
618 | int i40e_get_current_atr_cnt(struct i40e_pf *pf); | ||
611 | bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features); | 619 | bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features); |
612 | void i40e_set_ethtool_ops(struct net_device *netdev); | 620 | void i40e_set_ethtool_ops(struct net_device *netdev); |
613 | struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi, | 621 | struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi, |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c index b29c157b1f57..72f5d25a222f 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c | |||
@@ -840,7 +840,8 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, | |||
840 | 840 | ||
841 | /* bump the tail */ | 841 | /* bump the tail */ |
842 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n"); | 842 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n"); |
843 | i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, buff); | 843 | i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, |
844 | buff, buff_size); | ||
844 | (hw->aq.asq.next_to_use)++; | 845 | (hw->aq.asq.next_to_use)++; |
845 | if (hw->aq.asq.next_to_use == hw->aq.asq.count) | 846 | if (hw->aq.asq.next_to_use == hw->aq.asq.count) |
846 | hw->aq.asq.next_to_use = 0; | 847 | hw->aq.asq.next_to_use = 0; |
@@ -891,7 +892,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, | |||
891 | 892 | ||
892 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, | 893 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, |
893 | "AQTX: desc and buffer writeback:\n"); | 894 | "AQTX: desc and buffer writeback:\n"); |
894 | i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff); | 895 | i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, buff_size); |
895 | 896 | ||
896 | /* update the error if time out occurred */ | 897 | /* update the error if time out occurred */ |
897 | if ((!cmd_completed) && | 898 | if ((!cmd_completed) && |
@@ -987,7 +988,8 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw, | |||
987 | e->msg_size); | 988 | e->msg_size); |
988 | 989 | ||
989 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n"); | 990 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n"); |
990 | i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf); | 991 | i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf, |
992 | hw->aq.arq_buf_size); | ||
991 | 993 | ||
992 | /* Restore the original datalen and buffer address in the desc, | 994 | /* Restore the original datalen and buffer address in the desc, |
993 | * FW updates datalen to indicate the event message | 995 | * FW updates datalen to indicate the event message |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index df43e7c6777c..01874c0fff1d 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c | |||
@@ -75,13 +75,15 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw) | |||
75 | * @mask: debug mask | 75 | * @mask: debug mask |
76 | * @desc: pointer to admin queue descriptor | 76 | * @desc: pointer to admin queue descriptor |
77 | * @buffer: pointer to command buffer | 77 | * @buffer: pointer to command buffer |
78 | * @buf_len: max length of buffer | ||
78 | * | 79 | * |
79 | * Dumps debug log about adminq command with descriptor contents. | 80 | * Dumps debug log about adminq command with descriptor contents. |
80 | **/ | 81 | **/ |
81 | void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc, | 82 | void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc, |
82 | void *buffer) | 83 | void *buffer, u16 buf_len) |
83 | { | 84 | { |
84 | struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc; | 85 | struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc; |
86 | u16 len = le16_to_cpu(aq_desc->datalen); | ||
85 | u8 *aq_buffer = (u8 *)buffer; | 87 | u8 *aq_buffer = (u8 *)buffer; |
86 | u32 data[4]; | 88 | u32 data[4]; |
87 | u32 i = 0; | 89 | u32 i = 0; |
@@ -105,7 +107,9 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc, | |||
105 | if ((buffer != NULL) && (aq_desc->datalen != 0)) { | 107 | if ((buffer != NULL) && (aq_desc->datalen != 0)) { |
106 | memset(data, 0, sizeof(data)); | 108 | memset(data, 0, sizeof(data)); |
107 | i40e_debug(hw, mask, "AQ CMD Buffer:\n"); | 109 | i40e_debug(hw, mask, "AQ CMD Buffer:\n"); |
108 | for (i = 0; i < le16_to_cpu(aq_desc->datalen); i++) { | 110 | if (buf_len < len) |
111 | len = buf_len; | ||
112 | for (i = 0; i < len; i++) { | ||
109 | data[((i % 16) / 4)] |= | 113 | data[((i % 16) / 4)] |= |
110 | ((u32)aq_buffer[i]) << (8 * (i % 4)); | 114 | ((u32)aq_buffer[i]) << (8 * (i % 4)); |
111 | if ((i % 16) == 15) { | 115 | if ((i % 16) == 15) { |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c index 5a0cabeb35ed..7067f4b9159c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c | |||
@@ -1356,6 +1356,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp, | |||
1356 | "emp reset count: %d\n", pf->empr_count); | 1356 | "emp reset count: %d\n", pf->empr_count); |
1357 | dev_info(&pf->pdev->dev, | 1357 | dev_info(&pf->pdev->dev, |
1358 | "pf reset count: %d\n", pf->pfr_count); | 1358 | "pf reset count: %d\n", pf->pfr_count); |
1359 | dev_info(&pf->pdev->dev, | ||
1360 | "pf tx sluggish count: %d\n", | ||
1361 | pf->tx_sluggish_count); | ||
1359 | } else if (strncmp(&cmd_buf[5], "port", 4) == 0) { | 1362 | } else if (strncmp(&cmd_buf[5], "port", 4) == 0) { |
1360 | struct i40e_aqc_query_port_ets_config_resp *bw_data; | 1363 | struct i40e_aqc_query_port_ets_config_resp *bw_data; |
1361 | struct i40e_dcbx_config *cfg = | 1364 | struct i40e_dcbx_config *cfg = |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index e8ba7470700a..571d527e7920 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c | |||
@@ -145,6 +145,7 @@ static struct i40e_stats i40e_gstrings_stats[] = { | |||
145 | I40E_PF_STAT("rx_jabber", stats.rx_jabber), | 145 | I40E_PF_STAT("rx_jabber", stats.rx_jabber), |
146 | I40E_PF_STAT("VF_admin_queue_requests", vf_aq_requests), | 146 | I40E_PF_STAT("VF_admin_queue_requests", vf_aq_requests), |
147 | I40E_PF_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared), | 147 | I40E_PF_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared), |
148 | I40E_PF_STAT("fdir_flush_cnt", fd_flush_cnt), | ||
148 | I40E_PF_STAT("fdir_atr_match", stats.fd_atr_match), | 149 | I40E_PF_STAT("fdir_atr_match", stats.fd_atr_match), |
149 | I40E_PF_STAT("fdir_sb_match", stats.fd_sb_match), | 150 | I40E_PF_STAT("fdir_sb_match", stats.fd_sb_match), |
150 | 151 | ||
@@ -1977,6 +1978,13 @@ static int i40e_del_fdir_entry(struct i40e_vsi *vsi, | |||
1977 | struct i40e_pf *pf = vsi->back; | 1978 | struct i40e_pf *pf = vsi->back; |
1978 | int ret = 0; | 1979 | int ret = 0; |
1979 | 1980 | ||
1981 | if (test_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state) || | ||
1982 | test_bit(__I40E_RESET_INTR_RECEIVED, &pf->state)) | ||
1983 | return -EBUSY; | ||
1984 | |||
1985 | if (test_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state)) | ||
1986 | return -EBUSY; | ||
1987 | |||
1980 | ret = i40e_update_ethtool_fdir_entry(vsi, NULL, fsp->location, cmd); | 1988 | ret = i40e_update_ethtool_fdir_entry(vsi, NULL, fsp->location, cmd); |
1981 | 1989 | ||
1982 | i40e_fdir_check_and_reenable(pf); | 1990 | i40e_fdir_check_and_reenable(pf); |
@@ -2010,6 +2018,13 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi, | |||
2010 | if (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED) | 2018 | if (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED) |
2011 | return -ENOSPC; | 2019 | return -ENOSPC; |
2012 | 2020 | ||
2021 | if (test_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state) || | ||
2022 | test_bit(__I40E_RESET_INTR_RECEIVED, &pf->state)) | ||
2023 | return -EBUSY; | ||
2024 | |||
2025 | if (test_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state)) | ||
2026 | return -EBUSY; | ||
2027 | |||
2013 | fsp = (struct ethtool_rx_flow_spec *)&cmd->fs; | 2028 | fsp = (struct ethtool_rx_flow_spec *)&cmd->fs; |
2014 | 2029 | ||
2015 | if (fsp->location >= (pf->hw.func_caps.fd_filters_best_effort + | 2030 | if (fsp->location >= (pf->hw.func_caps.fd_filters_best_effort + |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index eddec6ba095b..bd192b827865 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -37,9 +37,9 @@ static const char i40e_driver_string[] = | |||
37 | 37 | ||
38 | #define DRV_KERN "-k" | 38 | #define DRV_KERN "-k" |
39 | 39 | ||
40 | #define DRV_VERSION_MAJOR 0 | 40 | #define DRV_VERSION_MAJOR 1 |
41 | #define DRV_VERSION_MINOR 4 | 41 | #define DRV_VERSION_MINOR 0 |
42 | #define DRV_VERSION_BUILD 21 | 42 | #define DRV_VERSION_BUILD 4 |
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 |
@@ -1239,8 +1239,11 @@ struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi, u8 *macaddr, | |||
1239 | * i40e_rm_default_mac_filter - Remove the default MAC filter set by NVM | 1239 | * i40e_rm_default_mac_filter - Remove the default MAC filter set by NVM |
1240 | * @vsi: the PF Main VSI - inappropriate for any other VSI | 1240 | * @vsi: the PF Main VSI - inappropriate for any other VSI |
1241 | * @macaddr: the MAC address | 1241 | * @macaddr: the MAC address |
1242 | * | ||
1243 | * Some older firmware configurations set up a default promiscuous VLAN | ||
1244 | * filter that needs to be removed. | ||
1242 | **/ | 1245 | **/ |
1243 | static void i40e_rm_default_mac_filter(struct i40e_vsi *vsi, u8 *macaddr) | 1246 | static int i40e_rm_default_mac_filter(struct i40e_vsi *vsi, u8 *macaddr) |
1244 | { | 1247 | { |
1245 | struct i40e_aqc_remove_macvlan_element_data element; | 1248 | struct i40e_aqc_remove_macvlan_element_data element; |
1246 | struct i40e_pf *pf = vsi->back; | 1249 | struct i40e_pf *pf = vsi->back; |
@@ -1248,15 +1251,18 @@ static void i40e_rm_default_mac_filter(struct i40e_vsi *vsi, u8 *macaddr) | |||
1248 | 1251 | ||
1249 | /* Only appropriate for the PF main VSI */ | 1252 | /* Only appropriate for the PF main VSI */ |
1250 | if (vsi->type != I40E_VSI_MAIN) | 1253 | if (vsi->type != I40E_VSI_MAIN) |
1251 | return; | 1254 | return -EINVAL; |
1252 | 1255 | ||
1256 | memset(&element, 0, sizeof(element)); | ||
1253 | ether_addr_copy(element.mac_addr, macaddr); | 1257 | ether_addr_copy(element.mac_addr, macaddr); |
1254 | element.vlan_tag = 0; | 1258 | element.vlan_tag = 0; |
1255 | element.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH | | 1259 | element.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH | |
1256 | I40E_AQC_MACVLAN_DEL_IGNORE_VLAN; | 1260 | I40E_AQC_MACVLAN_DEL_IGNORE_VLAN; |
1257 | aq_ret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid, &element, 1, NULL); | 1261 | aq_ret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid, &element, 1, NULL); |
1258 | if (aq_ret) | 1262 | if (aq_ret) |
1259 | dev_err(&pf->pdev->dev, "Could not remove default MAC-VLAN\n"); | 1263 | return -ENOENT; |
1264 | |||
1265 | return 0; | ||
1260 | } | 1266 | } |
1261 | 1267 | ||
1262 | /** | 1268 | /** |
@@ -1385,18 +1391,30 @@ static int i40e_set_mac(struct net_device *netdev, void *p) | |||
1385 | { | 1391 | { |
1386 | struct i40e_netdev_priv *np = netdev_priv(netdev); | 1392 | struct i40e_netdev_priv *np = netdev_priv(netdev); |
1387 | struct i40e_vsi *vsi = np->vsi; | 1393 | struct i40e_vsi *vsi = np->vsi; |
1394 | struct i40e_pf *pf = vsi->back; | ||
1395 | struct i40e_hw *hw = &pf->hw; | ||
1388 | struct sockaddr *addr = p; | 1396 | struct sockaddr *addr = p; |
1389 | struct i40e_mac_filter *f; | 1397 | struct i40e_mac_filter *f; |
1390 | 1398 | ||
1391 | if (!is_valid_ether_addr(addr->sa_data)) | 1399 | if (!is_valid_ether_addr(addr->sa_data)) |
1392 | return -EADDRNOTAVAIL; | 1400 | return -EADDRNOTAVAIL; |
1393 | 1401 | ||
1394 | netdev_info(netdev, "set mac address=%pM\n", addr->sa_data); | 1402 | if (ether_addr_equal(netdev->dev_addr, addr->sa_data)) { |
1403 | netdev_info(netdev, "already using mac address %pM\n", | ||
1404 | addr->sa_data); | ||
1405 | return 0; | ||
1406 | } | ||
1395 | 1407 | ||
1396 | if (test_bit(__I40E_DOWN, &vsi->back->state) || | 1408 | if (test_bit(__I40E_DOWN, &vsi->back->state) || |
1397 | test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state)) | 1409 | test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state)) |
1398 | return -EADDRNOTAVAIL; | 1410 | return -EADDRNOTAVAIL; |
1399 | 1411 | ||
1412 | if (ether_addr_equal(hw->mac.addr, addr->sa_data)) | ||
1413 | netdev_info(netdev, "returning to hw mac address %pM\n", | ||
1414 | hw->mac.addr); | ||
1415 | else | ||
1416 | netdev_info(netdev, "set new mac address %pM\n", addr->sa_data); | ||
1417 | |||
1400 | if (vsi->type == I40E_VSI_MAIN) { | 1418 | if (vsi->type == I40E_VSI_MAIN) { |
1401 | i40e_status ret; | 1419 | i40e_status ret; |
1402 | ret = i40e_aq_mac_address_write(&vsi->back->hw, | 1420 | ret = i40e_aq_mac_address_write(&vsi->back->hw, |
@@ -1410,25 +1428,34 @@ static int i40e_set_mac(struct net_device *netdev, void *p) | |||
1410 | } | 1428 | } |
1411 | } | 1429 | } |
1412 | 1430 | ||
1413 | f = i40e_find_mac(vsi, addr->sa_data, false, true); | 1431 | if (ether_addr_equal(netdev->dev_addr, hw->mac.addr)) { |
1414 | if (!f) { | 1432 | struct i40e_aqc_remove_macvlan_element_data element; |
1415 | /* In order to be sure to not drop any packets, add the | ||
1416 | * new address first then delete the old one. | ||
1417 | */ | ||
1418 | f = i40e_add_filter(vsi, addr->sa_data, I40E_VLAN_ANY, | ||
1419 | false, false); | ||
1420 | if (!f) | ||
1421 | return -ENOMEM; | ||
1422 | 1433 | ||
1423 | i40e_sync_vsi_filters(vsi); | 1434 | memset(&element, 0, sizeof(element)); |
1435 | ether_addr_copy(element.mac_addr, netdev->dev_addr); | ||
1436 | element.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH; | ||
1437 | i40e_aq_remove_macvlan(&pf->hw, vsi->seid, &element, 1, NULL); | ||
1438 | } else { | ||
1424 | i40e_del_filter(vsi, netdev->dev_addr, I40E_VLAN_ANY, | 1439 | i40e_del_filter(vsi, netdev->dev_addr, I40E_VLAN_ANY, |
1425 | false, false); | 1440 | false, false); |
1426 | i40e_sync_vsi_filters(vsi); | ||
1427 | } | 1441 | } |
1428 | 1442 | ||
1429 | f->is_laa = true; | 1443 | if (ether_addr_equal(addr->sa_data, hw->mac.addr)) { |
1430 | if (!ether_addr_equal(netdev->dev_addr, addr->sa_data)) | 1444 | struct i40e_aqc_add_macvlan_element_data element; |
1431 | ether_addr_copy(netdev->dev_addr, addr->sa_data); | 1445 | |
1446 | memset(&element, 0, sizeof(element)); | ||
1447 | ether_addr_copy(element.mac_addr, hw->mac.addr); | ||
1448 | element.flags = cpu_to_le16(I40E_AQC_MACVLAN_ADD_PERFECT_MATCH); | ||
1449 | i40e_aq_add_macvlan(&pf->hw, vsi->seid, &element, 1, NULL); | ||
1450 | } else { | ||
1451 | f = i40e_add_filter(vsi, addr->sa_data, I40E_VLAN_ANY, | ||
1452 | false, false); | ||
1453 | if (f) | ||
1454 | f->is_laa = true; | ||
1455 | } | ||
1456 | |||
1457 | i40e_sync_vsi_filters(vsi); | ||
1458 | ether_addr_copy(netdev->dev_addr, addr->sa_data); | ||
1432 | 1459 | ||
1433 | return 0; | 1460 | return 0; |
1434 | } | 1461 | } |
@@ -1796,9 +1823,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) | |||
1796 | kfree(add_list); | 1823 | kfree(add_list); |
1797 | add_list = NULL; | 1824 | add_list = NULL; |
1798 | 1825 | ||
1799 | if (add_happened && (!aq_ret)) { | 1826 | if (add_happened && aq_ret && |
1800 | /* do nothing */; | 1827 | pf->hw.aq.asq_last_status != I40E_AQ_RC_EINVAL) { |
1801 | } else if (add_happened && (aq_ret)) { | ||
1802 | dev_info(&pf->pdev->dev, | 1828 | dev_info(&pf->pdev->dev, |
1803 | "add filter failed, err %d, aq_err %d\n", | 1829 | "add filter failed, err %d, aq_err %d\n", |
1804 | aq_ret, pf->hw.aq.asq_last_status); | 1830 | aq_ret, pf->hw.aq.asq_last_status); |
@@ -4480,11 +4506,26 @@ static int i40e_up_complete(struct i40e_vsi *vsi) | |||
4480 | netif_carrier_on(vsi->netdev); | 4506 | netif_carrier_on(vsi->netdev); |
4481 | } else if (vsi->netdev) { | 4507 | } else if (vsi->netdev) { |
4482 | i40e_print_link_message(vsi, false); | 4508 | i40e_print_link_message(vsi, false); |
4509 | /* need to check for qualified module here*/ | ||
4510 | if ((pf->hw.phy.link_info.link_info & | ||
4511 | I40E_AQ_MEDIA_AVAILABLE) && | ||
4512 | (!(pf->hw.phy.link_info.an_info & | ||
4513 | I40E_AQ_QUALIFIED_MODULE))) | ||
4514 | netdev_err(vsi->netdev, | ||
4515 | "the driver failed to link because an unqualified module was detected."); | ||
4483 | } | 4516 | } |
4484 | 4517 | ||
4485 | /* replay FDIR SB filters */ | 4518 | /* replay FDIR SB filters */ |
4486 | if (vsi->type == I40E_VSI_FDIR) | 4519 | if (vsi->type == I40E_VSI_FDIR) { |
4520 | /* reset fd counters */ | ||
4521 | pf->fd_add_err = pf->fd_atr_cnt = 0; | ||
4522 | if (pf->fd_tcp_rule > 0) { | ||
4523 | pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED; | ||
4524 | dev_info(&pf->pdev->dev, "Forcing ATR off, sideband rules for TCP/IPv4 exist\n"); | ||
4525 | pf->fd_tcp_rule = 0; | ||
4526 | } | ||
4487 | i40e_fdir_filter_restore(vsi); | 4527 | i40e_fdir_filter_restore(vsi); |
4528 | } | ||
4488 | i40e_service_event_schedule(pf); | 4529 | i40e_service_event_schedule(pf); |
4489 | 4530 | ||
4490 | return 0; | 4531 | return 0; |
@@ -5125,6 +5166,7 @@ int i40e_get_current_fd_count(struct i40e_pf *pf) | |||
5125 | I40E_PFQF_FDSTAT_BEST_CNT_SHIFT); | 5166 | I40E_PFQF_FDSTAT_BEST_CNT_SHIFT); |
5126 | return fcnt_prog; | 5167 | return fcnt_prog; |
5127 | } | 5168 | } |
5169 | |||
5128 | /** | 5170 | /** |
5129 | * i40e_fdir_check_and_reenable - Function to reenabe FD ATR or SB if disabled | 5171 | * i40e_fdir_check_and_reenable - Function to reenabe FD ATR or SB if disabled |
5130 | * @pf: board private structure | 5172 | * @pf: board private structure |
@@ -5133,15 +5175,17 @@ void i40e_fdir_check_and_reenable(struct i40e_pf *pf) | |||
5133 | { | 5175 | { |
5134 | u32 fcnt_prog, fcnt_avail; | 5176 | u32 fcnt_prog, fcnt_avail; |
5135 | 5177 | ||
5178 | if (test_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state)) | ||
5179 | return; | ||
5180 | |||
5136 | /* Check if, FD SB or ATR was auto disabled and if there is enough room | 5181 | /* Check if, FD SB or ATR was auto disabled and if there is enough room |
5137 | * to re-enable | 5182 | * to re-enable |
5138 | */ | 5183 | */ |
5139 | if ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) && | ||
5140 | (pf->flags & I40E_FLAG_FD_SB_ENABLED)) | ||
5141 | return; | ||
5142 | fcnt_prog = i40e_get_cur_guaranteed_fd_count(pf); | 5184 | fcnt_prog = i40e_get_cur_guaranteed_fd_count(pf); |
5143 | fcnt_avail = pf->fdir_pf_filter_count; | 5185 | fcnt_avail = pf->fdir_pf_filter_count; |
5144 | if (fcnt_prog < (fcnt_avail - I40E_FDIR_BUFFER_HEAD_ROOM)) { | 5186 | if ((fcnt_prog < (fcnt_avail - I40E_FDIR_BUFFER_HEAD_ROOM)) || |
5187 | (pf->fd_add_err == 0) || | ||
5188 | (i40e_get_current_atr_cnt(pf) < pf->fd_atr_cnt)) { | ||
5145 | if ((pf->flags & I40E_FLAG_FD_SB_ENABLED) && | 5189 | if ((pf->flags & I40E_FLAG_FD_SB_ENABLED) && |
5146 | (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED)) { | 5190 | (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED)) { |
5147 | pf->auto_disable_flags &= ~I40E_FLAG_FD_SB_ENABLED; | 5191 | pf->auto_disable_flags &= ~I40E_FLAG_FD_SB_ENABLED; |
@@ -5158,23 +5202,84 @@ void i40e_fdir_check_and_reenable(struct i40e_pf *pf) | |||
5158 | } | 5202 | } |
5159 | } | 5203 | } |
5160 | 5204 | ||
5205 | #define I40E_MIN_FD_FLUSH_INTERVAL 10 | ||
5206 | /** | ||
5207 | * i40e_fdir_flush_and_replay - Function to flush all FD filters and replay SB | ||
5208 | * @pf: board private structure | ||
5209 | **/ | ||
5210 | static void i40e_fdir_flush_and_replay(struct i40e_pf *pf) | ||
5211 | { | ||
5212 | int flush_wait_retry = 50; | ||
5213 | int reg; | ||
5214 | |||
5215 | if (time_after(jiffies, pf->fd_flush_timestamp + | ||
5216 | (I40E_MIN_FD_FLUSH_INTERVAL * HZ))) { | ||
5217 | set_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state); | ||
5218 | pf->fd_flush_timestamp = jiffies; | ||
5219 | pf->auto_disable_flags |= I40E_FLAG_FD_SB_ENABLED; | ||
5220 | pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED; | ||
5221 | /* flush all filters */ | ||
5222 | wr32(&pf->hw, I40E_PFQF_CTL_1, | ||
5223 | I40E_PFQF_CTL_1_CLEARFDTABLE_MASK); | ||
5224 | i40e_flush(&pf->hw); | ||
5225 | pf->fd_flush_cnt++; | ||
5226 | pf->fd_add_err = 0; | ||
5227 | do { | ||
5228 | /* Check FD flush status every 5-6msec */ | ||
5229 | usleep_range(5000, 6000); | ||
5230 | reg = rd32(&pf->hw, I40E_PFQF_CTL_1); | ||
5231 | if (!(reg & I40E_PFQF_CTL_1_CLEARFDTABLE_MASK)) | ||
5232 | break; | ||
5233 | } while (flush_wait_retry--); | ||
5234 | if (reg & I40E_PFQF_CTL_1_CLEARFDTABLE_MASK) { | ||
5235 | dev_warn(&pf->pdev->dev, "FD table did not flush, needs more time\n"); | ||
5236 | } else { | ||
5237 | /* replay sideband filters */ | ||
5238 | i40e_fdir_filter_restore(pf->vsi[pf->lan_vsi]); | ||
5239 | |||
5240 | pf->flags |= I40E_FLAG_FD_ATR_ENABLED; | ||
5241 | pf->auto_disable_flags &= ~I40E_FLAG_FD_ATR_ENABLED; | ||
5242 | pf->auto_disable_flags &= ~I40E_FLAG_FD_SB_ENABLED; | ||
5243 | clear_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state); | ||
5244 | dev_info(&pf->pdev->dev, "FD Filter table flushed and FD-SB replayed.\n"); | ||
5245 | } | ||
5246 | } | ||
5247 | } | ||
5248 | |||
5249 | /** | ||
5250 | * i40e_get_current_atr_count - Get the count of total FD ATR filters programmed | ||
5251 | * @pf: board private structure | ||
5252 | **/ | ||
5253 | int i40e_get_current_atr_cnt(struct i40e_pf *pf) | ||
5254 | { | ||
5255 | return i40e_get_current_fd_count(pf) - pf->fdir_pf_active_filters; | ||
5256 | } | ||
5257 | |||
5258 | /* We can see up to 256 filter programming desc in transit if the filters are | ||
5259 | * being applied really fast; before we see the first | ||
5260 | * filter miss error on Rx queue 0. Accumulating enough error messages before | ||
5261 | * reacting will make sure we don't cause flush too often. | ||
5262 | */ | ||
5263 | #define I40E_MAX_FD_PROGRAM_ERROR 256 | ||
5264 | |||
5161 | /** | 5265 | /** |
5162 | * i40e_fdir_reinit_subtask - Worker thread to reinit FDIR filter table | 5266 | * i40e_fdir_reinit_subtask - Worker thread to reinit FDIR filter table |
5163 | * @pf: board private structure | 5267 | * @pf: board private structure |
5164 | **/ | 5268 | **/ |
5165 | static void i40e_fdir_reinit_subtask(struct i40e_pf *pf) | 5269 | static void i40e_fdir_reinit_subtask(struct i40e_pf *pf) |
5166 | { | 5270 | { |
5167 | if (!(pf->flags & I40E_FLAG_FDIR_REQUIRES_REINIT)) | ||
5168 | return; | ||
5169 | 5271 | ||
5170 | /* if interface is down do nothing */ | 5272 | /* if interface is down do nothing */ |
5171 | if (test_bit(__I40E_DOWN, &pf->state)) | 5273 | if (test_bit(__I40E_DOWN, &pf->state)) |
5172 | return; | 5274 | return; |
5275 | |||
5276 | if ((pf->fd_add_err >= I40E_MAX_FD_PROGRAM_ERROR) && | ||
5277 | (i40e_get_current_atr_cnt(pf) >= pf->fd_atr_cnt) && | ||
5278 | (i40e_get_current_atr_cnt(pf) > pf->fdir_pf_filter_count)) | ||
5279 | i40e_fdir_flush_and_replay(pf); | ||
5280 | |||
5173 | i40e_fdir_check_and_reenable(pf); | 5281 | i40e_fdir_check_and_reenable(pf); |
5174 | 5282 | ||
5175 | if ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) && | ||
5176 | (pf->flags & I40E_FLAG_FD_SB_ENABLED)) | ||
5177 | pf->flags &= ~I40E_FLAG_FDIR_REQUIRES_REINIT; | ||
5178 | } | 5283 | } |
5179 | 5284 | ||
5180 | /** | 5285 | /** |
@@ -5420,6 +5525,13 @@ static void i40e_handle_link_event(struct i40e_pf *pf, | |||
5420 | memcpy(&pf->hw.phy.link_info_old, hw_link_info, | 5525 | memcpy(&pf->hw.phy.link_info_old, hw_link_info, |
5421 | sizeof(pf->hw.phy.link_info_old)); | 5526 | sizeof(pf->hw.phy.link_info_old)); |
5422 | 5527 | ||
5528 | /* check for unqualified module, if link is down */ | ||
5529 | if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) && | ||
5530 | (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) && | ||
5531 | (!(status->link_info & I40E_AQ_LINK_UP))) | ||
5532 | dev_err(&pf->pdev->dev, | ||
5533 | "The driver failed to link because an unqualified module was detected.\n"); | ||
5534 | |||
5423 | /* update link status */ | 5535 | /* update link status */ |
5424 | hw_link_info->phy_type = (enum i40e_aq_phy_type)status->phy_type; | 5536 | hw_link_info->phy_type = (enum i40e_aq_phy_type)status->phy_type; |
5425 | hw_link_info->link_speed = (enum i40e_aq_link_speed)status->link_speed; | 5537 | hw_link_info->link_speed = (enum i40e_aq_link_speed)status->link_speed; |
@@ -7086,6 +7198,11 @@ bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features) | |||
7086 | } | 7198 | } |
7087 | pf->flags &= ~I40E_FLAG_FD_SB_ENABLED; | 7199 | pf->flags &= ~I40E_FLAG_FD_SB_ENABLED; |
7088 | pf->auto_disable_flags &= ~I40E_FLAG_FD_SB_ENABLED; | 7200 | pf->auto_disable_flags &= ~I40E_FLAG_FD_SB_ENABLED; |
7201 | /* reset fd counters */ | ||
7202 | pf->fd_add_err = pf->fd_atr_cnt = pf->fd_tcp_rule = 0; | ||
7203 | pf->fdir_pf_active_filters = 0; | ||
7204 | pf->flags |= I40E_FLAG_FD_ATR_ENABLED; | ||
7205 | dev_info(&pf->pdev->dev, "ATR re-enabled.\n"); | ||
7089 | /* if ATR was auto disabled it can be re-enabled. */ | 7206 | /* if ATR was auto disabled it can be re-enabled. */ |
7090 | if ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) && | 7207 | if ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) && |
7091 | (pf->auto_disable_flags & I40E_FLAG_FD_ATR_ENABLED)) | 7208 | (pf->auto_disable_flags & I40E_FLAG_FD_ATR_ENABLED)) |
@@ -7421,14 +7538,14 @@ static int i40e_config_netdev(struct i40e_vsi *vsi) | |||
7421 | if (vsi->type == I40E_VSI_MAIN) { | 7538 | if (vsi->type == I40E_VSI_MAIN) { |
7422 | SET_NETDEV_DEV(netdev, &pf->pdev->dev); | 7539 | SET_NETDEV_DEV(netdev, &pf->pdev->dev); |
7423 | ether_addr_copy(mac_addr, hw->mac.perm_addr); | 7540 | ether_addr_copy(mac_addr, hw->mac.perm_addr); |
7424 | /* The following two steps are necessary to prevent reception | 7541 | /* The following steps are necessary to prevent reception |
7425 | * of tagged packets - by default the NVM loads a MAC-VLAN | 7542 | * of tagged packets - some older NVM configurations load a |
7426 | * filter that will accept any tagged packet. This is to | 7543 | * default a MAC-VLAN filter that accepts any tagged packet |
7427 | * prevent that during normal operations until a specific | 7544 | * which must be replaced by a normal filter. |
7428 | * VLAN tag filter has been set. | ||
7429 | */ | 7545 | */ |
7430 | i40e_rm_default_mac_filter(vsi, mac_addr); | 7546 | if (!i40e_rm_default_mac_filter(vsi, mac_addr)) |
7431 | i40e_add_filter(vsi, mac_addr, I40E_VLAN_ANY, false, true); | 7547 | i40e_add_filter(vsi, mac_addr, |
7548 | I40E_VLAN_ANY, false, true); | ||
7432 | } else { | 7549 | } else { |
7433 | /* relate the VSI_VMDQ name to the VSI_MAIN name */ | 7550 | /* relate the VSI_VMDQ name to the VSI_MAIN name */ |
7434 | snprintf(netdev->name, IFNAMSIZ, "%sv%%d", | 7551 | snprintf(netdev->name, IFNAMSIZ, "%sv%%d", |
@@ -7644,7 +7761,22 @@ static int i40e_add_vsi(struct i40e_vsi *vsi) | |||
7644 | f_count++; | 7761 | f_count++; |
7645 | 7762 | ||
7646 | if (f->is_laa && vsi->type == I40E_VSI_MAIN) { | 7763 | if (f->is_laa && vsi->type == I40E_VSI_MAIN) { |
7647 | i40e_aq_mac_address_write(&vsi->back->hw, | 7764 | struct i40e_aqc_remove_macvlan_element_data element; |
7765 | |||
7766 | memset(&element, 0, sizeof(element)); | ||
7767 | ether_addr_copy(element.mac_addr, f->macaddr); | ||
7768 | element.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH; | ||
7769 | ret = i40e_aq_remove_macvlan(hw, vsi->seid, | ||
7770 | &element, 1, NULL); | ||
7771 | if (ret) { | ||
7772 | /* some older FW has a different default */ | ||
7773 | element.flags |= | ||
7774 | I40E_AQC_MACVLAN_DEL_IGNORE_VLAN; | ||
7775 | i40e_aq_remove_macvlan(hw, vsi->seid, | ||
7776 | &element, 1, NULL); | ||
7777 | } | ||
7778 | |||
7779 | i40e_aq_mac_address_write(hw, | ||
7648 | I40E_AQC_WRITE_TYPE_LAA_WOL, | 7780 | I40E_AQC_WRITE_TYPE_LAA_WOL, |
7649 | f->macaddr, NULL); | 7781 | f->macaddr, NULL); |
7650 | } | 7782 | } |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h index 949a9a01778b..0988b5c1fe87 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h +++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h | |||
@@ -52,10 +52,8 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, | |||
52 | struct i40e_asq_cmd_details *cmd_details); | 52 | struct i40e_asq_cmd_details *cmd_details); |
53 | 53 | ||
54 | /* debug function for adminq */ | 54 | /* debug function for adminq */ |
55 | void i40e_debug_aq(struct i40e_hw *hw, | 55 | void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, |
56 | enum i40e_debug_mask mask, | 56 | void *desc, void *buffer, u16 buf_len); |
57 | void *desc, | ||
58 | void *buffer); | ||
59 | 57 | ||
60 | void i40e_idle_aq(struct i40e_hw *hw); | 58 | void i40e_idle_aq(struct i40e_hw *hw); |
61 | bool i40e_check_asq_alive(struct i40e_hw *hw); | 59 | bool i40e_check_asq_alive(struct i40e_hw *hw); |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index a51aa37b7b5a..4bf49d2acb04 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -224,15 +224,19 @@ static int i40e_add_del_fdir_udpv4(struct i40e_vsi *vsi, | |||
224 | ret = i40e_program_fdir_filter(fd_data, raw_packet, pf, add); | 224 | ret = i40e_program_fdir_filter(fd_data, raw_packet, pf, add); |
225 | if (ret) { | 225 | if (ret) { |
226 | dev_info(&pf->pdev->dev, | 226 | dev_info(&pf->pdev->dev, |
227 | "Filter command send failed for PCTYPE %d (ret = %d)\n", | 227 | "PCTYPE:%d, Filter command send failed for fd_id:%d (ret = %d)\n", |
228 | fd_data->pctype, ret); | 228 | fd_data->pctype, fd_data->fd_id, ret); |
229 | err = true; | 229 | err = true; |
230 | } else { | 230 | } else { |
231 | dev_info(&pf->pdev->dev, | 231 | if (add) |
232 | "Filter OK for PCTYPE %d (ret = %d)\n", | 232 | dev_info(&pf->pdev->dev, |
233 | fd_data->pctype, ret); | 233 | "Filter OK for PCTYPE %d loc = %d\n", |
234 | fd_data->pctype, fd_data->fd_id); | ||
235 | else | ||
236 | dev_info(&pf->pdev->dev, | ||
237 | "Filter deleted for PCTYPE %d loc = %d\n", | ||
238 | fd_data->pctype, fd_data->fd_id); | ||
234 | } | 239 | } |
235 | |||
236 | return err ? -EOPNOTSUPP : 0; | 240 | return err ? -EOPNOTSUPP : 0; |
237 | } | 241 | } |
238 | 242 | ||
@@ -276,10 +280,18 @@ static int i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi, | |||
276 | tcp->source = fd_data->src_port; | 280 | tcp->source = fd_data->src_port; |
277 | 281 | ||
278 | if (add) { | 282 | if (add) { |
283 | pf->fd_tcp_rule++; | ||
279 | if (pf->flags & I40E_FLAG_FD_ATR_ENABLED) { | 284 | if (pf->flags & I40E_FLAG_FD_ATR_ENABLED) { |
280 | dev_info(&pf->pdev->dev, "Forcing ATR off, sideband rules for TCP/IPv4 flow being applied\n"); | 285 | dev_info(&pf->pdev->dev, "Forcing ATR off, sideband rules for TCP/IPv4 flow being applied\n"); |
281 | pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED; | 286 | pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED; |
282 | } | 287 | } |
288 | } else { | ||
289 | pf->fd_tcp_rule = (pf->fd_tcp_rule > 0) ? | ||
290 | (pf->fd_tcp_rule - 1) : 0; | ||
291 | if (pf->fd_tcp_rule == 0) { | ||
292 | pf->flags |= I40E_FLAG_FD_ATR_ENABLED; | ||
293 | dev_info(&pf->pdev->dev, "ATR re-enabled due to no sideband TCP/IPv4 rules\n"); | ||
294 | } | ||
283 | } | 295 | } |
284 | 296 | ||
285 | fd_data->pctype = I40E_FILTER_PCTYPE_NONF_IPV4_TCP; | 297 | fd_data->pctype = I40E_FILTER_PCTYPE_NONF_IPV4_TCP; |
@@ -287,12 +299,17 @@ static int i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi, | |||
287 | 299 | ||
288 | if (ret) { | 300 | if (ret) { |
289 | dev_info(&pf->pdev->dev, | 301 | dev_info(&pf->pdev->dev, |
290 | "Filter command send failed for PCTYPE %d (ret = %d)\n", | 302 | "PCTYPE:%d, Filter command send failed for fd_id:%d (ret = %d)\n", |
291 | fd_data->pctype, ret); | 303 | fd_data->pctype, fd_data->fd_id, ret); |
292 | err = true; | 304 | err = true; |
293 | } else { | 305 | } else { |
294 | dev_info(&pf->pdev->dev, "Filter OK for PCTYPE %d (ret = %d)\n", | 306 | if (add) |
295 | fd_data->pctype, ret); | 307 | dev_info(&pf->pdev->dev, "Filter OK for PCTYPE %d loc = %d)\n", |
308 | fd_data->pctype, fd_data->fd_id); | ||
309 | else | ||
310 | dev_info(&pf->pdev->dev, | ||
311 | "Filter deleted for PCTYPE %d loc = %d\n", | ||
312 | fd_data->pctype, fd_data->fd_id); | ||
296 | } | 313 | } |
297 | 314 | ||
298 | return err ? -EOPNOTSUPP : 0; | 315 | return err ? -EOPNOTSUPP : 0; |
@@ -355,13 +372,18 @@ static int i40e_add_del_fdir_ipv4(struct i40e_vsi *vsi, | |||
355 | 372 | ||
356 | if (ret) { | 373 | if (ret) { |
357 | dev_info(&pf->pdev->dev, | 374 | dev_info(&pf->pdev->dev, |
358 | "Filter command send failed for PCTYPE %d (ret = %d)\n", | 375 | "PCTYPE:%d, Filter command send failed for fd_id:%d (ret = %d)\n", |
359 | fd_data->pctype, ret); | 376 | fd_data->pctype, fd_data->fd_id, ret); |
360 | err = true; | 377 | err = true; |
361 | } else { | 378 | } else { |
362 | dev_info(&pf->pdev->dev, | 379 | if (add) |
363 | "Filter OK for PCTYPE %d (ret = %d)\n", | 380 | dev_info(&pf->pdev->dev, |
364 | fd_data->pctype, ret); | 381 | "Filter OK for PCTYPE %d loc = %d\n", |
382 | fd_data->pctype, fd_data->fd_id); | ||
383 | else | ||
384 | dev_info(&pf->pdev->dev, | ||
385 | "Filter deleted for PCTYPE %d loc = %d\n", | ||
386 | fd_data->pctype, fd_data->fd_id); | ||
365 | } | 387 | } |
366 | } | 388 | } |
367 | 389 | ||
@@ -443,8 +465,14 @@ static void i40e_fd_handle_status(struct i40e_ring *rx_ring, | |||
443 | I40E_RX_PROG_STATUS_DESC_QW1_ERROR_SHIFT; | 465 | I40E_RX_PROG_STATUS_DESC_QW1_ERROR_SHIFT; |
444 | 466 | ||
445 | if (error == (0x1 << I40E_RX_PROG_STATUS_DESC_FD_TBL_FULL_SHIFT)) { | 467 | if (error == (0x1 << I40E_RX_PROG_STATUS_DESC_FD_TBL_FULL_SHIFT)) { |
446 | dev_warn(&pdev->dev, "ntuple filter loc = %d, could not be added\n", | 468 | if ((rx_desc->wb.qword0.hi_dword.fd_id != 0) || |
447 | rx_desc->wb.qword0.hi_dword.fd_id); | 469 | (I40E_DEBUG_FD & pf->hw.debug_mask)) |
470 | dev_warn(&pdev->dev, "ntuple filter loc = %d, could not be added\n", | ||
471 | rx_desc->wb.qword0.hi_dword.fd_id); | ||
472 | |||
473 | pf->fd_add_err++; | ||
474 | /* store the current atr filter count */ | ||
475 | pf->fd_atr_cnt = i40e_get_current_atr_cnt(pf); | ||
448 | 476 | ||
449 | /* filter programming failed most likely due to table full */ | 477 | /* filter programming failed most likely due to table full */ |
450 | fcnt_prog = i40e_get_cur_guaranteed_fd_count(pf); | 478 | fcnt_prog = i40e_get_cur_guaranteed_fd_count(pf); |
@@ -454,29 +482,21 @@ static void i40e_fd_handle_status(struct i40e_ring *rx_ring, | |||
454 | * FD ATR/SB and then re-enable it when there is room. | 482 | * FD ATR/SB and then re-enable it when there is room. |
455 | */ | 483 | */ |
456 | if (fcnt_prog >= (fcnt_avail - I40E_FDIR_BUFFER_FULL_MARGIN)) { | 484 | if (fcnt_prog >= (fcnt_avail - I40E_FDIR_BUFFER_FULL_MARGIN)) { |
457 | /* Turn off ATR first */ | 485 | if ((pf->flags & I40E_FLAG_FD_SB_ENABLED) && |
458 | if ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) && | ||
459 | !(pf->auto_disable_flags & | 486 | !(pf->auto_disable_flags & |
460 | I40E_FLAG_FD_ATR_ENABLED)) { | ||
461 | dev_warn(&pdev->dev, "FD filter space full, ATR for further flows will be turned off\n"); | ||
462 | pf->auto_disable_flags |= | ||
463 | I40E_FLAG_FD_ATR_ENABLED; | ||
464 | pf->flags |= I40E_FLAG_FDIR_REQUIRES_REINIT; | ||
465 | } else if ((pf->flags & I40E_FLAG_FD_SB_ENABLED) && | ||
466 | !(pf->auto_disable_flags & | ||
467 | I40E_FLAG_FD_SB_ENABLED)) { | 487 | I40E_FLAG_FD_SB_ENABLED)) { |
468 | dev_warn(&pdev->dev, "FD filter space full, new ntuple rules will not be added\n"); | 488 | dev_warn(&pdev->dev, "FD filter space full, new ntuple rules will not be added\n"); |
469 | pf->auto_disable_flags |= | 489 | pf->auto_disable_flags |= |
470 | I40E_FLAG_FD_SB_ENABLED; | 490 | I40E_FLAG_FD_SB_ENABLED; |
471 | pf->flags |= I40E_FLAG_FDIR_REQUIRES_REINIT; | ||
472 | } | 491 | } |
473 | } else { | 492 | } else { |
474 | dev_info(&pdev->dev, "FD filter programming error\n"); | 493 | dev_info(&pdev->dev, |
494 | "FD filter programming failed due to incorrect filter parameters\n"); | ||
475 | } | 495 | } |
476 | } else if (error == | 496 | } else if (error == |
477 | (0x1 << I40E_RX_PROG_STATUS_DESC_NO_FD_ENTRY_SHIFT)) { | 497 | (0x1 << I40E_RX_PROG_STATUS_DESC_NO_FD_ENTRY_SHIFT)) { |
478 | if (I40E_DEBUG_FD & pf->hw.debug_mask) | 498 | if (I40E_DEBUG_FD & pf->hw.debug_mask) |
479 | dev_info(&pdev->dev, "ntuple filter loc = %d, could not be removed\n", | 499 | dev_info(&pdev->dev, "ntuple filter fd_id = %d, could not be removed\n", |
480 | rx_desc->wb.qword0.hi_dword.fd_id); | 500 | rx_desc->wb.qword0.hi_dword.fd_id); |
481 | } | 501 | } |
482 | } | 502 | } |
@@ -587,6 +607,7 @@ static u32 i40e_get_tx_pending(struct i40e_ring *ring) | |||
587 | static bool i40e_check_tx_hang(struct i40e_ring *tx_ring) | 607 | static bool i40e_check_tx_hang(struct i40e_ring *tx_ring) |
588 | { | 608 | { |
589 | u32 tx_pending = i40e_get_tx_pending(tx_ring); | 609 | u32 tx_pending = i40e_get_tx_pending(tx_ring); |
610 | struct i40e_pf *pf = tx_ring->vsi->back; | ||
590 | bool ret = false; | 611 | bool ret = false; |
591 | 612 | ||
592 | clear_check_for_tx_hang(tx_ring); | 613 | clear_check_for_tx_hang(tx_ring); |
@@ -603,10 +624,17 @@ static bool i40e_check_tx_hang(struct i40e_ring *tx_ring) | |||
603 | * pending but without time to complete it yet. | 624 | * pending but without time to complete it yet. |
604 | */ | 625 | */ |
605 | if ((tx_ring->tx_stats.tx_done_old == tx_ring->stats.packets) && | 626 | if ((tx_ring->tx_stats.tx_done_old == tx_ring->stats.packets) && |
606 | tx_pending) { | 627 | (tx_pending >= I40E_MIN_DESC_PENDING)) { |
607 | /* make sure it is true for two checks in a row */ | 628 | /* make sure it is true for two checks in a row */ |
608 | ret = test_and_set_bit(__I40E_HANG_CHECK_ARMED, | 629 | ret = test_and_set_bit(__I40E_HANG_CHECK_ARMED, |
609 | &tx_ring->state); | 630 | &tx_ring->state); |
631 | } else if ((tx_ring->tx_stats.tx_done_old == tx_ring->stats.packets) && | ||
632 | (tx_pending < I40E_MIN_DESC_PENDING) && | ||
633 | (tx_pending > 0)) { | ||
634 | if (I40E_DEBUG_FLOW & pf->hw.debug_mask) | ||
635 | dev_info(tx_ring->dev, "HW needs some more descs to do a cacheline flush. tx_pending %d, queue %d", | ||
636 | tx_pending, tx_ring->queue_index); | ||
637 | pf->tx_sluggish_count++; | ||
610 | } else { | 638 | } else { |
611 | /* update completed stats and disarm the hang check */ | 639 | /* update completed stats and disarm the hang check */ |
612 | tx_ring->tx_stats.tx_done_old = tx_ring->stats.packets; | 640 | tx_ring->tx_stats.tx_done_old = tx_ring->stats.packets; |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h index 73f4fa425697..d7a625a6a14f 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h | |||
@@ -121,6 +121,7 @@ enum i40e_dyn_idx_t { | |||
121 | /* Tx Descriptors needed, worst case */ | 121 | /* Tx Descriptors needed, worst case */ |
122 | #define TXD_USE_COUNT(S) DIV_ROUND_UP((S), I40E_MAX_DATA_PER_TXD) | 122 | #define TXD_USE_COUNT(S) DIV_ROUND_UP((S), I40E_MAX_DATA_PER_TXD) |
123 | #define DESC_NEEDED (MAX_SKB_FRAGS + 4) | 123 | #define DESC_NEEDED (MAX_SKB_FRAGS + 4) |
124 | #define I40E_MIN_DESC_PENDING 4 | ||
124 | 125 | ||
125 | #define I40E_TX_FLAGS_CSUM (u32)(1) | 126 | #define I40E_TX_FLAGS_CSUM (u32)(1) |
126 | #define I40E_TX_FLAGS_HW_VLAN (u32)(1 << 1) | 127 | #define I40E_TX_FLAGS_HW_VLAN (u32)(1 << 1) |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index 3ac6a0d2f143..da0f005370a5 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | |||
@@ -73,7 +73,7 @@ static inline bool i40e_vc_isvalid_queue_id(struct i40e_vf *vf, u8 vsi_id, | |||
73 | { | 73 | { |
74 | struct i40e_pf *pf = vf->pf; | 74 | struct i40e_pf *pf = vf->pf; |
75 | 75 | ||
76 | return qid < pf->vsi[vsi_id]->num_queue_pairs; | 76 | return qid < pf->vsi[vsi_id]->alloc_queue_pairs; |
77 | } | 77 | } |
78 | 78 | ||
79 | /** | 79 | /** |
@@ -350,6 +350,7 @@ static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_idx, | |||
350 | rx_ctx.lrxqthresh = 2; | 350 | rx_ctx.lrxqthresh = 2; |
351 | rx_ctx.crcstrip = 1; | 351 | rx_ctx.crcstrip = 1; |
352 | rx_ctx.prefena = 1; | 352 | rx_ctx.prefena = 1; |
353 | rx_ctx.l2tsel = 1; | ||
353 | 354 | ||
354 | /* clear the context in the HMC */ | 355 | /* clear the context in the HMC */ |
355 | ret = i40e_clear_lan_rx_queue_context(hw, pf_queue_id); | 356 | ret = i40e_clear_lan_rx_queue_context(hw, pf_queue_id); |
@@ -468,7 +469,7 @@ static void i40e_enable_vf_mappings(struct i40e_vf *vf) | |||
468 | wr32(hw, I40E_VPLAN_MAPENA(vf->vf_id), reg); | 469 | wr32(hw, I40E_VPLAN_MAPENA(vf->vf_id), reg); |
469 | 470 | ||
470 | /* map PF queues to VF queues */ | 471 | /* map PF queues to VF queues */ |
471 | for (j = 0; j < pf->vsi[vf->lan_vsi_index]->num_queue_pairs; j++) { | 472 | for (j = 0; j < pf->vsi[vf->lan_vsi_index]->alloc_queue_pairs; j++) { |
472 | u16 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_index, j); | 473 | u16 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_index, j); |
473 | reg = (qid & I40E_VPLAN_QTABLE_QINDEX_MASK); | 474 | reg = (qid & I40E_VPLAN_QTABLE_QINDEX_MASK); |
474 | wr32(hw, I40E_VPLAN_QTABLE(total_queue_pairs, vf->vf_id), reg); | 475 | wr32(hw, I40E_VPLAN_QTABLE(total_queue_pairs, vf->vf_id), reg); |
@@ -477,7 +478,7 @@ static void i40e_enable_vf_mappings(struct i40e_vf *vf) | |||
477 | 478 | ||
478 | /* map PF queues to VSI */ | 479 | /* map PF queues to VSI */ |
479 | for (j = 0; j < 7; j++) { | 480 | for (j = 0; j < 7; j++) { |
480 | if (j * 2 >= pf->vsi[vf->lan_vsi_index]->num_queue_pairs) { | 481 | if (j * 2 >= pf->vsi[vf->lan_vsi_index]->alloc_queue_pairs) { |
481 | reg = 0x07FF07FF; /* unused */ | 482 | reg = 0x07FF07FF; /* unused */ |
482 | } else { | 483 | } else { |
483 | u16 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_index, | 484 | u16 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_index, |
@@ -584,7 +585,7 @@ static int i40e_alloc_vf_res(struct i40e_vf *vf) | |||
584 | ret = i40e_alloc_vsi_res(vf, I40E_VSI_SRIOV); | 585 | ret = i40e_alloc_vsi_res(vf, I40E_VSI_SRIOV); |
585 | if (ret) | 586 | if (ret) |
586 | goto error_alloc; | 587 | goto error_alloc; |
587 | total_queue_pairs += pf->vsi[vf->lan_vsi_index]->num_queue_pairs; | 588 | total_queue_pairs += pf->vsi[vf->lan_vsi_index]->alloc_queue_pairs; |
588 | set_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps); | 589 | set_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps); |
589 | 590 | ||
590 | /* store the total qps number for the runtime | 591 | /* store the total qps number for the runtime |
@@ -1123,7 +1124,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf) | |||
1123 | vfres->vsi_res[i].vsi_id = vf->lan_vsi_index; | 1124 | vfres->vsi_res[i].vsi_id = vf->lan_vsi_index; |
1124 | vfres->vsi_res[i].vsi_type = I40E_VSI_SRIOV; | 1125 | vfres->vsi_res[i].vsi_type = I40E_VSI_SRIOV; |
1125 | vfres->vsi_res[i].num_queue_pairs = | 1126 | vfres->vsi_res[i].num_queue_pairs = |
1126 | pf->vsi[vf->lan_vsi_index]->num_queue_pairs; | 1127 | pf->vsi[vf->lan_vsi_index]->alloc_queue_pairs; |
1127 | memcpy(vfres->vsi_res[i].default_mac_addr, | 1128 | memcpy(vfres->vsi_res[i].default_mac_addr, |
1128 | vf->default_lan_addr.addr, ETH_ALEN); | 1129 | vf->default_lan_addr.addr, ETH_ALEN); |
1129 | i++; | 1130 | i++; |
@@ -1209,6 +1210,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1209 | struct i40e_virtchnl_vsi_queue_config_info *qci = | 1210 | struct i40e_virtchnl_vsi_queue_config_info *qci = |
1210 | (struct i40e_virtchnl_vsi_queue_config_info *)msg; | 1211 | (struct i40e_virtchnl_vsi_queue_config_info *)msg; |
1211 | struct i40e_virtchnl_queue_pair_info *qpi; | 1212 | struct i40e_virtchnl_queue_pair_info *qpi; |
1213 | struct i40e_pf *pf = vf->pf; | ||
1212 | u16 vsi_id, vsi_queue_id; | 1214 | u16 vsi_id, vsi_queue_id; |
1213 | i40e_status aq_ret = 0; | 1215 | i40e_status aq_ret = 0; |
1214 | int i; | 1216 | int i; |
@@ -1242,6 +1244,8 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) | |||
1242 | goto error_param; | 1244 | goto error_param; |
1243 | } | 1245 | } |
1244 | } | 1246 | } |
1247 | /* set vsi num_queue_pairs in use to num configured by vf */ | ||
1248 | pf->vsi[vf->lan_vsi_index]->num_queue_pairs = qci->num_queue_pairs; | ||
1245 | 1249 | ||
1246 | error_param: | 1250 | error_param: |
1247 | /* send the response to the vf */ | 1251 | /* send the response to the vf */ |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c index 003006033614..f206be917842 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c | |||
@@ -788,7 +788,8 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw, | |||
788 | 788 | ||
789 | /* bump the tail */ | 789 | /* bump the tail */ |
790 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n"); | 790 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n"); |
791 | i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, buff); | 791 | i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, |
792 | buff, buff_size); | ||
792 | (hw->aq.asq.next_to_use)++; | 793 | (hw->aq.asq.next_to_use)++; |
793 | if (hw->aq.asq.next_to_use == hw->aq.asq.count) | 794 | if (hw->aq.asq.next_to_use == hw->aq.asq.count) |
794 | hw->aq.asq.next_to_use = 0; | 795 | hw->aq.asq.next_to_use = 0; |
@@ -842,7 +843,8 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw, | |||
842 | 843 | ||
843 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, | 844 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, |
844 | "AQTX: desc and buffer writeback:\n"); | 845 | "AQTX: desc and buffer writeback:\n"); |
845 | i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff); | 846 | i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, |
847 | buff_size); | ||
846 | 848 | ||
847 | /* update the error if time out occurred */ | 849 | /* update the error if time out occurred */ |
848 | if ((!cmd_completed) && | 850 | if ((!cmd_completed) && |
@@ -938,7 +940,8 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw, | |||
938 | hw->aq.nvm_busy = false; | 940 | hw->aq.nvm_busy = false; |
939 | 941 | ||
940 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n"); | 942 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n"); |
941 | i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf); | 943 | i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf, |
944 | hw->aq.arq_buf_size); | ||
942 | 945 | ||
943 | /* Restore the original datalen and buffer address in the desc, | 946 | /* Restore the original datalen and buffer address in the desc, |
944 | * FW updates datalen to indicate the event message | 947 | * FW updates datalen to indicate the event message |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_common.c b/drivers/net/ethernet/intel/i40evf/i40e_common.c index 4ea90bf239bb..952560551964 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_common.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_common.c | |||
@@ -75,13 +75,15 @@ i40e_status i40e_set_mac_type(struct i40e_hw *hw) | |||
75 | * @mask: debug mask | 75 | * @mask: debug mask |
76 | * @desc: pointer to admin queue descriptor | 76 | * @desc: pointer to admin queue descriptor |
77 | * @buffer: pointer to command buffer | 77 | * @buffer: pointer to command buffer |
78 | * @buf_len: max length of buffer | ||
78 | * | 79 | * |
79 | * Dumps debug log about adminq command with descriptor contents. | 80 | * Dumps debug log about adminq command with descriptor contents. |
80 | **/ | 81 | **/ |
81 | void i40evf_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc, | 82 | void i40evf_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc, |
82 | void *buffer) | 83 | void *buffer, u16 buf_len) |
83 | { | 84 | { |
84 | struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc; | 85 | struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc; |
86 | u16 len = le16_to_cpu(aq_desc->datalen); | ||
85 | u8 *aq_buffer = (u8 *)buffer; | 87 | u8 *aq_buffer = (u8 *)buffer; |
86 | u32 data[4]; | 88 | u32 data[4]; |
87 | u32 i = 0; | 89 | u32 i = 0; |
@@ -105,7 +107,9 @@ void i40evf_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc, | |||
105 | if ((buffer != NULL) && (aq_desc->datalen != 0)) { | 107 | if ((buffer != NULL) && (aq_desc->datalen != 0)) { |
106 | memset(data, 0, sizeof(data)); | 108 | memset(data, 0, sizeof(data)); |
107 | i40e_debug(hw, mask, "AQ CMD Buffer:\n"); | 109 | i40e_debug(hw, mask, "AQ CMD Buffer:\n"); |
108 | for (i = 0; i < le16_to_cpu(aq_desc->datalen); i++) { | 110 | if (buf_len < len) |
111 | len = buf_len; | ||
112 | for (i = 0; i < len; i++) { | ||
109 | data[((i % 16) / 4)] |= | 113 | data[((i % 16) / 4)] |= |
110 | ((u32)aq_buffer[i]) << (8 * (i % 4)); | 114 | ((u32)aq_buffer[i]) << (8 * (i % 4)); |
111 | if ((i % 16) == 15) { | 115 | if ((i % 16) == 15) { |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_prototype.h b/drivers/net/ethernet/intel/i40evf/i40e_prototype.h index 849edcc2e398..9173834825ac 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_prototype.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_prototype.h | |||
@@ -53,10 +53,8 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw, | |||
53 | bool i40evf_asq_done(struct i40e_hw *hw); | 53 | bool i40evf_asq_done(struct i40e_hw *hw); |
54 | 54 | ||
55 | /* debug function for adminq */ | 55 | /* debug function for adminq */ |
56 | void i40evf_debug_aq(struct i40e_hw *hw, | 56 | void i40evf_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, |
57 | enum i40e_debug_mask mask, | 57 | void *desc, void *buffer, u16 buf_len); |
58 | void *desc, | ||
59 | void *buffer); | ||
60 | 58 | ||
61 | void i40e_idle_aq(struct i40e_hw *hw); | 59 | void i40e_idle_aq(struct i40e_hw *hw); |
62 | void i40evf_resume_aq(struct i40e_hw *hw); | 60 | void i40evf_resume_aq(struct i40e_hw *hw); |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c index 79bf96ca6489..64b089151add 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c | |||
@@ -163,11 +163,13 @@ static bool i40e_check_tx_hang(struct i40e_ring *tx_ring) | |||
163 | * pending but without time to complete it yet. | 163 | * pending but without time to complete it yet. |
164 | */ | 164 | */ |
165 | if ((tx_ring->tx_stats.tx_done_old == tx_ring->stats.packets) && | 165 | if ((tx_ring->tx_stats.tx_done_old == tx_ring->stats.packets) && |
166 | tx_pending) { | 166 | (tx_pending >= I40E_MIN_DESC_PENDING)) { |
167 | /* make sure it is true for two checks in a row */ | 167 | /* make sure it is true for two checks in a row */ |
168 | ret = test_and_set_bit(__I40E_HANG_CHECK_ARMED, | 168 | ret = test_and_set_bit(__I40E_HANG_CHECK_ARMED, |
169 | &tx_ring->state); | 169 | &tx_ring->state); |
170 | } else { | 170 | } else if (!(tx_ring->tx_stats.tx_done_old == tx_ring->stats.packets) || |
171 | !(tx_pending < I40E_MIN_DESC_PENDING) || | ||
172 | !(tx_pending > 0)) { | ||
171 | /* update completed stats and disarm the hang check */ | 173 | /* update completed stats and disarm the hang check */ |
172 | tx_ring->tx_stats.tx_done_old = tx_ring->stats.packets; | 174 | tx_ring->tx_stats.tx_done_old = tx_ring->stats.packets; |
173 | clear_bit(__I40E_HANG_CHECK_ARMED, &tx_ring->state); | 175 | clear_bit(__I40E_HANG_CHECK_ARMED, &tx_ring->state); |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h index 8bc6858163b0..f6dcf9dd9290 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h | |||
@@ -121,6 +121,7 @@ enum i40e_dyn_idx_t { | |||
121 | /* Tx Descriptors needed, worst case */ | 121 | /* Tx Descriptors needed, worst case */ |
122 | #define TXD_USE_COUNT(S) DIV_ROUND_UP((S), I40E_MAX_DATA_PER_TXD) | 122 | #define TXD_USE_COUNT(S) DIV_ROUND_UP((S), I40E_MAX_DATA_PER_TXD) |
123 | #define DESC_NEEDED (MAX_SKB_FRAGS + 4) | 123 | #define DESC_NEEDED (MAX_SKB_FRAGS + 4) |
124 | #define I40E_MIN_DESC_PENDING 4 | ||
124 | 125 | ||
125 | #define I40E_TX_FLAGS_CSUM (u32)(1) | 126 | #define I40E_TX_FLAGS_CSUM (u32)(1) |
126 | #define I40E_TX_FLAGS_HW_VLAN (u32)(1 << 1) | 127 | #define I40E_TX_FLAGS_HW_VLAN (u32)(1 << 1) |
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index 38429fae4fcf..8c8092567c1c 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 "0.9.40" | 39 | #define DRV_VERSION "1.0.1" |
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."; |