aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-05-30 20:51:27 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-30 20:51:27 -0400
commit648d4febcc7cc65f9e242edd26c44f54a8c171e0 (patch)
treeb070e3fce3c3f653445fd4a6077ae73f8d86c4b1
parent47162c0b7e26ef29e1e7ab030c95e60dd07526dc (diff)
parent7e612411e70a99272964045fdf898668fe95308d (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates This series contains updates to i40e and i40evf. Kevin updates the i40e and i40evf driver i40e_check_asq_alive() to ensure the length register offset is non-zero which indicates that the software has initialized the admin queue. Also removes PCTYPE definitions which are now reserved. Mitch enables descriptor prefetch for rings belonging to the virtual function. Also configures the VF minimum transmit rate to 50 Mbps rather than 0 which was be interpreted as no limit at all. Mitch found in order for the VF to achieve its programmed transmit rate, we need to set the max credit value to 4. Lastly fixes a Tx hang and firmware crash that happens after setting the MTU on a VF by not using the RESETTING state during reinit, this is because the RESETTING state means that a catastrophic hardware bad thing is happening and the driver needs to tiptoe around and not use the admin queue or registers. A reinit is no big deal and we can use the admin queue (and we should) so do not set the state to RESETTING during reinit to resolve the bug. Akeem changes the declaration of the transmit and receive rings inside several loops to eliminate declaring the same ring every time for the duration of the loop and declares them just once before the loop. Also fixes the driver to clear the recovery pending bit if pf_reset fails instead of falling through the setup process. Anjali makes a change based on feedback from Ben Hutchings that cmd->data needs to be reported in ETHTOOL_GRXCLSRLCNT and use a helper function to calculate the total filter count. Jesse removes storm control since the storm control features are not apart of the hardware and were mistakenly left in the code. Greg changes tx_lpi_status and rx_lpi_status from bool to u32 to avoid sparse errors. Shannon adds the clear_pxe AdminQ API call to tell the firmware that the driver is taking over from PXE. In addition, relaxes the firmware API check to allow more flexibility in handling newer NICs and NVMs in the field. Vasu ensures that FCoE is disabled for MFP modes since it is not supported by overriding the hardware FCoE capability. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e.h9
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_adminq.c3
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_common.c42
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ethtool.c37
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c19
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_prototype.h2
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_register.h4
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_txrx.c33
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_txrx.h7
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_type.h14
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c13
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_common.c6
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_register.h4
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_txrx.h7
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_type.h14
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c2
16 files changed, 116 insertions, 100 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index ef5bb11557e5..581898f23223 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -534,6 +534,15 @@ static inline bool i40e_rx_is_programming_status(u64 qw)
534 (qw >> I40E_RX_PROG_STATUS_DESC_LENGTH_SHIFT); 534 (qw >> I40E_RX_PROG_STATUS_DESC_LENGTH_SHIFT);
535} 535}
536 536
537/**
538 * i40e_get_fd_cnt_all - get the total FD filter space available
539 * @pf: pointer to the pf struct
540 **/
541static inline int i40e_get_fd_cnt_all(struct i40e_pf *pf)
542{
543 return pf->hw.fdir_shared_filter_count + pf->fdir_pf_filter_count;
544}
545
537/* needed by i40e_ethtool.c */ 546/* needed by i40e_ethtool.c */
538int i40e_up(struct i40e_vsi *vsi); 547int i40e_up(struct i40e_vsi *vsi);
539void i40e_down(struct i40e_vsi *vsi); 548void i40e_down(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 34415d342ece..ba2811be8be4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -587,8 +587,7 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)
587 i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi); 587 i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi);
588 hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo; 588 hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo;
589 589
590 if (hw->aq.api_maj_ver != I40E_FW_API_VERSION_MAJOR || 590 if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) {
591 hw->aq.api_min_ver > I40E_FW_API_VERSION_MINOR) {
592 ret_code = I40E_ERR_FIRMWARE_API_VERSION; 591 ret_code = I40E_ERR_FIRMWARE_API_VERSION;
593 goto init_adminq_free_arq; 592 goto init_adminq_free_arq;
594 } 593 }
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 22eefda3a530..2329e2ff2deb 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -133,7 +133,11 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc,
133 **/ 133 **/
134bool i40e_check_asq_alive(struct i40e_hw *hw) 134bool i40e_check_asq_alive(struct i40e_hw *hw)
135{ 135{
136 return !!(rd32(hw, hw->aq.asq.len) & I40E_PF_ATQLEN_ATQENABLE_MASK); 136 if (hw->aq.asq.len)
137 return !!(rd32(hw, hw->aq.asq.len) &
138 I40E_PF_ATQLEN_ATQENABLE_MASK);
139 else
140 return false;
137} 141}
138 142
139/** 143/**
@@ -789,6 +793,9 @@ void i40e_clear_pxe_mode(struct i40e_hw *hw)
789{ 793{
790 u32 reg; 794 u32 reg;
791 795
796 if (i40e_check_asq_alive(hw))
797 i40e_aq_clear_pxe_mode(hw, NULL);
798
792 /* Clear single descriptor fetch/write-back mode */ 799 /* Clear single descriptor fetch/write-back mode */
793 reg = rd32(hw, I40E_GLLAN_RCTL_0); 800 reg = rd32(hw, I40E_GLLAN_RCTL_0);
794 801
@@ -907,6 +914,33 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
907/* Admin command wrappers */ 914/* Admin command wrappers */
908 915
909/** 916/**
917 * i40e_aq_clear_pxe_mode
918 * @hw: pointer to the hw struct
919 * @cmd_details: pointer to command details structure or NULL
920 *
921 * Tell the firmware that the driver is taking over from PXE
922 **/
923i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
924 struct i40e_asq_cmd_details *cmd_details)
925{
926 i40e_status status;
927 struct i40e_aq_desc desc;
928 struct i40e_aqc_clear_pxe *cmd =
929 (struct i40e_aqc_clear_pxe *)&desc.params.raw;
930
931 i40e_fill_default_direct_cmd_desc(&desc,
932 i40e_aqc_opc_clear_pxe_mode);
933
934 cmd->rx_cnt = 0x2;
935
936 status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
937
938 wr32(hw, I40E_GLLAN_RCTL_0, 0x1);
939
940 return status;
941}
942
943/**
910 * i40e_aq_set_link_restart_an 944 * i40e_aq_set_link_restart_an
911 * @hw: pointer to the hw struct 945 * @hw: pointer to the hw struct
912 * @cmd_details: pointer to command details structure or NULL 946 * @cmd_details: pointer to command details structure or NULL
@@ -1915,6 +1949,12 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
1915 } 1949 }
1916 } 1950 }
1917 1951
1952 /* Software override ensuring FCoE is disabled if npar or mfp
1953 * mode because it is not supported in these modes.
1954 */
1955 if (p->npar_enable || p->mfp_mode_1)
1956 p->fcoe = false;
1957
1918 /* additional HW specific goodies that might 1958 /* additional HW specific goodies that might
1919 * someday be HW version specific 1959 * someday be HW version specific
1920 */ 1960 */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 861e1db47a71..354181d17612 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -633,6 +633,7 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
633 struct ethtool_stats *stats, u64 *data) 633 struct ethtool_stats *stats, u64 *data)
634{ 634{
635 struct i40e_netdev_priv *np = netdev_priv(netdev); 635 struct i40e_netdev_priv *np = netdev_priv(netdev);
636 struct i40e_ring *tx_ring, *rx_ring;
636 struct i40e_vsi *vsi = np->vsi; 637 struct i40e_vsi *vsi = np->vsi;
637 struct i40e_pf *pf = vsi->back; 638 struct i40e_pf *pf = vsi->back;
638 int i = 0; 639 int i = 0;
@@ -650,8 +651,7 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
650 } 651 }
651 rcu_read_lock(); 652 rcu_read_lock();
652 for (j = 0; j < vsi->num_queue_pairs; j++) { 653 for (j = 0; j < vsi->num_queue_pairs; j++) {
653 struct i40e_ring *tx_ring = ACCESS_ONCE(vsi->tx_rings[j]); 654 tx_ring = ACCESS_ONCE(vsi->tx_rings[j]);
654 struct i40e_ring *rx_ring;
655 655
656 if (!tx_ring) 656 if (!tx_ring)
657 continue; 657 continue;
@@ -1131,8 +1131,7 @@ static int i40e_get_ethtool_fdir_all(struct i40e_pf *pf,
1131 int cnt = 0; 1131 int cnt = 0;
1132 1132
1133 /* report total rule count */ 1133 /* report total rule count */
1134 cmd->data = pf->hw.fdir_shared_filter_count + 1134 cmd->data = i40e_get_fd_cnt_all(pf);
1135 pf->fdir_pf_filter_count;
1136 1135
1137 hlist_for_each_entry_safe(rule, node2, 1136 hlist_for_each_entry_safe(rule, node2,
1138 &pf->fdir_filter_list, fdir_node) { 1137 &pf->fdir_filter_list, fdir_node) {
@@ -1166,10 +1165,6 @@ static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf,
1166 struct i40e_fdir_filter *rule = NULL; 1165 struct i40e_fdir_filter *rule = NULL;
1167 struct hlist_node *node2; 1166 struct hlist_node *node2;
1168 1167
1169 /* report total rule count */
1170 cmd->data = pf->hw.fdir_shared_filter_count +
1171 pf->fdir_pf_filter_count;
1172
1173 hlist_for_each_entry_safe(rule, node2, 1168 hlist_for_each_entry_safe(rule, node2,
1174 &pf->fdir_filter_list, fdir_node) { 1169 &pf->fdir_filter_list, fdir_node) {
1175 if (fsp->location <= rule->fd_id) 1170 if (fsp->location <= rule->fd_id)
@@ -1220,6 +1215,8 @@ static int i40e_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
1220 break; 1215 break;
1221 case ETHTOOL_GRXCLSRLCNT: 1216 case ETHTOOL_GRXCLSRLCNT:
1222 cmd->rule_cnt = pf->fdir_pf_active_filters; 1217 cmd->rule_cnt = pf->fdir_pf_active_filters;
1218 /* report total rule count */
1219 cmd->data = i40e_get_fd_cnt_all(pf);
1223 ret = 0; 1220 ret = 0;
1224 break; 1221 break;
1225 case ETHTOOL_GRXCLSRULE: 1222 case ETHTOOL_GRXCLSRULE:
@@ -1288,16 +1285,12 @@ static int i40e_set_rss_hash_opt(struct i40e_pf *pf, struct ethtool_rxnfc *nfc)
1288 case UDP_V4_FLOW: 1285 case UDP_V4_FLOW:
1289 switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) { 1286 switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) {
1290 case 0: 1287 case 0:
1291 hena &= 1288 hena &= ~(((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) |
1292 ~(((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP) | 1289 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4));
1293 ((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP) |
1294 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4));
1295 break; 1290 break;
1296 case (RXH_L4_B_0_1 | RXH_L4_B_2_3): 1291 case (RXH_L4_B_0_1 | RXH_L4_B_2_3):
1297 hena |= 1292 hena |= (((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) |
1298 (((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP) | 1293 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4));
1299 ((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP) |
1300 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4));
1301 break; 1294 break;
1302 default: 1295 default:
1303 return -EINVAL; 1296 return -EINVAL;
@@ -1306,16 +1299,12 @@ static int i40e_set_rss_hash_opt(struct i40e_pf *pf, struct ethtool_rxnfc *nfc)
1306 case UDP_V6_FLOW: 1299 case UDP_V6_FLOW:
1307 switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) { 1300 switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) {
1308 case 0: 1301 case 0:
1309 hena &= 1302 hena &= ~(((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP) |
1310 ~(((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP) | 1303 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6));
1311 ((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP) |
1312 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6));
1313 break; 1304 break;
1314 case (RXH_L4_B_0_1 | RXH_L4_B_2_3): 1305 case (RXH_L4_B_0_1 | RXH_L4_B_2_3):
1315 hena |= 1306 hena |= (((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP) |
1316 (((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP) | 1307 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6));
1317 ((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP) |
1318 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6));
1319 break; 1308 break;
1320 default: 1309 default:
1321 return -EINVAL; 1310 return -EINVAL;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 8e15ced897a6..cef3db44301e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -356,6 +356,7 @@ static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
356 struct rtnl_link_stats64 *stats) 356 struct rtnl_link_stats64 *stats)
357{ 357{
358 struct i40e_netdev_priv *np = netdev_priv(netdev); 358 struct i40e_netdev_priv *np = netdev_priv(netdev);
359 struct i40e_ring *tx_ring, *rx_ring;
359 struct i40e_vsi *vsi = np->vsi; 360 struct i40e_vsi *vsi = np->vsi;
360 struct rtnl_link_stats64 *vsi_stats = i40e_get_vsi_stats_struct(vsi); 361 struct rtnl_link_stats64 *vsi_stats = i40e_get_vsi_stats_struct(vsi);
361 int i; 362 int i;
@@ -368,7 +369,6 @@ static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
368 369
369 rcu_read_lock(); 370 rcu_read_lock();
370 for (i = 0; i < vsi->num_queue_pairs; i++) { 371 for (i = 0; i < vsi->num_queue_pairs; i++) {
371 struct i40e_ring *tx_ring, *rx_ring;
372 u64 bytes, packets; 372 u64 bytes, packets;
373 unsigned int start; 373 unsigned int start;
374 374
@@ -2415,6 +2415,7 @@ static int i40e_vsi_configure_rx(struct i40e_vsi *vsi)
2415 **/ 2415 **/
2416static void i40e_vsi_config_dcb_rings(struct i40e_vsi *vsi) 2416static void i40e_vsi_config_dcb_rings(struct i40e_vsi *vsi)
2417{ 2417{
2418 struct i40e_ring *tx_ring, *rx_ring;
2418 u16 qoffset, qcount; 2419 u16 qoffset, qcount;
2419 int i, n; 2420 int i, n;
2420 2421
@@ -2428,8 +2429,8 @@ static void i40e_vsi_config_dcb_rings(struct i40e_vsi *vsi)
2428 qoffset = vsi->tc_config.tc_info[n].qoffset; 2429 qoffset = vsi->tc_config.tc_info[n].qoffset;
2429 qcount = vsi->tc_config.tc_info[n].qcount; 2430 qcount = vsi->tc_config.tc_info[n].qcount;
2430 for (i = qoffset; i < (qoffset + qcount); i++) { 2431 for (i = qoffset; i < (qoffset + qcount); i++) {
2431 struct i40e_ring *rx_ring = vsi->rx_rings[i]; 2432 rx_ring = vsi->rx_rings[i];
2432 struct i40e_ring *tx_ring = vsi->tx_rings[i]; 2433 tx_ring = vsi->tx_rings[i];
2433 rx_ring->dcb_tc = n; 2434 rx_ring->dcb_tc = n;
2434 tx_ring->dcb_tc = n; 2435 tx_ring->dcb_tc = n;
2435 } 2436 }
@@ -2567,7 +2568,6 @@ static void i40e_enable_misc_int_causes(struct i40e_hw *hw)
2567 I40E_PFINT_ICR0_ENA_PCI_EXCEPTION_MASK | 2568 I40E_PFINT_ICR0_ENA_PCI_EXCEPTION_MASK |
2568 I40E_PFINT_ICR0_ENA_GPIO_MASK | 2569 I40E_PFINT_ICR0_ENA_GPIO_MASK |
2569 I40E_PFINT_ICR0_ENA_TIMESYNC_MASK | 2570 I40E_PFINT_ICR0_ENA_TIMESYNC_MASK |
2570 I40E_PFINT_ICR0_ENA_STORM_DETECT_MASK |
2571 I40E_PFINT_ICR0_ENA_HMC_ERR_MASK | 2571 I40E_PFINT_ICR0_ENA_HMC_ERR_MASK |
2572 I40E_PFINT_ICR0_ENA_VFLR_MASK | 2572 I40E_PFINT_ICR0_ENA_VFLR_MASK |
2573 I40E_PFINT_ICR0_ENA_ADMINQ_MASK; 2573 I40E_PFINT_ICR0_ENA_ADMINQ_MASK;
@@ -4711,8 +4711,7 @@ void i40e_fdir_check_and_reenable(struct i40e_pf *pf)
4711 (pf->flags & I40E_FLAG_FD_SB_ENABLED)) 4711 (pf->flags & I40E_FLAG_FD_SB_ENABLED))
4712 return; 4712 return;
4713 fcnt_prog = i40e_get_current_fd_count(pf); 4713 fcnt_prog = i40e_get_current_fd_count(pf);
4714 fcnt_avail = pf->hw.fdir_shared_filter_count + 4714 fcnt_avail = i40e_get_fd_cnt_all(pf);
4715 pf->fdir_pf_filter_count;
4716 if (fcnt_prog < (fcnt_avail - I40E_FDIR_BUFFER_HEAD_ROOM)) { 4715 if (fcnt_prog < (fcnt_avail - I40E_FDIR_BUFFER_HEAD_ROOM)) {
4717 if ((pf->flags & I40E_FLAG_FD_SB_ENABLED) && 4716 if ((pf->flags & I40E_FLAG_FD_SB_ENABLED) &&
4718 (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED)) { 4717 (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED)) {
@@ -5368,8 +5367,10 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
5368 * because the reset will make them disappear. 5367 * because the reset will make them disappear.
5369 */ 5368 */
5370 ret = i40e_pf_reset(hw); 5369 ret = i40e_pf_reset(hw);
5371 if (ret) 5370 if (ret) {
5372 dev_info(&pf->pdev->dev, "PF reset failed, %d\n", ret); 5371 dev_info(&pf->pdev->dev, "PF reset failed, %d\n", ret);
5372 goto end_core_reset;
5373 }
5373 pf->pfr_count++; 5374 pf->pfr_count++;
5374 5375
5375 if (test_bit(__I40E_DOWN, &pf->state)) 5376 if (test_bit(__I40E_DOWN, &pf->state))
@@ -5948,14 +5949,12 @@ static void i40e_vsi_clear_rings(struct i40e_vsi *vsi)
5948 **/ 5949 **/
5949static int i40e_alloc_rings(struct i40e_vsi *vsi) 5950static int i40e_alloc_rings(struct i40e_vsi *vsi)
5950{ 5951{
5952 struct i40e_ring *tx_ring, *rx_ring;
5951 struct i40e_pf *pf = vsi->back; 5953 struct i40e_pf *pf = vsi->back;
5952 int i; 5954 int i;
5953 5955
5954 /* Set basic values in the rings to be used later during open() */ 5956 /* Set basic values in the rings to be used later during open() */
5955 for (i = 0; i < vsi->alloc_queue_pairs; i++) { 5957 for (i = 0; i < vsi->alloc_queue_pairs; i++) {
5956 struct i40e_ring *tx_ring;
5957 struct i40e_ring *rx_ring;
5958
5959 /* allocate space for both Tx and Rx in one shot */ 5958 /* allocate space for both Tx and Rx in one shot */
5960 tx_ring = kzalloc(sizeof(struct i40e_ring) * 2, GFP_KERNEL); 5959 tx_ring = kzalloc(sizeof(struct i40e_ring) * 2, GFP_KERNEL);
5961 if (!tx_ring) 5960 if (!tx_ring)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index d351832bf235..57172f98f9f8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -74,6 +74,8 @@ i40e_status i40e_aq_set_phy_reset(struct i40e_hw *hw,
74 struct i40e_asq_cmd_details *cmd_details); 74 struct i40e_asq_cmd_details *cmd_details);
75i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id, 75i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id,
76 struct i40e_asq_cmd_details *cmd_details); 76 struct i40e_asq_cmd_details *cmd_details);
77i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
78 struct i40e_asq_cmd_details *cmd_details);
77i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw, 79i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw,
78 struct i40e_asq_cmd_details *cmd_details); 80 struct i40e_asq_cmd_details *cmd_details);
79i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, 81i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_register.h b/drivers/net/ethernet/intel/i40e/i40e_register.h
index 1d40f425acf1..25c928615f55 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_register.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_register.h
@@ -1340,8 +1340,6 @@
1340#define I40E_PFINT_ICR0_GPIO_MASK (0x1 << I40E_PFINT_ICR0_GPIO_SHIFT) 1340#define I40E_PFINT_ICR0_GPIO_MASK (0x1 << I40E_PFINT_ICR0_GPIO_SHIFT)
1341#define I40E_PFINT_ICR0_TIMESYNC_SHIFT 23 1341#define I40E_PFINT_ICR0_TIMESYNC_SHIFT 23
1342#define I40E_PFINT_ICR0_TIMESYNC_MASK (0x1 << I40E_PFINT_ICR0_TIMESYNC_SHIFT) 1342#define I40E_PFINT_ICR0_TIMESYNC_MASK (0x1 << I40E_PFINT_ICR0_TIMESYNC_SHIFT)
1343#define I40E_PFINT_ICR0_STORM_DETECT_SHIFT 24
1344#define I40E_PFINT_ICR0_STORM_DETECT_MASK (0x1 << I40E_PFINT_ICR0_STORM_DETECT_SHIFT)
1345#define I40E_PFINT_ICR0_LINK_STAT_CHANGE_SHIFT 25 1343#define I40E_PFINT_ICR0_LINK_STAT_CHANGE_SHIFT 25
1346#define I40E_PFINT_ICR0_LINK_STAT_CHANGE_MASK (0x1 << I40E_PFINT_ICR0_LINK_STAT_CHANGE_SHIFT) 1344#define I40E_PFINT_ICR0_LINK_STAT_CHANGE_MASK (0x1 << I40E_PFINT_ICR0_LINK_STAT_CHANGE_SHIFT)
1347#define I40E_PFINT_ICR0_HMC_ERR_SHIFT 26 1345#define I40E_PFINT_ICR0_HMC_ERR_SHIFT 26
@@ -1367,8 +1365,6 @@
1367#define I40E_PFINT_ICR0_ENA_GPIO_MASK (0x1 << I40E_PFINT_ICR0_ENA_GPIO_SHIFT) 1365#define I40E_PFINT_ICR0_ENA_GPIO_MASK (0x1 << I40E_PFINT_ICR0_ENA_GPIO_SHIFT)
1368#define I40E_PFINT_ICR0_ENA_TIMESYNC_SHIFT 23 1366#define I40E_PFINT_ICR0_ENA_TIMESYNC_SHIFT 23
1369#define I40E_PFINT_ICR0_ENA_TIMESYNC_MASK (0x1 << I40E_PFINT_ICR0_ENA_TIMESYNC_SHIFT) 1367#define I40E_PFINT_ICR0_ENA_TIMESYNC_MASK (0x1 << I40E_PFINT_ICR0_ENA_TIMESYNC_SHIFT)
1370#define I40E_PFINT_ICR0_ENA_STORM_DETECT_SHIFT 24
1371#define I40E_PFINT_ICR0_ENA_STORM_DETECT_MASK (0x1 << I40E_PFINT_ICR0_ENA_STORM_DETECT_SHIFT)
1372#define I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_SHIFT 25 1368#define I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_SHIFT 25
1373#define I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_MASK (0x1 << I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_SHIFT) 1369#define I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_MASK (0x1 << I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_SHIFT)
1374#define I40E_PFINT_ICR0_ENA_HMC_ERR_SHIFT 26 1370#define I40E_PFINT_ICR0_ENA_HMC_ERR_SHIFT 26
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 8d0ef445fa44..5a2218762db1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -184,7 +184,6 @@ static int i40e_add_del_fdir_udpv4(struct i40e_vsi *vsi,
184 struct iphdr *ip; 184 struct iphdr *ip;
185 bool err = false; 185 bool err = false;
186 int ret; 186 int ret;
187 int i;
188 static char packet[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0, 187 static char packet[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0,
189 0x45, 0, 0, 0x1c, 0, 0, 0x40, 0, 0x40, 0x11, 0, 0, 0, 0, 0, 0, 188 0x45, 0, 0, 0x1c, 0, 0, 0x40, 0, 0x40, 0x11, 0, 0, 0, 0, 0, 0,
190 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 189 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
@@ -200,21 +199,17 @@ static int i40e_add_del_fdir_udpv4(struct i40e_vsi *vsi,
200 ip->saddr = fd_data->src_ip[0]; 199 ip->saddr = fd_data->src_ip[0];
201 udp->source = fd_data->src_port; 200 udp->source = fd_data->src_port;
202 201
203 for (i = I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP; 202 fd_data->pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
204 i <= I40E_FILTER_PCTYPE_NONF_IPV4_UDP; i++) { 203 ret = i40e_program_fdir_filter(fd_data, raw_packet, pf, add);
205 fd_data->pctype = i; 204 if (ret) {
206 ret = i40e_program_fdir_filter(fd_data, raw_packet, pf, add); 205 dev_info(&pf->pdev->dev,
207 206 "Filter command send failed for PCTYPE %d (ret = %d)\n",
208 if (ret) { 207 fd_data->pctype, ret);
209 dev_info(&pf->pdev->dev, 208 err = true;
210 "Filter command send failed for PCTYPE %d (ret = %d)\n", 209 } else {
211 fd_data->pctype, ret); 210 dev_info(&pf->pdev->dev,
212 err = true; 211 "Filter OK for PCTYPE %d (ret = %d)\n",
213 } else { 212 fd_data->pctype, ret);
214 dev_info(&pf->pdev->dev,
215 "Filter OK for PCTYPE %d (ret = %d)\n",
216 fd_data->pctype, ret);
217 }
218 } 213 }
219 214
220 return err ? -EOPNOTSUPP : 0; 215 return err ? -EOPNOTSUPP : 0;
@@ -263,7 +258,7 @@ static int i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,
263 } 258 }
264 } 259 }
265 260
266 fd_data->pctype = I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN; 261 fd_data->pctype = I40E_FILTER_PCTYPE_NONF_IPV4_TCP;
267 ret = i40e_program_fdir_filter(fd_data, raw_packet, pf, add); 262 ret = i40e_program_fdir_filter(fd_data, raw_packet, pf, add);
268 263
269 if (ret) { 264 if (ret) {
@@ -456,9 +451,7 @@ static void i40e_fd_handle_status(struct i40e_ring *rx_ring,
456 451
457 /* filter programming failed most likely due to table full */ 452 /* filter programming failed most likely due to table full */
458 fcnt_prog = i40e_get_current_fd_count(pf); 453 fcnt_prog = i40e_get_current_fd_count(pf);
459 fcnt_avail = pf->hw.fdir_shared_filter_count + 454 fcnt_avail = i40e_get_fd_cnt_all(pf);
460 pf->fdir_pf_filter_count;
461
462 /* If ATR is running fcnt_prog can quickly change, 455 /* If ATR is running fcnt_prog can quickly change,
463 * if we are very close to full, it makes sense to disable 456 * if we are very close to full, it makes sense to disable
464 * FD ATR/SB and then re-enable it when there is room. 457 * FD ATR/SB and then re-enable it when there is room.
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
index d5349698e513..d5e3f5430284 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
@@ -27,7 +27,7 @@
27#ifndef _I40E_TXRX_H_ 27#ifndef _I40E_TXRX_H_
28#define _I40E_TXRX_H_ 28#define _I40E_TXRX_H_
29 29
30/* Interrupt Throttling and Rate Limiting (storm control) Goodies */ 30/* Interrupt Throttling and Rate Limiting Goodies */
31 31
32#define I40E_MAX_ITR 0x0FF0 /* reg uses 2 usec resolution */ 32#define I40E_MAX_ITR 0x0FF0 /* reg uses 2 usec resolution */
33#define I40E_MIN_ITR 0x0004 /* reg uses 2 usec resolution */ 33#define I40E_MIN_ITR 0x0004 /* reg uses 2 usec resolution */
@@ -69,16 +69,11 @@ enum i40e_dyn_idx_t {
69 69
70/* Supported RSS offloads */ 70/* Supported RSS offloads */
71#define I40E_DEFAULT_RSS_HENA ( \ 71#define I40E_DEFAULT_RSS_HENA ( \
72 ((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP) | \
73 ((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP) | \
74 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | \ 72 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | \
75 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_SCTP) | \ 73 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_SCTP) | \
76 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN) | \
77 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | \ 74 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | \
78 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER) | \ 75 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER) | \
79 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4) | \ 76 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4) | \
80 ((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP) | \
81 ((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP) | \
82 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP) | \ 77 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP) | \
83 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN) | \ 78 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN) | \
84 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP) | \ 79 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP) | \
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index c4df8bac2db1..71f9718caf0a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -866,18 +866,14 @@ struct i40e_filter_program_desc {
866 866
867/* Packet Classifier Types for filters */ 867/* Packet Classifier Types for filters */
868enum i40e_filter_pctype { 868enum i40e_filter_pctype {
869 /* Note: Values 0-28 are reserved for future use */ 869 /* Note: Values 0-30 are reserved for future use */
870 I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP = 29,
871 I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP = 30,
872 I40E_FILTER_PCTYPE_NONF_IPV4_UDP = 31, 870 I40E_FILTER_PCTYPE_NONF_IPV4_UDP = 31,
873 I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN = 32, 871 /* Note: Value 32 is reserved for future use */
874 I40E_FILTER_PCTYPE_NONF_IPV4_TCP = 33, 872 I40E_FILTER_PCTYPE_NONF_IPV4_TCP = 33,
875 I40E_FILTER_PCTYPE_NONF_IPV4_SCTP = 34, 873 I40E_FILTER_PCTYPE_NONF_IPV4_SCTP = 34,
876 I40E_FILTER_PCTYPE_NONF_IPV4_OTHER = 35, 874 I40E_FILTER_PCTYPE_NONF_IPV4_OTHER = 35,
877 I40E_FILTER_PCTYPE_FRAG_IPV4 = 36, 875 I40E_FILTER_PCTYPE_FRAG_IPV4 = 36,
878 /* Note: Values 37-38 are reserved for future use */ 876 /* Note: Values 37-40 are reserved for future use */
879 I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP = 39,
880 I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP = 40,
881 I40E_FILTER_PCTYPE_NONF_IPV6_UDP = 41, 877 I40E_FILTER_PCTYPE_NONF_IPV6_UDP = 41,
882 I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN = 42, 878 I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN = 42,
883 I40E_FILTER_PCTYPE_NONF_IPV6_TCP = 43, 879 I40E_FILTER_PCTYPE_NONF_IPV6_TCP = 43,
@@ -1020,8 +1016,8 @@ struct i40e_hw_port_stats {
1020 u64 mac_short_packet_dropped; /* mspdc */ 1016 u64 mac_short_packet_dropped; /* mspdc */
1021 u64 checksum_error; /* xec */ 1017 u64 checksum_error; /* xec */
1022 /* EEE LPI */ 1018 /* EEE LPI */
1023 bool tx_lpi_status; 1019 u32 tx_lpi_status;
1024 bool rx_lpi_status; 1020 u32 rx_lpi_status;
1025 u64 tx_lpi_count; /* etlpic */ 1021 u64 tx_lpi_count; /* etlpic */
1026 u64 rx_lpi_count; /* erlpic */ 1022 u64 rx_lpi_count; /* erlpic */
1027}; 1023};
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 8564b0939dc4..4e7634c83685 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -354,6 +354,7 @@ static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_idx,
354 rx_ctx.tphhead_ena = 1; 354 rx_ctx.tphhead_ena = 1;
355 rx_ctx.lrxqthresh = 2; 355 rx_ctx.lrxqthresh = 2;
356 rx_ctx.crcstrip = 1; 356 rx_ctx.crcstrip = 1;
357 rx_ctx.prefena = 1;
357 358
358 /* clear the context in the HMC */ 359 /* clear the context in the HMC */
359 ret = i40e_clear_lan_rx_queue_context(hw, pf_queue_id); 360 ret = i40e_clear_lan_rx_queue_context(hw, pf_queue_id);
@@ -2197,6 +2198,8 @@ error_pvid:
2197 return ret; 2198 return ret;
2198} 2199}
2199 2200
2201#define I40E_BW_CREDIT_DIVISOR 50 /* 50Mbps per BW credit */
2202#define I40E_MAX_BW_INACTIVE_ACCUM 4 /* device can accumulate 4 credits max */
2200/** 2203/**
2201 * i40e_ndo_set_vf_bw 2204 * i40e_ndo_set_vf_bw
2202 * @netdev: network interface device structure 2205 * @netdev: network interface device structure
@@ -2257,9 +2260,15 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate,
2257 goto error; 2260 goto error;
2258 } 2261 }
2259 2262
2263 if ((max_tx_rate < 50) && (max_tx_rate > 0)) {
2264 dev_warn(&pf->pdev->dev, "Setting max Tx rate to minimum usable value of 50Mbps.\n");
2265 max_tx_rate = 50;
2266 }
2267
2260 /* Tx rate credits are in values of 50Mbps, 0 is disabled*/ 2268 /* Tx rate credits are in values of 50Mbps, 0 is disabled*/
2261 ret = i40e_aq_config_vsi_bw_limit(&pf->hw, vsi->seid, max_tx_rate / 50, 2269 ret = i40e_aq_config_vsi_bw_limit(&pf->hw, vsi->seid,
2262 0, NULL); 2270 max_tx_rate / I40E_BW_CREDIT_DIVISOR,
2271 I40E_MAX_BW_INACTIVE_ACCUM, NULL);
2263 if (ret) { 2272 if (ret) {
2264 dev_err(&pf->pdev->dev, "Unable to set max tx rate, error code %d.\n", 2273 dev_err(&pf->pdev->dev, "Unable to set max tx rate, error code %d.\n",
2265 ret); 2274 ret);
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_common.c b/drivers/net/ethernet/intel/i40evf/i40e_common.c
index ac660963b8b7..ea0f2001cc20 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_common.c
@@ -133,7 +133,11 @@ void i40evf_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc,
133 **/ 133 **/
134bool i40evf_check_asq_alive(struct i40e_hw *hw) 134bool i40evf_check_asq_alive(struct i40e_hw *hw)
135{ 135{
136 return !!(rd32(hw, hw->aq.asq.len) & I40E_PF_ATQLEN_ATQENABLE_MASK); 136 if (hw->aq.asq.len)
137 return !!(rd32(hw, hw->aq.asq.len) &
138 I40E_PF_ATQLEN_ATQENABLE_MASK);
139 else
140 return false;
137} 141}
138 142
139/** 143/**
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_register.h b/drivers/net/ethernet/intel/i40evf/i40e_register.h
index aa4a92e3b125..7977205b1e04 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_register.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_register.h
@@ -1340,8 +1340,6 @@
1340#define I40E_PFINT_ICR0_GPIO_MASK (0x1 << I40E_PFINT_ICR0_GPIO_SHIFT) 1340#define I40E_PFINT_ICR0_GPIO_MASK (0x1 << I40E_PFINT_ICR0_GPIO_SHIFT)
1341#define I40E_PFINT_ICR0_TIMESYNC_SHIFT 23 1341#define I40E_PFINT_ICR0_TIMESYNC_SHIFT 23
1342#define I40E_PFINT_ICR0_TIMESYNC_MASK (0x1 << I40E_PFINT_ICR0_TIMESYNC_SHIFT) 1342#define I40E_PFINT_ICR0_TIMESYNC_MASK (0x1 << I40E_PFINT_ICR0_TIMESYNC_SHIFT)
1343#define I40E_PFINT_ICR0_STORM_DETECT_SHIFT 24
1344#define I40E_PFINT_ICR0_STORM_DETECT_MASK (0x1 << I40E_PFINT_ICR0_STORM_DETECT_SHIFT)
1345#define I40E_PFINT_ICR0_LINK_STAT_CHANGE_SHIFT 25 1343#define I40E_PFINT_ICR0_LINK_STAT_CHANGE_SHIFT 25
1346#define I40E_PFINT_ICR0_LINK_STAT_CHANGE_MASK (0x1 << I40E_PFINT_ICR0_LINK_STAT_CHANGE_SHIFT) 1344#define I40E_PFINT_ICR0_LINK_STAT_CHANGE_MASK (0x1 << I40E_PFINT_ICR0_LINK_STAT_CHANGE_SHIFT)
1347#define I40E_PFINT_ICR0_HMC_ERR_SHIFT 26 1345#define I40E_PFINT_ICR0_HMC_ERR_SHIFT 26
@@ -1367,8 +1365,6 @@
1367#define I40E_PFINT_ICR0_ENA_GPIO_MASK (0x1 << I40E_PFINT_ICR0_ENA_GPIO_SHIFT) 1365#define I40E_PFINT_ICR0_ENA_GPIO_MASK (0x1 << I40E_PFINT_ICR0_ENA_GPIO_SHIFT)
1368#define I40E_PFINT_ICR0_ENA_TIMESYNC_SHIFT 23 1366#define I40E_PFINT_ICR0_ENA_TIMESYNC_SHIFT 23
1369#define I40E_PFINT_ICR0_ENA_TIMESYNC_MASK (0x1 << I40E_PFINT_ICR0_ENA_TIMESYNC_SHIFT) 1367#define I40E_PFINT_ICR0_ENA_TIMESYNC_MASK (0x1 << I40E_PFINT_ICR0_ENA_TIMESYNC_SHIFT)
1370#define I40E_PFINT_ICR0_ENA_STORM_DETECT_SHIFT 24
1371#define I40E_PFINT_ICR0_ENA_STORM_DETECT_MASK (0x1 << I40E_PFINT_ICR0_ENA_STORM_DETECT_SHIFT)
1372#define I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_SHIFT 25 1368#define I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_SHIFT 25
1373#define I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_MASK (0x1 << I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_SHIFT) 1369#define I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_MASK (0x1 << I40E_PFINT_ICR0_ENA_LINK_STAT_CHANGE_SHIFT)
1374#define I40E_PFINT_ICR0_ENA_HMC_ERR_SHIFT 26 1370#define I40E_PFINT_ICR0_ENA_HMC_ERR_SHIFT 26
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h
index d0119d0a9fcf..af639d8608a5 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h
@@ -27,7 +27,7 @@
27#ifndef _I40E_TXRX_H_ 27#ifndef _I40E_TXRX_H_
28#define _I40E_TXRX_H_ 28#define _I40E_TXRX_H_
29 29
30/* Interrupt Throttling and Rate Limiting (storm control) Goodies */ 30/* Interrupt Throttling and Rate Limiting Goodies */
31 31
32#define I40E_MAX_ITR 0x0FF0 /* reg uses 2 usec resolution */ 32#define I40E_MAX_ITR 0x0FF0 /* reg uses 2 usec resolution */
33#define I40E_MIN_ITR 0x0004 /* reg uses 2 usec resolution */ 33#define I40E_MIN_ITR 0x0004 /* reg uses 2 usec resolution */
@@ -69,16 +69,11 @@ enum i40e_dyn_idx_t {
69 69
70/* Supported RSS offloads */ 70/* Supported RSS offloads */
71#define I40E_DEFAULT_RSS_HENA ( \ 71#define I40E_DEFAULT_RSS_HENA ( \
72 ((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP) | \
73 ((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP) | \
74 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | \ 72 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | \
75 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_SCTP) | \ 73 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_SCTP) | \
76 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN) | \
77 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | \ 74 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | \
78 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER) | \ 75 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER) | \
79 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4) | \ 76 ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4) | \
80 ((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP) | \
81 ((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP) | \
82 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP) | \ 77 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP) | \
83 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN) | \ 78 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN) | \
84 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP) | \ 79 ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP) | \
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h
index fb5371ad1cb9..67082f7bfcef 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h
@@ -866,18 +866,14 @@ struct i40e_filter_program_desc {
866 866
867/* Packet Classifier Types for filters */ 867/* Packet Classifier Types for filters */
868enum i40e_filter_pctype { 868enum i40e_filter_pctype {
869 /* Note: Values 0-28 are reserved for future use */ 869 /* Note: Values 0-30 are reserved for future use */
870 I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP = 29,
871 I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP = 30,
872 I40E_FILTER_PCTYPE_NONF_IPV4_UDP = 31, 870 I40E_FILTER_PCTYPE_NONF_IPV4_UDP = 31,
873 I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN = 32, 871 /* Note: Value 32 is reserved for future use */
874 I40E_FILTER_PCTYPE_NONF_IPV4_TCP = 33, 872 I40E_FILTER_PCTYPE_NONF_IPV4_TCP = 33,
875 I40E_FILTER_PCTYPE_NONF_IPV4_SCTP = 34, 873 I40E_FILTER_PCTYPE_NONF_IPV4_SCTP = 34,
876 I40E_FILTER_PCTYPE_NONF_IPV4_OTHER = 35, 874 I40E_FILTER_PCTYPE_NONF_IPV4_OTHER = 35,
877 I40E_FILTER_PCTYPE_FRAG_IPV4 = 36, 875 I40E_FILTER_PCTYPE_FRAG_IPV4 = 36,
878 /* Note: Values 37-38 are reserved for future use */ 876 /* Note: Values 37-40 are reserved for future use */
879 I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP = 39,
880 I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP = 40,
881 I40E_FILTER_PCTYPE_NONF_IPV6_UDP = 41, 877 I40E_FILTER_PCTYPE_NONF_IPV6_UDP = 41,
882 I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN = 42, 878 I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN = 42,
883 I40E_FILTER_PCTYPE_NONF_IPV6_TCP = 43, 879 I40E_FILTER_PCTYPE_NONF_IPV6_TCP = 43,
@@ -1020,8 +1016,8 @@ struct i40e_hw_port_stats {
1020 u64 mac_short_packet_dropped; /* mspdc */ 1016 u64 mac_short_packet_dropped; /* mspdc */
1021 u64 checksum_error; /* xec */ 1017 u64 checksum_error; /* xec */
1022 /* EEE LPI */ 1018 /* EEE LPI */
1023 bool tx_lpi_status; 1019 u32 tx_lpi_status;
1024 bool rx_lpi_status; 1020 u32 rx_lpi_status;
1025 u64 tx_lpi_count; /* etlpic */ 1021 u64 tx_lpi_count; /* etlpic */
1026 u64 rx_lpi_count; /* erlpic */ 1022 u64 rx_lpi_count; /* erlpic */
1027}; 1023};
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 23c9ff6698bc..632c2b32afa1 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1844,8 +1844,6 @@ void i40evf_reinit_locked(struct i40evf_adapter *adapter)
1844 1844
1845 WARN_ON(in_interrupt()); 1845 WARN_ON(in_interrupt());
1846 1846
1847 adapter->state = __I40EVF_RESETTING;
1848
1849 i40evf_down(adapter); 1847 i40evf_down(adapter);
1850 1848
1851 /* allocate transmit descriptors */ 1849 /* allocate transmit descriptors */