Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2015-06-26

This series contains fixes for igb, e1000e and i40evf.

Todd disables IPv6 extension header processing due to a hardware errata
and bumps the driver version.

Yanir provides six fixes for e1000e. First is a fix for a locking issue
where we were not always taking the pci_bus_sem semaphore all the time
when calling pci_disable_link_state_locked(), so fix the code to only call
pci_disable_link_state_locked() when the semaphore has been acquired,
otherwise call pci_disable_link_state(). A previous fix for i219 where
the hardware prevented ULP entry caused EEE in Sx not the be enabled, so
modify the code flow that allows both ULP and EEE in Sx. Fix an issue
when running 10/100 full duplex on i219 where CRC errors were occurring
by increasing the IPG from 8 to 0xC as per the hardware developers.
Fix a data corruption issue found on some platforms by increasing the
minimum gap between the PHY FIFO read and write pointers. Fix i219,
which does not require the K1 workaround for LPT devices.

Mitch provides a i40evf fix for a panic when changing MTU. Down was
requesting queue disables, but then exited immediately without waiting
for the queues to actually be disabled. This could allow any function
called after i40evf_down() to run immediately, including i40evf_up(),
and causes a memory leak. Fixed the issue by removing the whole
reinit_locked function which allows for the driver to handle the state
changes by requesting reset from the periodic timer. The second fix
resolves an issue where RSS was being configured as though it is using
the maximum number of queue. This can cause the device to drop a lot
of receive traffic, as the packets get assigned to non-functional queues.
This is resolved by only configuring RSS with the number of active queues.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+202 -108
+100 -30
drivers/net/ethernet/intel/e1000e/ich8lan.c
··· 237 237 if (ret_val) 238 238 return false; 239 239 out: 240 - if ((hw->mac.type == e1000_pch_lpt) || 241 - (hw->mac.type == e1000_pch_spt)) { 242 - /* Unforce SMBus mode in PHY */ 243 - e1e_rphy_locked(hw, CV_SMB_CTRL, &phy_reg); 244 - phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS; 245 - e1e_wphy_locked(hw, CV_SMB_CTRL, phy_reg); 240 + if ((hw->mac.type == e1000_pch_lpt) || (hw->mac.type == e1000_pch_spt)) { 241 + /* Only unforce SMBus if ME is not active */ 242 + if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { 243 + /* Unforce SMBus mode in PHY */ 244 + e1e_rphy_locked(hw, CV_SMB_CTRL, &phy_reg); 245 + phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS; 246 + e1e_wphy_locked(hw, CV_SMB_CTRL, phy_reg); 246 247 247 - /* Unforce SMBus mode in MAC */ 248 - mac_reg = er32(CTRL_EXT); 249 - mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; 250 - ew32(CTRL_EXT, mac_reg); 248 + /* Unforce SMBus mode in MAC */ 249 + mac_reg = er32(CTRL_EXT); 250 + mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; 251 + ew32(CTRL_EXT, mac_reg); 252 + } 251 253 } 252 254 253 255 return true; ··· 1089 1087 u32 mac_reg; 1090 1088 s32 ret_val = 0; 1091 1089 u16 phy_reg; 1090 + u16 oem_reg = 0; 1092 1091 1093 1092 if ((hw->mac.type < e1000_pch_lpt) || 1094 1093 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_LM) || ··· 1131 1128 if (ret_val) 1132 1129 goto out; 1133 1130 1134 - /* Si workaround for ULP entry flow on i127/rev6 h/w. Enable 1135 - * LPLU and disable Gig speed when entering ULP 1136 - */ 1137 - if ((hw->phy.type == e1000_phy_i217) && (hw->phy.revision == 6)) { 1138 - ret_val = e1000_read_phy_reg_hv_locked(hw, HV_OEM_BITS, 1139 - &phy_reg); 1140 - if (ret_val) 1141 - goto release; 1142 - phy_reg |= HV_OEM_BITS_LPLU | HV_OEM_BITS_GBE_DIS; 1143 - ret_val = e1000_write_phy_reg_hv_locked(hw, HV_OEM_BITS, 1144 - phy_reg); 1145 - if (ret_val) 1146 - goto release; 1147 - } 1148 - 1149 1131 /* Force SMBus mode in PHY */ 1150 1132 ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg); 1151 1133 if (ret_val) ··· 1143 1155 mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS; 1144 1156 ew32(CTRL_EXT, mac_reg); 1145 1157 1158 + /* Si workaround for ULP entry flow on i127/rev6 h/w. Enable 1159 + * LPLU and disable Gig speed when entering ULP 1160 + */ 1161 + if ((hw->phy.type == e1000_phy_i217) && (hw->phy.revision == 6)) { 1162 + ret_val = e1000_read_phy_reg_hv_locked(hw, HV_OEM_BITS, 1163 + &oem_reg); 1164 + if (ret_val) 1165 + goto release; 1166 + 1167 + phy_reg = oem_reg; 1168 + phy_reg |= HV_OEM_BITS_LPLU | HV_OEM_BITS_GBE_DIS; 1169 + 1170 + ret_val = e1000_write_phy_reg_hv_locked(hw, HV_OEM_BITS, 1171 + phy_reg); 1172 + 1173 + if (ret_val) 1174 + goto release; 1175 + } 1176 + 1146 1177 /* Set Inband ULP Exit, Reset to SMBus mode and 1147 1178 * Disable SMBus Release on PERST# in PHY 1148 1179 */ ··· 1173 1166 if (to_sx) { 1174 1167 if (er32(WUFC) & E1000_WUFC_LNKC) 1175 1168 phy_reg |= I218_ULP_CONFIG1_WOL_HOST; 1169 + else 1170 + phy_reg &= ~I218_ULP_CONFIG1_WOL_HOST; 1176 1171 1177 1172 phy_reg |= I218_ULP_CONFIG1_STICKY_ULP; 1173 + phy_reg &= ~I218_ULP_CONFIG1_INBAND_EXIT; 1178 1174 } else { 1179 1175 phy_reg |= I218_ULP_CONFIG1_INBAND_EXIT; 1176 + phy_reg &= ~I218_ULP_CONFIG1_STICKY_ULP; 1177 + phy_reg &= ~I218_ULP_CONFIG1_WOL_HOST; 1180 1178 } 1181 1179 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); 1182 1180 ··· 1193 1181 /* Commit ULP changes in PHY by starting auto ULP configuration */ 1194 1182 phy_reg |= I218_ULP_CONFIG1_START; 1195 1183 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); 1184 + 1185 + if ((hw->phy.type == e1000_phy_i217) && (hw->phy.revision == 6) && 1186 + to_sx && (er32(STATUS) & E1000_STATUS_LU)) { 1187 + ret_val = e1000_write_phy_reg_hv_locked(hw, HV_OEM_BITS, 1188 + oem_reg); 1189 + if (ret_val) 1190 + goto release; 1191 + } 1192 + 1196 1193 release: 1197 1194 hw->phy.ops.release(hw); 1198 1195 out: ··· 1400 1379 if (((hw->mac.type == e1000_pch2lan) || 1401 1380 (hw->mac.type == e1000_pch_lpt) || 1402 1381 (hw->mac.type == e1000_pch_spt)) && link) { 1403 - u32 reg; 1382 + u16 speed, duplex; 1404 1383 1405 - reg = er32(STATUS); 1384 + e1000e_get_speed_and_duplex_copper(hw, &speed, &duplex); 1406 1385 tipg_reg = er32(TIPG); 1407 1386 tipg_reg &= ~E1000_TIPG_IPGT_MASK; 1408 1387 1409 - if (!(reg & (E1000_STATUS_FD | E1000_STATUS_SPEED_MASK))) { 1388 + if (duplex == HALF_DUPLEX && speed == SPEED_10) { 1410 1389 tipg_reg |= 0xFF; 1411 1390 /* Reduce Rx latency in analog PHY */ 1412 1391 emi_val = 0; 1392 + } else if (hw->mac.type == e1000_pch_spt && 1393 + duplex == FULL_DUPLEX && speed != SPEED_1000) { 1394 + tipg_reg |= 0xC; 1395 + emi_val = 1; 1413 1396 } else { 1414 1397 1415 1398 /* Roll back the default values */ ··· 1437 1412 1438 1413 if (ret_val) 1439 1414 return ret_val; 1415 + 1416 + if (hw->mac.type == e1000_pch_spt) { 1417 + u16 data; 1418 + u16 ptr_gap; 1419 + 1420 + if (speed == SPEED_1000) { 1421 + ret_val = hw->phy.ops.acquire(hw); 1422 + if (ret_val) 1423 + return ret_val; 1424 + 1425 + ret_val = e1e_rphy_locked(hw, 1426 + PHY_REG(776, 20), 1427 + &data); 1428 + if (ret_val) { 1429 + hw->phy.ops.release(hw); 1430 + return ret_val; 1431 + } 1432 + 1433 + ptr_gap = (data & (0x3FF << 2)) >> 2; 1434 + if (ptr_gap < 0x18) { 1435 + data &= ~(0x3FF << 2); 1436 + data |= (0x18 << 2); 1437 + ret_val = 1438 + e1e_wphy_locked(hw, 1439 + PHY_REG(776, 20), 1440 + data); 1441 + } 1442 + hw->phy.ops.release(hw); 1443 + if (ret_val) 1444 + return ret_val; 1445 + } 1446 + } 1447 + } 1448 + 1449 + /* I217 Packet Loss issue: 1450 + * ensure that FEXTNVM4 Beacon Duration is set correctly 1451 + * on power up. 1452 + * Set the Beacon Duration for I217 to 8 usec 1453 + */ 1454 + if ((hw->mac.type == e1000_pch_lpt) || (hw->mac.type == e1000_pch_spt)) { 1455 + u32 mac_reg; 1456 + 1457 + mac_reg = er32(FEXTNVM4); 1458 + mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK; 1459 + mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC; 1460 + ew32(FEXTNVM4, mac_reg); 1440 1461 } 1441 1462 1442 1463 /* Work-around I218 hang issue */ 1443 1464 if ((hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_LM) || 1444 1465 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_V) || 1445 1466 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_LM3) || 1446 - (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V3) || 1447 - (hw->mac.type == e1000_pch_spt)) { 1467 + (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V3)) { 1448 1468 ret_val = e1000_k1_workaround_lpt_lp(hw, link); 1449 1469 if (ret_val) 1450 1470 return ret_val;
+34 -4
drivers/net/ethernet/intel/e1000e/netdev.c
··· 6354 6354 } 6355 6355 6356 6356 /** 6357 - * e1000e_disable_aspm - Disable ASPM states 6357 + * __e1000e_disable_aspm - Disable ASPM states 6358 6358 * @pdev: pointer to PCI device struct 6359 6359 * @state: bit-mask of ASPM states to disable 6360 + * @locked: indication if this context holds pci_bus_sem locked. 6360 6361 * 6361 6362 * Some devices *must* have certain ASPM states disabled per hardware errata. 6362 6363 **/ 6363 - static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state) 6364 + static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state, int locked) 6364 6365 { 6365 6366 struct pci_dev *parent = pdev->bus->self; 6366 6367 u16 aspm_dis_mask = 0; ··· 6400 6399 "L1" : ""); 6401 6400 6402 6401 #ifdef CONFIG_PCIEASPM 6403 - pci_disable_link_state_locked(pdev, state); 6402 + if (locked) 6403 + pci_disable_link_state_locked(pdev, state); 6404 + else 6405 + pci_disable_link_state(pdev, state); 6404 6406 6405 6407 /* Double-check ASPM control. If not disabled by the above, the 6406 6408 * BIOS is preventing that from happening (or CONFIG_PCIEASPM is ··· 6426 6422 aspm_dis_mask); 6427 6423 } 6428 6424 6425 + /** 6426 + * e1000e_disable_aspm - Disable ASPM states. 6427 + * @pdev: pointer to PCI device struct 6428 + * @state: bit-mask of ASPM states to disable 6429 + * 6430 + * This function acquires the pci_bus_sem! 6431 + * Some devices *must* have certain ASPM states disabled per hardware errata. 6432 + **/ 6433 + static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state) 6434 + { 6435 + __e1000e_disable_aspm(pdev, state, 0); 6436 + } 6437 + 6438 + /** 6439 + * e1000e_disable_aspm_locked Disable ASPM states. 6440 + * @pdev: pointer to PCI device struct 6441 + * @state: bit-mask of ASPM states to disable 6442 + * 6443 + * This function must be called with pci_bus_sem acquired! 6444 + * Some devices *must* have certain ASPM states disabled per hardware errata. 6445 + **/ 6446 + static void e1000e_disable_aspm_locked(struct pci_dev *pdev, u16 state) 6447 + { 6448 + __e1000e_disable_aspm(pdev, state, 1); 6449 + } 6450 + 6429 6451 #ifdef CONFIG_PM 6430 6452 static int __e1000_resume(struct pci_dev *pdev) 6431 6453 { ··· 6465 6435 if (adapter->flags2 & FLAG2_DISABLE_ASPM_L1) 6466 6436 aspm_disable_flag |= PCIE_LINK_STATE_L1; 6467 6437 if (aspm_disable_flag) 6468 - e1000e_disable_aspm(pdev, aspm_disable_flag); 6438 + e1000e_disable_aspm_locked(pdev, aspm_disable_flag); 6469 6439 6470 6440 pci_set_master(pdev); 6471 6441
+4
drivers/net/ethernet/intel/i40evf/i40e_txrx.c
··· 484 484 if (!dev) 485 485 return -ENOMEM; 486 486 487 + /* warn if we are about to overwrite the pointer */ 488 + WARN_ON(tx_ring->tx_bi); 487 489 bi_size = sizeof(struct i40e_tx_buffer) * tx_ring->count; 488 490 tx_ring->tx_bi = kzalloc(bi_size, GFP_KERNEL); 489 491 if (!tx_ring->tx_bi) ··· 646 644 struct device *dev = rx_ring->dev; 647 645 int bi_size; 648 646 647 + /* warn if we are about to overwrite the pointer */ 648 + WARN_ON(rx_ring->rx_bi); 649 649 bi_size = sizeof(struct i40e_rx_buffer) * rx_ring->count; 650 650 rx_ring->rx_bi = kzalloc(bi_size, GFP_KERNEL); 651 651 if (!rx_ring->rx_bi)
-1
drivers/net/ethernet/intel/i40evf/i40evf.h
··· 264 264 265 265 int i40evf_up(struct i40evf_adapter *adapter); 266 266 void i40evf_down(struct i40evf_adapter *adapter); 267 - void i40evf_reinit_locked(struct i40evf_adapter *adapter); 268 267 void i40evf_reset(struct i40evf_adapter *adapter); 269 268 void i40evf_set_ethtool_ops(struct net_device *netdev); 270 269 void i40evf_update_stats(struct i40evf_adapter *adapter);
+4 -2
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
··· 267 267 adapter->tx_desc_count = new_tx_count; 268 268 adapter->rx_desc_count = new_rx_count; 269 269 270 - if (netif_running(netdev)) 271 - i40evf_reinit_locked(adapter); 270 + if (netif_running(netdev)) { 271 + adapter->flags |= I40EVF_FLAG_RESET_NEEDED; 272 + schedule_work(&adapter->reset_task); 273 + } 272 274 273 275 return 0; 274 276 }
+49 -65
drivers/net/ethernet/intel/i40evf/i40evf_main.c
··· 170 170 struct i40evf_adapter *adapter = netdev_priv(netdev); 171 171 172 172 adapter->tx_timeout_count++; 173 - if (!(adapter->flags & I40EVF_FLAG_RESET_PENDING)) { 173 + if (!(adapter->flags & (I40EVF_FLAG_RESET_PENDING | 174 + I40EVF_FLAG_RESET_NEEDED))) { 174 175 adapter->flags |= I40EVF_FLAG_RESET_NEEDED; 175 176 schedule_work(&adapter->reset_task); 176 177 } ··· 1461 1460 for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { 1462 1461 lut = 0; 1463 1462 for (j = 0; j < 4; j++) { 1464 - if (cqueue == adapter->vsi_res->num_queue_pairs) 1463 + if (cqueue == adapter->num_active_queues) 1465 1464 cqueue = 0; 1466 1465 lut |= ((cqueue) << (8 * j)); 1467 1466 cqueue++; ··· 1471 1470 i40e_flush(hw); 1472 1471 } 1473 1472 1474 - #define I40EVF_RESET_WAIT_MS 100 1475 - #define I40EVF_RESET_WAIT_COUNT 200 1473 + #define I40EVF_RESET_WAIT_MS 10 1474 + #define I40EVF_RESET_WAIT_COUNT 500 1476 1475 /** 1477 1476 * i40evf_reset_task - Call-back task to handle hardware reset 1478 1477 * @work: pointer to work_struct ··· 1496 1495 &adapter->crit_section)) 1497 1496 usleep_range(500, 1000); 1498 1497 1498 + i40evf_misc_irq_disable(adapter); 1499 1499 if (adapter->flags & I40EVF_FLAG_RESET_NEEDED) { 1500 - dev_info(&adapter->pdev->dev, "Requesting reset from PF\n"); 1500 + adapter->flags &= ~I40EVF_FLAG_RESET_NEEDED; 1501 + /* Restart the AQ here. If we have been reset but didn't 1502 + * detect it, or if the PF had to reinit, our AQ will be hosed. 1503 + */ 1504 + i40evf_shutdown_adminq(hw); 1505 + i40evf_init_adminq(hw); 1501 1506 i40evf_request_reset(adapter); 1502 1507 } 1508 + adapter->flags |= I40EVF_FLAG_RESET_PENDING; 1503 1509 1504 1510 /* poll until we see the reset actually happen */ 1505 1511 for (i = 0; i < I40EVF_RESET_WAIT_COUNT; i++) { ··· 1515 1507 if ((rstat_val != I40E_VFR_VFACTIVE) && 1516 1508 (rstat_val != I40E_VFR_COMPLETED)) 1517 1509 break; 1518 - msleep(I40EVF_RESET_WAIT_MS); 1510 + usleep_range(500, 1000); 1519 1511 } 1520 1512 if (i == I40EVF_RESET_WAIT_COUNT) { 1521 - adapter->flags &= ~I40EVF_FLAG_RESET_PENDING; 1513 + dev_info(&adapter->pdev->dev, "Never saw reset\n"); 1522 1514 goto continue_reset; /* act like the reset happened */ 1523 1515 } 1524 1516 ··· 1526 1518 for (i = 0; i < I40EVF_RESET_WAIT_COUNT; i++) { 1527 1519 rstat_val = rd32(hw, I40E_VFGEN_RSTAT) & 1528 1520 I40E_VFGEN_RSTAT_VFR_STATE_MASK; 1529 - if ((rstat_val == I40E_VFR_VFACTIVE) || 1530 - (rstat_val == I40E_VFR_COMPLETED)) 1521 + if (rstat_val == I40E_VFR_VFACTIVE) 1531 1522 break; 1532 1523 msleep(I40EVF_RESET_WAIT_MS); 1533 1524 } 1525 + /* extra wait to make sure minimum wait is met */ 1526 + msleep(I40EVF_RESET_WAIT_MS); 1534 1527 if (i == I40EVF_RESET_WAIT_COUNT) { 1535 1528 struct i40evf_mac_filter *f, *ftmp; 1536 1529 struct i40evf_vlan_filter *fv, *fvtmp; ··· 1543 1534 1544 1535 if (netif_running(adapter->netdev)) { 1545 1536 set_bit(__I40E_DOWN, &adapter->vsi.state); 1546 - i40evf_irq_disable(adapter); 1547 - i40evf_napi_disable_all(adapter); 1548 - netif_tx_disable(netdev); 1549 - netif_tx_stop_all_queues(netdev); 1550 1537 netif_carrier_off(netdev); 1538 + netif_tx_disable(netdev); 1539 + i40evf_napi_disable_all(adapter); 1540 + i40evf_irq_disable(adapter); 1551 1541 i40evf_free_traffic_irqs(adapter); 1552 1542 i40evf_free_all_tx_resources(adapter); 1553 1543 i40evf_free_all_rx_resources(adapter); ··· 1558 1550 list_del(&f->list); 1559 1551 kfree(f); 1560 1552 } 1553 + 1561 1554 list_for_each_entry_safe(fv, fvtmp, &adapter->vlan_filter_list, 1562 1555 list) { 1563 1556 list_del(&fv->list); ··· 1573 1564 i40evf_shutdown_adminq(hw); 1574 1565 adapter->netdev->flags &= ~IFF_UP; 1575 1566 clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section); 1567 + adapter->flags &= ~I40EVF_FLAG_RESET_PENDING; 1568 + dev_info(&adapter->pdev->dev, "Reset task did not complete, VF disabled\n"); 1576 1569 return; /* Do not attempt to reinit. It's dead, Jim. */ 1577 1570 } 1578 1571 1579 1572 continue_reset: 1580 - adapter->flags &= ~I40EVF_FLAG_RESET_PENDING; 1581 - 1573 + if (netif_running(adapter->netdev)) { 1574 + netif_carrier_off(netdev); 1575 + netif_tx_stop_all_queues(netdev); 1576 + i40evf_napi_disable_all(adapter); 1577 + } 1582 1578 i40evf_irq_disable(adapter); 1583 1579 1584 - if (netif_running(adapter->netdev)) { 1585 - i40evf_napi_disable_all(adapter); 1586 - netif_tx_disable(netdev); 1587 - netif_tx_stop_all_queues(netdev); 1588 - netif_carrier_off(netdev); 1589 - } 1590 - 1591 1580 adapter->state = __I40EVF_RESETTING; 1581 + adapter->flags &= ~I40EVF_FLAG_RESET_PENDING; 1582 + 1583 + /* free the Tx/Rx rings and descriptors, might be better to just 1584 + * re-use them sometime in the future 1585 + */ 1586 + i40evf_free_all_rx_resources(adapter); 1587 + i40evf_free_all_tx_resources(adapter); 1592 1588 1593 1589 /* kill and reinit the admin queue */ 1594 1590 if (i40evf_shutdown_adminq(hw)) ··· 1617 1603 adapter->aq_required = I40EVF_FLAG_AQ_ADD_MAC_FILTER; 1618 1604 adapter->aq_required |= I40EVF_FLAG_AQ_ADD_VLAN_FILTER; 1619 1605 clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section); 1606 + i40evf_misc_irq_enable(adapter); 1620 1607 1621 1608 mod_timer(&adapter->watchdog_timer, jiffies + 2); 1622 1609 ··· 1639 1624 goto reset_err; 1640 1625 1641 1626 i40evf_irq_enable(adapter, true); 1627 + } else { 1628 + adapter->state = __I40EVF_DOWN; 1642 1629 } 1630 + 1643 1631 return; 1644 1632 reset_err: 1645 1633 dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n"); ··· 1685 1667 memset(event.msg_buf, 0, I40EVF_MAX_AQ_BUF_SIZE); 1686 1668 } while (pending); 1687 1669 1670 + if ((adapter->flags & 1671 + (I40EVF_FLAG_RESET_PENDING | I40EVF_FLAG_RESET_NEEDED)) || 1672 + adapter->state == __I40EVF_RESETTING) 1673 + goto freedom; 1674 + 1688 1675 /* check for error indications */ 1689 1676 val = rd32(hw, hw->aq.arq.len); 1690 1677 oldval = val; ··· 1725 1702 if (oldval != val) 1726 1703 wr32(hw, hw->aq.asq.len, val); 1727 1704 1705 + freedom: 1728 1706 kfree(event.msg_buf); 1729 1707 out: 1730 1708 /* re-enable Admin queue interrupt cause */ ··· 1921 1897 } 1922 1898 1923 1899 /** 1924 - * i40evf_reinit_locked - Software reinit 1925 - * @adapter: board private structure 1926 - * 1927 - * Reinititalizes the ring structures in response to a software configuration 1928 - * change. Roughly the same as close followed by open, but skips releasing 1929 - * and reallocating the interrupts. 1930 - **/ 1931 - void i40evf_reinit_locked(struct i40evf_adapter *adapter) 1932 - { 1933 - struct net_device *netdev = adapter->netdev; 1934 - int err; 1935 - 1936 - WARN_ON(in_interrupt()); 1937 - 1938 - i40evf_down(adapter); 1939 - 1940 - /* allocate transmit descriptors */ 1941 - err = i40evf_setup_all_tx_resources(adapter); 1942 - if (err) 1943 - goto err_reinit; 1944 - 1945 - /* allocate receive descriptors */ 1946 - err = i40evf_setup_all_rx_resources(adapter); 1947 - if (err) 1948 - goto err_reinit; 1949 - 1950 - i40evf_configure(adapter); 1951 - 1952 - err = i40evf_up_complete(adapter); 1953 - if (err) 1954 - goto err_reinit; 1955 - 1956 - i40evf_irq_enable(adapter, true); 1957 - return; 1958 - 1959 - err_reinit: 1960 - dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n"); 1961 - i40evf_close(netdev); 1962 - } 1963 - 1964 - /** 1965 1900 * i40evf_change_mtu - Change the Maximum Transfer Unit 1966 1901 * @netdev: network interface device structure 1967 1902 * @new_mtu: new value for maximum frame size ··· 1935 1952 if ((new_mtu < 68) || (max_frame > I40E_MAX_RXBUFFER)) 1936 1953 return -EINVAL; 1937 1954 1938 - /* must set new MTU before calling down or up */ 1939 1955 netdev->mtu = new_mtu; 1940 - i40evf_reinit_locked(adapter); 1956 + adapter->flags |= I40EVF_FLAG_RESET_NEEDED; 1957 + schedule_work(&adapter->reset_task); 1958 + 1941 1959 return 0; 1942 1960 } 1943 1961
+8 -4
drivers/net/ethernet/intel/igb/e1000_82575.c
··· 1 1 /* Intel(R) Gigabit Ethernet Linux driver 2 - * Copyright(c) 2007-2014 Intel Corporation. 2 + * Copyright(c) 2007-2015 Intel Corporation. 3 3 * 4 4 * This program is free software; you can redistribute it and/or modify it 5 5 * under the terms and conditions of the GNU General Public License, ··· 1900 1900 * igb_rx_fifo_flush_82575 - Clean rx fifo after RX enable 1901 1901 * @hw: pointer to the HW structure 1902 1902 * 1903 - * After rx enable if managability is enabled then there is likely some 1904 - * bad data at the start of the fifo and possibly in the DMA fifo. This 1903 + * After rx enable if manageability is enabled then there is likely some 1904 + * bad data at the start of the fifo and possibly in the DMA fifo. This 1905 1905 * function clears the fifos and flushes any packets that came in as rx was 1906 1906 * being enabled. 1907 1907 **/ ··· 1909 1909 { 1910 1910 u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled; 1911 1911 int i, ms_wait; 1912 + 1913 + /* disable IPv6 options as per hardware errata */ 1914 + rfctl = rd32(E1000_RFCTL); 1915 + rfctl |= E1000_RFCTL_IPV6_EX_DIS; 1916 + wr32(E1000_RFCTL, rfctl); 1912 1917 1913 1918 if (hw->mac.type != e1000_82575 || 1914 1919 !(rd32(E1000_MANC) & E1000_MANC_RCV_TCO_EN)) ··· 1942 1937 * incoming packets are rejected. Set enable and wait 2ms so that 1943 1938 * any packet that was coming in as RCTL.EN was set is flushed 1944 1939 */ 1945 - rfctl = rd32(E1000_RFCTL); 1946 1940 wr32(E1000_RFCTL, rfctl & ~E1000_RFCTL_LEF); 1947 1941 1948 1942 rlpml = rd32(E1000_RLPML);
+2 -1
drivers/net/ethernet/intel/igb/e1000_defines.h
··· 344 344 #define E1000_RXCSUM_PCSD 0x00002000 /* packet checksum disabled */ 345 345 346 346 /* Header split receive */ 347 - #define E1000_RFCTL_LEF 0x00040000 347 + #define E1000_RFCTL_IPV6_EX_DIS 0x00010000 348 + #define E1000_RFCTL_LEF 0x00040000 348 349 349 350 /* Collision related configuration parameters */ 350 351 #define E1000_COLLISION_THRESHOLD 15
+1 -1
drivers/net/ethernet/intel/igb/igb_main.c
··· 58 58 59 59 #define MAJ 5 60 60 #define MIN 2 61 - #define BUILD 15 61 + #define BUILD 18 62 62 #define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ 63 63 __stringify(BUILD) "-k" 64 64 char igb_driver_name[] = "igb";