aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-02-26 14:57:37 -0500
committerDavid S. Miller <davem@davemloft.net>2016-02-26 14:57:37 -0500
commite1bae75d85432704f9cfac3a156f79b0551946f4 (patch)
treef9b9e350e16375f1f8ebacffc9efdf066c4a71ac
parent224638766235ba82c53b4216e4dabc510701fbf2 (diff)
parent46eafa59e18d034ba616fdcca688c388d0bbfd91 (diff)
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 1GbE Intel Wired LAN Driver Updates 2016-02-24 This series contains updates to e1000e, igb and igbvf. Raanan provides updates for e1000e, first increases the ULP timer since it now takes longer for the ULP exit to complete on Skylake. Fixes the configuration of the internal hardware PHY clock gating mechanism, which was causing packet loss due to mis configuring. Fixed additional ULP configuration settings which were not being properly cleared after cable connect in V-Pro capable systems. Added support for more i219 devices. Takuma Ueba provides a fix for I210 where IPv6 autoconf test sometimes fails due to DAD NS for link-local is not transmitted. To avoid this issue, we need to wait until 1000BASE-T status register "Remote receiver status OK". Todd provides a patch to override EEPROM WoL settings for specific OEM devices. Then renamed igb defines to be more generic, since the define E1000_MRQC_ENABLE_RSS_4Q enables 4 and 8 queues depending on the part. Roland Hii fixes an issue where only the half cycle time of less than or equal to 70 millisecond uses the I210 clock output function. His patch adds additional conditions when half cycle time is equal to 125 or 250 or 500 millisecond to use the clock output function. Alex Duyck adds support for generic transmit checksums for igb and igbvf. Jon Maxwell fixes an issues where customer applications are registering and un-registering multicast addresses every few seconds which is leading to many "Link is up" messages in the logs as a result of the netif_carrier_off(netdev) in igbvf_msix_other(). So remove the link is up message when registering multicast addresses. Corinna Vinschen provides a fix for when switching off VLAN offloading on i350, the VLAN interface becomes unusable. Stefan Assmann updates the driver to use ndo_stop() instead of dev_close() when running ethtool offline self test. Since dev_close() causes IFF_UP to be cleared which will remove the interfaces routes and some addresses. v2: Dropped patches 6-10 in the original series. Patch 6-7 added support for character device for AVB and based on community feedback, we do not want to do this. Patches 8-10 provided fixes to the problematic code added in patches 6 & 7. So all of them must go! ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/intel/e1000e/hw.h4
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.c30
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.h7
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c4
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.c2
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.h4
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_hw.h2
-rw-r--r--drivers/net/ethernet/intel/igb/igb.h2
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ethtool.c4
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c199
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ptp.c3
-rw-r--r--drivers/net/ethernet/intel/igbvf/netdev.c143
-rw-r--r--drivers/net/ethernet/intel/igbvf/vf.h1
13 files changed, 261 insertions, 144 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index b3949d5bef5c..4e733bf1a38e 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -92,6 +92,10 @@ struct e1000_hw;
92#define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7 /* SPT-H PCH */ 92#define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7 /* SPT-H PCH */
93#define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8 /* SPT-H PCH */ 93#define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8 /* SPT-H PCH */
94#define E1000_DEV_ID_PCH_LBG_I219_LM3 0x15B9 /* LBG PCH */ 94#define E1000_DEV_ID_PCH_LBG_I219_LM3 0x15B9 /* LBG PCH */
95#define E1000_DEV_ID_PCH_SPT_I219_LM4 0x15D7
96#define E1000_DEV_ID_PCH_SPT_I219_V4 0x15D8
97#define E1000_DEV_ID_PCH_SPT_I219_LM5 0x15E3
98#define E1000_DEV_ID_PCH_SPT_I219_V5 0x15D6
95 99
96#define E1000_REVISION_4 4 100#define E1000_REVISION_4 4
97 101
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index a049e30639a1..c0f4887ea44d 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -1252,9 +1252,9 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
1252 ew32(H2ME, mac_reg); 1252 ew32(H2ME, mac_reg);
1253 } 1253 }
1254 1254
1255 /* Poll up to 100msec for ME to clear ULP_CFG_DONE */ 1255 /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */
1256 while (er32(FWSM) & E1000_FWSM_ULP_CFG_DONE) { 1256 while (er32(FWSM) & E1000_FWSM_ULP_CFG_DONE) {
1257 if (i++ == 10) { 1257 if (i++ == 30) {
1258 ret_val = -E1000_ERR_PHY; 1258 ret_val = -E1000_ERR_PHY;
1259 goto out; 1259 goto out;
1260 } 1260 }
@@ -1328,6 +1328,8 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
1328 I218_ULP_CONFIG1_RESET_TO_SMBUS | 1328 I218_ULP_CONFIG1_RESET_TO_SMBUS |
1329 I218_ULP_CONFIG1_WOL_HOST | 1329 I218_ULP_CONFIG1_WOL_HOST |
1330 I218_ULP_CONFIG1_INBAND_EXIT | 1330 I218_ULP_CONFIG1_INBAND_EXIT |
1331 I218_ULP_CONFIG1_EN_ULP_LANPHYPC |
1332 I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST |
1331 I218_ULP_CONFIG1_DISABLE_SMB_PERST); 1333 I218_ULP_CONFIG1_DISABLE_SMB_PERST);
1332 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); 1334 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
1333 1335
@@ -1433,6 +1435,18 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
1433 emi_addr = I217_RX_CONFIG; 1435 emi_addr = I217_RX_CONFIG;
1434 ret_val = e1000_write_emi_reg_locked(hw, emi_addr, emi_val); 1436 ret_val = e1000_write_emi_reg_locked(hw, emi_addr, emi_val);
1435 1437
1438 if (hw->mac.type == e1000_pch_lpt ||
1439 hw->mac.type == e1000_pch_spt) {
1440 u16 phy_reg;
1441
1442 e1e_rphy_locked(hw, I217_PLL_CLOCK_GATE_REG, &phy_reg);
1443 phy_reg &= ~I217_PLL_CLOCK_GATE_MASK;
1444 if (speed == SPEED_100 || speed == SPEED_10)
1445 phy_reg |= 0x3E8;
1446 else
1447 phy_reg |= 0xFA;
1448 e1e_wphy_locked(hw, I217_PLL_CLOCK_GATE_REG, phy_reg);
1449 }
1436 hw->phy.ops.release(hw); 1450 hw->phy.ops.release(hw);
1437 1451
1438 if (ret_val) 1452 if (ret_val)
@@ -1467,6 +1481,18 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
1467 hw->phy.ops.release(hw); 1481 hw->phy.ops.release(hw);
1468 if (ret_val) 1482 if (ret_val)
1469 return ret_val; 1483 return ret_val;
1484 } else {
1485 ret_val = hw->phy.ops.acquire(hw);
1486 if (ret_val)
1487 return ret_val;
1488
1489 ret_val = e1e_wphy_locked(hw,
1490 PHY_REG(776, 20),
1491 0xC023);
1492 hw->phy.ops.release(hw);
1493 if (ret_val)
1494 return ret_val;
1495
1470 } 1496 }
1471 } 1497 }
1472 } 1498 }
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h
index 34c551e322eb..2311f6003f58 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h
@@ -188,6 +188,10 @@
188#define I218_ULP_CONFIG1_INBAND_EXIT 0x0020 /* Inband on ULP exit */ 188#define I218_ULP_CONFIG1_INBAND_EXIT 0x0020 /* Inband on ULP exit */
189#define I218_ULP_CONFIG1_WOL_HOST 0x0040 /* WoL Host on ULP exit */ 189#define I218_ULP_CONFIG1_WOL_HOST 0x0040 /* WoL Host on ULP exit */
190#define I218_ULP_CONFIG1_RESET_TO_SMBUS 0x0100 /* Reset to SMBus mode */ 190#define I218_ULP_CONFIG1_RESET_TO_SMBUS 0x0100 /* Reset to SMBus mode */
191/* enable ULP even if when phy powered down via lanphypc */
192#define I218_ULP_CONFIG1_EN_ULP_LANPHYPC 0x0400
193/* disable clear of sticky ULP on PERST */
194#define I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST 0x0800
191#define I218_ULP_CONFIG1_DISABLE_SMB_PERST 0x1000 /* Disable on PERST# */ 195#define I218_ULP_CONFIG1_DISABLE_SMB_PERST 0x1000 /* Disable on PERST# */
192 196
193/* SMBus Address Phy Register */ 197/* SMBus Address Phy Register */
@@ -226,6 +230,9 @@
226#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100 230#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100
227#define HV_PM_CTRL_K1_ENABLE 0x4000 231#define HV_PM_CTRL_K1_ENABLE 0x4000
228 232
233#define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28)
234#define I217_PLL_CLOCK_GATE_MASK 0x07FF
235
229#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */ 236#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */
230 237
231/* Inband Control */ 238/* Inband Control */
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index c71ba1bfc1ec..9b4ec13d9161 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -7452,6 +7452,10 @@ static const struct pci_device_id e1000_pci_tbl[] = {
7452 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM2), board_pch_spt }, 7452 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM2), board_pch_spt },
7453 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V2), board_pch_spt }, 7453 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V2), board_pch_spt },
7454 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LBG_I219_LM3), board_pch_spt }, 7454 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LBG_I219_LM3), board_pch_spt },
7455 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM4), board_pch_spt },
7456 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V4), board_pch_spt },
7457 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM5), board_pch_spt },
7458 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V5), board_pch_spt },
7455 7459
7456 { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */ 7460 { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */
7457}; 7461};
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 9a1a9c7b0748..a23aa6704394 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -2920,7 +2920,7 @@ static struct e1000_mac_operations e1000_mac_ops_82575 = {
2920#endif 2920#endif
2921}; 2921};
2922 2922
2923static struct e1000_phy_operations e1000_phy_ops_82575 = { 2923static const struct e1000_phy_operations e1000_phy_ops_82575 = {
2924 .acquire = igb_acquire_phy_82575, 2924 .acquire = igb_acquire_phy_82575,
2925 .get_cfg_done = igb_get_cfg_done_82575, 2925 .get_cfg_done = igb_get_cfg_done_82575,
2926 .release = igb_release_phy_82575, 2926 .release = igb_release_phy_82575,
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.h b/drivers/net/ethernet/intel/igb/e1000_82575.h
index 2154aea7aa7e..de8805a2a2fe 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.h
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.h
@@ -56,10 +56,10 @@ s32 igb_write_i2c_byte(struct e1000_hw *hw, u8 byte_offset, u8 dev_addr,
56#define E1000_SRRCTL_TIMESTAMP 0x40000000 56#define E1000_SRRCTL_TIMESTAMP 0x40000000
57 57
58 58
59#define E1000_MRQC_ENABLE_RSS_4Q 0x00000002 59#define E1000_MRQC_ENABLE_RSS_MQ 0x00000002
60#define E1000_MRQC_ENABLE_VMDQ 0x00000003 60#define E1000_MRQC_ENABLE_VMDQ 0x00000003
61#define E1000_MRQC_RSS_FIELD_IPV4_UDP 0x00400000 61#define E1000_MRQC_RSS_FIELD_IPV4_UDP 0x00400000
62#define E1000_MRQC_ENABLE_VMDQ_RSS_2Q 0x00000005 62#define E1000_MRQC_ENABLE_VMDQ_RSS_MQ 0x00000005
63#define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000 63#define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000
64#define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000 64#define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000
65 65
diff --git a/drivers/net/ethernet/intel/igb/e1000_hw.h b/drivers/net/ethernet/intel/igb/e1000_hw.h
index f0c416e21d2c..2fb2213cd562 100644
--- a/drivers/net/ethernet/intel/igb/e1000_hw.h
+++ b/drivers/net/ethernet/intel/igb/e1000_hw.h
@@ -372,7 +372,7 @@ struct e1000_thermal_sensor_data {
372struct e1000_info { 372struct e1000_info {
373 s32 (*get_invariants)(struct e1000_hw *); 373 s32 (*get_invariants)(struct e1000_hw *);
374 struct e1000_mac_operations *mac_ops; 374 struct e1000_mac_operations *mac_ops;
375 struct e1000_phy_operations *phy_ops; 375 const struct e1000_phy_operations *phy_ops;
376 struct e1000_nvm_operations *nvm_ops; 376 struct e1000_nvm_operations *nvm_ops;
377}; 377};
378 378
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index 707ae5c297ea..9413fa61392f 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -510,6 +510,8 @@ enum igb_boards {
510extern char igb_driver_name[]; 510extern char igb_driver_name[];
511extern char igb_driver_version[]; 511extern char igb_driver_version[];
512 512
513int igb_open(struct net_device *netdev);
514int igb_close(struct net_device *netdev);
513int igb_up(struct igb_adapter *); 515int igb_up(struct igb_adapter *);
514void igb_down(struct igb_adapter *); 516void igb_down(struct igb_adapter *);
515void igb_reinit_locked(struct igb_adapter *); 517void igb_reinit_locked(struct igb_adapter *);
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 1d329f1d047b..7982243d1f9b 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -2017,7 +2017,7 @@ static void igb_diag_test(struct net_device *netdev,
2017 2017
2018 if (if_running) 2018 if (if_running)
2019 /* indicate we're in test mode */ 2019 /* indicate we're in test mode */
2020 dev_close(netdev); 2020 igb_close(netdev);
2021 else 2021 else
2022 igb_reset(adapter); 2022 igb_reset(adapter);
2023 2023
@@ -2050,7 +2050,7 @@ static void igb_diag_test(struct net_device *netdev,
2050 2050
2051 clear_bit(__IGB_TESTING, &adapter->state); 2051 clear_bit(__IGB_TESTING, &adapter->state);
2052 if (if_running) 2052 if (if_running)
2053 dev_open(netdev); 2053 igb_open(netdev);
2054 } else { 2054 } else {
2055 dev_info(&adapter->pdev->dev, "online testing starting\n"); 2055 dev_info(&adapter->pdev->dev, "online testing starting\n");
2056 2056
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index af46fcf8a50e..834b1b6a9277 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -122,8 +122,8 @@ static void igb_setup_mrqc(struct igb_adapter *);
122static int igb_probe(struct pci_dev *, const struct pci_device_id *); 122static int igb_probe(struct pci_dev *, const struct pci_device_id *);
123static void igb_remove(struct pci_dev *pdev); 123static void igb_remove(struct pci_dev *pdev);
124static int igb_sw_init(struct igb_adapter *); 124static int igb_sw_init(struct igb_adapter *);
125static int igb_open(struct net_device *); 125int igb_open(struct net_device *);
126static int igb_close(struct net_device *); 126int igb_close(struct net_device *);
127static void igb_configure(struct igb_adapter *); 127static void igb_configure(struct igb_adapter *);
128static void igb_configure_tx(struct igb_adapter *); 128static void igb_configure_tx(struct igb_adapter *);
129static void igb_configure_rx(struct igb_adapter *); 129static void igb_configure_rx(struct igb_adapter *);
@@ -2372,27 +2372,35 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2372 * assignment. 2372 * assignment.
2373 */ 2373 */
2374 netdev->features |= NETIF_F_SG | 2374 netdev->features |= NETIF_F_SG |
2375 NETIF_F_IP_CSUM |
2376 NETIF_F_IPV6_CSUM |
2377 NETIF_F_TSO | 2375 NETIF_F_TSO |
2378 NETIF_F_TSO6 | 2376 NETIF_F_TSO6 |
2379 NETIF_F_RXHASH | 2377 NETIF_F_RXHASH |
2380 NETIF_F_RXCSUM | 2378 NETIF_F_RXCSUM |
2379 NETIF_F_HW_CSUM |
2381 NETIF_F_HW_VLAN_CTAG_RX | 2380 NETIF_F_HW_VLAN_CTAG_RX |
2382 NETIF_F_HW_VLAN_CTAG_TX; 2381 NETIF_F_HW_VLAN_CTAG_TX;
2383 2382
2383 if (hw->mac.type >= e1000_82576)
2384 netdev->features |= NETIF_F_SCTP_CRC;
2385
2384 /* copy netdev features into list of user selectable features */ 2386 /* copy netdev features into list of user selectable features */
2385 netdev->hw_features |= netdev->features; 2387 netdev->hw_features |= netdev->features;
2386 netdev->hw_features |= NETIF_F_RXALL; 2388 netdev->hw_features |= NETIF_F_RXALL;
2387 2389
2390 if (hw->mac.type >= e1000_i350)
2391 netdev->hw_features |= NETIF_F_NTUPLE;
2392
2388 /* set this bit last since it cannot be part of hw_features */ 2393 /* set this bit last since it cannot be part of hw_features */
2389 netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; 2394 netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
2390 2395
2391 netdev->vlan_features |= NETIF_F_TSO | 2396 netdev->vlan_features |= NETIF_F_SG |
2397 NETIF_F_TSO |
2392 NETIF_F_TSO6 | 2398 NETIF_F_TSO6 |
2393 NETIF_F_IP_CSUM | 2399 NETIF_F_HW_CSUM |
2394 NETIF_F_IPV6_CSUM | 2400 NETIF_F_SCTP_CRC;
2395 NETIF_F_SG; 2401
2402 netdev->mpls_features |= NETIF_F_HW_CSUM;
2403 netdev->hw_enc_features |= NETIF_F_HW_CSUM;
2396 2404
2397 netdev->priv_flags |= IFF_SUPP_NOFCS; 2405 netdev->priv_flags |= IFF_SUPP_NOFCS;
2398 2406
@@ -2401,11 +2409,6 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2401 netdev->vlan_features |= NETIF_F_HIGHDMA; 2409 netdev->vlan_features |= NETIF_F_HIGHDMA;
2402 } 2410 }
2403 2411
2404 if (hw->mac.type >= e1000_82576) {
2405 netdev->hw_features |= NETIF_F_SCTP_CRC;
2406 netdev->features |= NETIF_F_SCTP_CRC;
2407 }
2408
2409 netdev->priv_flags |= IFF_UNICAST_FLT; 2412 netdev->priv_flags |= IFF_UNICAST_FLT;
2410 2413
2411 adapter->en_mng_pt = igb_enable_mng_pass_thru(hw); 2414 adapter->en_mng_pt = igb_enable_mng_pass_thru(hw);
@@ -2538,6 +2541,26 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2538 adapter->wol = 0; 2541 adapter->wol = 0;
2539 } 2542 }
2540 2543
2544 /* Some vendors want the ability to Use the EEPROM setting as
2545 * enable/disable only, and not for capability
2546 */
2547 if (((hw->mac.type == e1000_i350) ||
2548 (hw->mac.type == e1000_i354)) &&
2549 (pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)) {
2550 adapter->flags |= IGB_FLAG_WOL_SUPPORTED;
2551 adapter->wol = 0;
2552 }
2553 if (hw->mac.type == e1000_i350) {
2554 if (((pdev->subsystem_device == 0x5001) ||
2555 (pdev->subsystem_device == 0x5002)) &&
2556 (hw->bus.func == 0)) {
2557 adapter->flags |= IGB_FLAG_WOL_SUPPORTED;
2558 adapter->wol = 0;
2559 }
2560 if (pdev->subsystem_device == 0x1F52)
2561 adapter->flags |= IGB_FLAG_WOL_SUPPORTED;
2562 }
2563
2541 device_set_wakeup_enable(&adapter->pdev->dev, 2564 device_set_wakeup_enable(&adapter->pdev->dev,
2542 adapter->flags & IGB_FLAG_WOL_SUPPORTED); 2565 adapter->flags & IGB_FLAG_WOL_SUPPORTED);
2543 2566
@@ -3149,7 +3172,7 @@ err_setup_tx:
3149 return err; 3172 return err;
3150} 3173}
3151 3174
3152static int igb_open(struct net_device *netdev) 3175int igb_open(struct net_device *netdev)
3153{ 3176{
3154 return __igb_open(netdev, false); 3177 return __igb_open(netdev, false);
3155} 3178}
@@ -3186,7 +3209,7 @@ static int __igb_close(struct net_device *netdev, bool suspending)
3186 return 0; 3209 return 0;
3187} 3210}
3188 3211
3189static int igb_close(struct net_device *netdev) 3212int igb_close(struct net_device *netdev)
3190{ 3213{
3191 return __igb_close(netdev, false); 3214 return __igb_close(netdev, false);
3192} 3215}
@@ -3477,12 +3500,12 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
3477 wr32(E1000_VT_CTL, vtctl); 3500 wr32(E1000_VT_CTL, vtctl);
3478 } 3501 }
3479 if (adapter->rss_queues > 1) 3502 if (adapter->rss_queues > 1)
3480 mrqc |= E1000_MRQC_ENABLE_VMDQ_RSS_2Q; 3503 mrqc |= E1000_MRQC_ENABLE_VMDQ_RSS_MQ;
3481 else 3504 else
3482 mrqc |= E1000_MRQC_ENABLE_VMDQ; 3505 mrqc |= E1000_MRQC_ENABLE_VMDQ;
3483 } else { 3506 } else {
3484 if (hw->mac.type != e1000_i211) 3507 if (hw->mac.type != e1000_i211)
3485 mrqc |= E1000_MRQC_ENABLE_RSS_4Q; 3508 mrqc |= E1000_MRQC_ENABLE_RSS_MQ;
3486 } 3509 }
3487 igb_vmm_control(adapter); 3510 igb_vmm_control(adapter);
3488 3511
@@ -3566,6 +3589,28 @@ static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
3566 return 0; 3589 return 0;
3567} 3590}
3568 3591
3592static inline void igb_set_vf_vlan_strip(struct igb_adapter *adapter,
3593 int vfn, bool enable)
3594{
3595 struct e1000_hw *hw = &adapter->hw;
3596 u32 val, reg;
3597
3598 if (hw->mac.type < e1000_82576)
3599 return;
3600
3601 if (hw->mac.type == e1000_i350)
3602 reg = E1000_DVMOLR(vfn);
3603 else
3604 reg = E1000_VMOLR(vfn);
3605
3606 val = rd32(reg);
3607 if (enable)
3608 val |= E1000_VMOLR_STRVLAN;
3609 else
3610 val &= ~(E1000_VMOLR_STRVLAN);
3611 wr32(reg, val);
3612}
3613
3569static inline void igb_set_vmolr(struct igb_adapter *adapter, 3614static inline void igb_set_vmolr(struct igb_adapter *adapter,
3570 int vfn, bool aupe) 3615 int vfn, bool aupe)
3571{ 3616{
@@ -3579,14 +3624,6 @@ static inline void igb_set_vmolr(struct igb_adapter *adapter,
3579 return; 3624 return;
3580 3625
3581 vmolr = rd32(E1000_VMOLR(vfn)); 3626 vmolr = rd32(E1000_VMOLR(vfn));
3582 vmolr |= E1000_VMOLR_STRVLAN; /* Strip vlan tags */
3583 if (hw->mac.type == e1000_i350) {
3584 u32 dvmolr;
3585
3586 dvmolr = rd32(E1000_DVMOLR(vfn));
3587 dvmolr |= E1000_DVMOLR_STRVLAN;
3588 wr32(E1000_DVMOLR(vfn), dvmolr);
3589 }
3590 if (aupe) 3627 if (aupe)
3591 vmolr |= E1000_VMOLR_AUPE; /* Accept untagged packets */ 3628 vmolr |= E1000_VMOLR_AUPE; /* Accept untagged packets */
3592 else 3629 else
@@ -4357,6 +4394,7 @@ static void igb_watchdog_task(struct work_struct *work)
4357 u32 link; 4394 u32 link;
4358 int i; 4395 int i;
4359 u32 connsw; 4396 u32 connsw;
4397 u16 phy_data, retry_count = 20;
4360 4398
4361 link = igb_has_link(adapter); 4399 link = igb_has_link(adapter);
4362 4400
@@ -4435,6 +4473,25 @@ static void igb_watchdog_task(struct work_struct *work)
4435 break; 4473 break;
4436 } 4474 }
4437 4475
4476 if (adapter->link_speed != SPEED_1000)
4477 goto no_wait;
4478
4479 /* wait for Remote receiver status OK */
4480retry_read_status:
4481 if (!igb_read_phy_reg(hw, PHY_1000T_STATUS,
4482 &phy_data)) {
4483 if (!(phy_data & SR_1000T_REMOTE_RX_STATUS) &&
4484 retry_count) {
4485 msleep(100);
4486 retry_count--;
4487 goto retry_read_status;
4488 } else if (!retry_count) {
4489 dev_err(&adapter->pdev->dev, "exceed max 2 second\n");
4490 }
4491 } else {
4492 dev_err(&adapter->pdev->dev, "read 1000Base-T Status Reg\n");
4493 }
4494no_wait:
4438 netif_carrier_on(netdev); 4495 netif_carrier_on(netdev);
4439 4496
4440 igb_ping_all_vfs(adapter); 4497 igb_ping_all_vfs(adapter);
@@ -4843,70 +4900,57 @@ static int igb_tso(struct igb_ring *tx_ring,
4843 return 1; 4900 return 1;
4844} 4901}
4845 4902
4903static inline bool igb_ipv6_csum_is_sctp(struct sk_buff *skb)
4904{
4905 unsigned int offset = 0;
4906
4907 ipv6_find_hdr(skb, &offset, IPPROTO_SCTP, NULL, NULL);
4908
4909 return offset == skb_checksum_start_offset(skb);
4910}
4911
4846static void igb_tx_csum(struct igb_ring *tx_ring, struct igb_tx_buffer *first) 4912static void igb_tx_csum(struct igb_ring *tx_ring, struct igb_tx_buffer *first)
4847{ 4913{
4848 struct sk_buff *skb = first->skb; 4914 struct sk_buff *skb = first->skb;
4849 u32 vlan_macip_lens = 0; 4915 u32 vlan_macip_lens = 0;
4850 u32 mss_l4len_idx = 0;
4851 u32 type_tucmd = 0; 4916 u32 type_tucmd = 0;
4852 4917
4853 if (skb->ip_summed != CHECKSUM_PARTIAL) { 4918 if (skb->ip_summed != CHECKSUM_PARTIAL) {
4919csum_failed:
4854 if (!(first->tx_flags & IGB_TX_FLAGS_VLAN)) 4920 if (!(first->tx_flags & IGB_TX_FLAGS_VLAN))
4855 return; 4921 return;
4856 } else { 4922 goto no_csum;
4857 u8 l4_hdr = 0; 4923 }
4858
4859 switch (first->protocol) {
4860 case htons(ETH_P_IP):
4861 vlan_macip_lens |= skb_network_header_len(skb);
4862 type_tucmd |= E1000_ADVTXD_TUCMD_IPV4;
4863 l4_hdr = ip_hdr(skb)->protocol;
4864 break;
4865 case htons(ETH_P_IPV6):
4866 vlan_macip_lens |= skb_network_header_len(skb);
4867 l4_hdr = ipv6_hdr(skb)->nexthdr;
4868 break;
4869 default:
4870 if (unlikely(net_ratelimit())) {
4871 dev_warn(tx_ring->dev,
4872 "partial checksum but proto=%x!\n",
4873 first->protocol);
4874 }
4875 break;
4876 }
4877 4924
4878 switch (l4_hdr) { 4925 switch (skb->csum_offset) {
4879 case IPPROTO_TCP: 4926 case offsetof(struct tcphdr, check):
4880 type_tucmd |= E1000_ADVTXD_TUCMD_L4T_TCP; 4927 type_tucmd = E1000_ADVTXD_TUCMD_L4T_TCP;
4881 mss_l4len_idx = tcp_hdrlen(skb) << 4928 /* fall through */
4882 E1000_ADVTXD_L4LEN_SHIFT; 4929 case offsetof(struct udphdr, check):
4883 break; 4930 break;
4884 case IPPROTO_SCTP: 4931 case offsetof(struct sctphdr, checksum):
4885 type_tucmd |= E1000_ADVTXD_TUCMD_L4T_SCTP; 4932 /* validate that this is actually an SCTP request */
4886 mss_l4len_idx = sizeof(struct sctphdr) << 4933 if (((first->protocol == htons(ETH_P_IP)) &&
4887 E1000_ADVTXD_L4LEN_SHIFT; 4934 (ip_hdr(skb)->protocol == IPPROTO_SCTP)) ||
4888 break; 4935 ((first->protocol == htons(ETH_P_IPV6)) &&
4889 case IPPROTO_UDP: 4936 igb_ipv6_csum_is_sctp(skb))) {
4890 mss_l4len_idx = sizeof(struct udphdr) << 4937 type_tucmd = E1000_ADVTXD_TUCMD_L4T_SCTP;
4891 E1000_ADVTXD_L4LEN_SHIFT;
4892 break;
4893 default:
4894 if (unlikely(net_ratelimit())) {
4895 dev_warn(tx_ring->dev,
4896 "partial checksum but l4 proto=%x!\n",
4897 l4_hdr);
4898 }
4899 break; 4938 break;
4900 } 4939 }
4901 4940 default:
4902 /* update TX checksum flag */ 4941 skb_checksum_help(skb);
4903 first->tx_flags |= IGB_TX_FLAGS_CSUM; 4942 goto csum_failed;
4904 } 4943 }
4905 4944
4945 /* update TX checksum flag */
4946 first->tx_flags |= IGB_TX_FLAGS_CSUM;
4947 vlan_macip_lens = skb_checksum_start_offset(skb) -
4948 skb_network_offset(skb);
4949no_csum:
4906 vlan_macip_lens |= skb_network_offset(skb) << E1000_ADVTXD_MACLEN_SHIFT; 4950 vlan_macip_lens |= skb_network_offset(skb) << E1000_ADVTXD_MACLEN_SHIFT;
4907 vlan_macip_lens |= first->tx_flags & IGB_TX_FLAGS_VLAN_MASK; 4951 vlan_macip_lens |= first->tx_flags & IGB_TX_FLAGS_VLAN_MASK;
4908 4952
4909 igb_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, mss_l4len_idx); 4953 igb_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, 0);
4910} 4954}
4911 4955
4912#define IGB_SET_FLAG(_input, _flag, _result) \ 4956#define IGB_SET_FLAG(_input, _flag, _result) \
@@ -6069,6 +6113,7 @@ static int igb_enable_port_vlan(struct igb_adapter *adapter, int vf,
6069 6113
6070 adapter->vf_data[vf].pf_vlan = vlan; 6114 adapter->vf_data[vf].pf_vlan = vlan;
6071 adapter->vf_data[vf].pf_qos = qos; 6115 adapter->vf_data[vf].pf_qos = qos;
6116 igb_set_vf_vlan_strip(adapter, vf, true);
6072 dev_info(&adapter->pdev->dev, 6117 dev_info(&adapter->pdev->dev,
6073 "Setting VLAN %d, QOS 0x%x on VF %d\n", vlan, qos, vf); 6118 "Setting VLAN %d, QOS 0x%x on VF %d\n", vlan, qos, vf);
6074 if (test_bit(__IGB_DOWN, &adapter->state)) { 6119 if (test_bit(__IGB_DOWN, &adapter->state)) {
@@ -6096,6 +6141,7 @@ static int igb_disable_port_vlan(struct igb_adapter *adapter, int vf)
6096 6141
6097 adapter->vf_data[vf].pf_vlan = 0; 6142 adapter->vf_data[vf].pf_vlan = 0;
6098 adapter->vf_data[vf].pf_qos = 0; 6143 adapter->vf_data[vf].pf_qos = 0;
6144 igb_set_vf_vlan_strip(adapter, vf, false);
6099 6145
6100 return 0; 6146 return 0;
6101} 6147}
@@ -6116,6 +6162,7 @@ static int igb_set_vf_vlan_msg(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
6116{ 6162{
6117 int add = (msgbuf[0] & E1000_VT_MSGINFO_MASK) >> E1000_VT_MSGINFO_SHIFT; 6163 int add = (msgbuf[0] & E1000_VT_MSGINFO_MASK) >> E1000_VT_MSGINFO_SHIFT;
6118 int vid = (msgbuf[1] & E1000_VLVF_VLANID_MASK); 6164 int vid = (msgbuf[1] & E1000_VLVF_VLANID_MASK);
6165 int ret;
6119 6166
6120 if (adapter->vf_data[vf].pf_vlan) 6167 if (adapter->vf_data[vf].pf_vlan)
6121 return -1; 6168 return -1;
@@ -6124,7 +6171,10 @@ static int igb_set_vf_vlan_msg(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
6124 if (!vid && !add) 6171 if (!vid && !add)
6125 return 0; 6172 return 0;
6126 6173
6127 return igb_set_vf_vlan(adapter, vid, !!add, vf); 6174 ret = igb_set_vf_vlan(adapter, vid, !!add, vf);
6175 if (!ret)
6176 igb_set_vf_vlan_strip(adapter, vf, !!vid);
6177 return ret;
6128} 6178}
6129 6179
6130static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf) 6180static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf)
@@ -6141,6 +6191,7 @@ static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf)
6141 igb_set_vmvir(adapter, vf_data->pf_vlan | 6191 igb_set_vmvir(adapter, vf_data->pf_vlan |
6142 (vf_data->pf_qos << VLAN_PRIO_SHIFT), vf); 6192 (vf_data->pf_qos << VLAN_PRIO_SHIFT), vf);
6143 igb_set_vmolr(adapter, vf, !vf_data->pf_vlan); 6193 igb_set_vmolr(adapter, vf, !vf_data->pf_vlan);
6194 igb_set_vf_vlan_strip(adapter, vf, !!(vf_data->pf_vlan));
6144 6195
6145 /* reset multicast table array for vf */ 6196 /* reset multicast table array for vf */
6146 adapter->vf_data[vf].num_vf_mc_hashes = 0; 6197 adapter->vf_data[vf].num_vf_mc_hashes = 0;
@@ -7293,6 +7344,8 @@ static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features)
7293 ctrl &= ~E1000_CTRL_VME; 7344 ctrl &= ~E1000_CTRL_VME;
7294 wr32(E1000_CTRL, ctrl); 7345 wr32(E1000_CTRL, ctrl);
7295 } 7346 }
7347
7348 igb_set_vf_vlan_strip(adapter, adapter->vfs_allocated_count, enable);
7296} 7349}
7297 7350
7298static int igb_vlan_rx_add_vid(struct net_device *netdev, 7351static int igb_vlan_rx_add_vid(struct net_device *netdev,
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index c44df87c38de..22a8a29895b4 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -525,7 +525,8 @@ static int igb_ptp_feature_enable_i210(struct ptp_clock_info *ptp,
525 ts.tv_nsec = rq->perout.period.nsec; 525 ts.tv_nsec = rq->perout.period.nsec;
526 ns = timespec64_to_ns(&ts); 526 ns = timespec64_to_ns(&ts);
527 ns = ns >> 1; 527 ns = ns >> 1;
528 if (on && ns <= 70000000LL) { 528 if (on && ((ns <= 70000000LL) || (ns == 125000000LL) ||
529 (ns == 250000000LL) || (ns == 500000000LL))) {
529 if (ns < 8LL) 530 if (ns < 8LL)
530 return -EINVAL; 531 return -EINVAL;
531 use_freq = 1; 532 use_freq = 1;
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 297af801f051..c12442252adb 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -43,6 +43,7 @@
43#include <linux/ethtool.h> 43#include <linux/ethtool.h>
44#include <linux/if_vlan.h> 44#include <linux/if_vlan.h>
45#include <linux/prefetch.h> 45#include <linux/prefetch.h>
46#include <linux/sctp.h>
46 47
47#include "igbvf.h" 48#include "igbvf.h"
48 49
@@ -876,7 +877,6 @@ static irqreturn_t igbvf_msix_other(int irq, void *data)
876 877
877 adapter->int_counter1++; 878 adapter->int_counter1++;
878 879
879 netif_carrier_off(netdev);
880 hw->mac.get_link_status = 1; 880 hw->mac.get_link_status = 1;
881 if (!test_bit(__IGBVF_DOWN, &adapter->state)) 881 if (!test_bit(__IGBVF_DOWN, &adapter->state))
882 mod_timer(&adapter->watchdog_timer, jiffies + 1); 882 mod_timer(&adapter->watchdog_timer, jiffies + 1);
@@ -1908,6 +1908,31 @@ static void igbvf_watchdog_task(struct work_struct *work)
1908#define IGBVF_TX_FLAGS_VLAN_MASK 0xffff0000 1908#define IGBVF_TX_FLAGS_VLAN_MASK 0xffff0000
1909#define IGBVF_TX_FLAGS_VLAN_SHIFT 16 1909#define IGBVF_TX_FLAGS_VLAN_SHIFT 16
1910 1910
1911static void igbvf_tx_ctxtdesc(struct igbvf_ring *tx_ring, u32 vlan_macip_lens,
1912 u32 type_tucmd, u32 mss_l4len_idx)
1913{
1914 struct e1000_adv_tx_context_desc *context_desc;
1915 struct igbvf_buffer *buffer_info;
1916 u16 i = tx_ring->next_to_use;
1917
1918 context_desc = IGBVF_TX_CTXTDESC_ADV(*tx_ring, i);
1919 buffer_info = &tx_ring->buffer_info[i];
1920
1921 i++;
1922 tx_ring->next_to_use = (i < tx_ring->count) ? i : 0;
1923
1924 /* set bits to identify this as an advanced context descriptor */
1925 type_tucmd |= E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT;
1926
1927 context_desc->vlan_macip_lens = cpu_to_le32(vlan_macip_lens);
1928 context_desc->seqnum_seed = 0;
1929 context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd);
1930 context_desc->mss_l4len_idx = cpu_to_le32(mss_l4len_idx);
1931
1932 buffer_info->time_stamp = jiffies;
1933 buffer_info->dma = 0;
1934}
1935
1911static int igbvf_tso(struct igbvf_adapter *adapter, 1936static int igbvf_tso(struct igbvf_adapter *adapter,
1912 struct igbvf_ring *tx_ring, 1937 struct igbvf_ring *tx_ring,
1913 struct sk_buff *skb, u32 tx_flags, u8 *hdr_len, 1938 struct sk_buff *skb, u32 tx_flags, u8 *hdr_len,
@@ -1987,65 +2012,56 @@ static int igbvf_tso(struct igbvf_adapter *adapter,
1987 return true; 2012 return true;
1988} 2013}
1989 2014
1990static inline bool igbvf_tx_csum(struct igbvf_adapter *adapter, 2015static inline bool igbvf_ipv6_csum_is_sctp(struct sk_buff *skb)
1991 struct igbvf_ring *tx_ring,
1992 struct sk_buff *skb, u32 tx_flags,
1993 __be16 protocol)
1994{ 2016{
1995 struct e1000_adv_tx_context_desc *context_desc; 2017 unsigned int offset = 0;
1996 unsigned int i;
1997 struct igbvf_buffer *buffer_info;
1998 u32 info = 0, tu_cmd = 0;
1999
2000 if ((skb->ip_summed == CHECKSUM_PARTIAL) ||
2001 (tx_flags & IGBVF_TX_FLAGS_VLAN)) {
2002 i = tx_ring->next_to_use;
2003 buffer_info = &tx_ring->buffer_info[i];
2004 context_desc = IGBVF_TX_CTXTDESC_ADV(*tx_ring, i);
2005 2018
2006 if (tx_flags & IGBVF_TX_FLAGS_VLAN) 2019 ipv6_find_hdr(skb, &offset, IPPROTO_SCTP, NULL, NULL);
2007 info |= (tx_flags & IGBVF_TX_FLAGS_VLAN_MASK);
2008 2020
2009 info |= (skb_network_offset(skb) << E1000_ADVTXD_MACLEN_SHIFT); 2021 return offset == skb_checksum_start_offset(skb);
2010 if (skb->ip_summed == CHECKSUM_PARTIAL) 2022}
2011 info |= (skb_transport_header(skb) -
2012 skb_network_header(skb));
2013 2023
2014 context_desc->vlan_macip_lens = cpu_to_le32(info); 2024static bool igbvf_tx_csum(struct igbvf_ring *tx_ring, struct sk_buff *skb,
2025 u32 tx_flags, __be16 protocol)
2026{
2027 u32 vlan_macip_lens = 0;
2028 u32 type_tucmd = 0;
2015 2029
2016 tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT); 2030 if (skb->ip_summed != CHECKSUM_PARTIAL) {
2031csum_failed:
2032 if (!(tx_flags & IGBVF_TX_FLAGS_VLAN))
2033 return false;
2034 goto no_csum;
2035 }
2017 2036
2018 if (skb->ip_summed == CHECKSUM_PARTIAL) { 2037 switch (skb->csum_offset) {
2019 switch (protocol) { 2038 case offsetof(struct tcphdr, check):
2020 case htons(ETH_P_IP): 2039 type_tucmd = E1000_ADVTXD_TUCMD_L4T_TCP;
2021 tu_cmd |= E1000_ADVTXD_TUCMD_IPV4; 2040 /* fall through */
2022 if (ip_hdr(skb)->protocol == IPPROTO_TCP) 2041 case offsetof(struct udphdr, check):
2023 tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; 2042 break;
2024 break; 2043 case offsetof(struct sctphdr, checksum):
2025 case htons(ETH_P_IPV6): 2044 /* validate that this is actually an SCTP request */
2026 if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) 2045 if (((protocol == htons(ETH_P_IP)) &&
2027 tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; 2046 (ip_hdr(skb)->protocol == IPPROTO_SCTP)) ||
2028 break; 2047 ((protocol == htons(ETH_P_IPV6)) &&
2029 default: 2048 igbvf_ipv6_csum_is_sctp(skb))) {
2030 break; 2049 type_tucmd = E1000_ADVTXD_TUCMD_L4T_SCTP;
2031 } 2050 break;
2032 } 2051 }
2033 2052 default:
2034 context_desc->type_tucmd_mlhl = cpu_to_le32(tu_cmd); 2053 skb_checksum_help(skb);
2035 context_desc->seqnum_seed = 0; 2054 goto csum_failed;
2036 context_desc->mss_l4len_idx = 0;
2037
2038 buffer_info->time_stamp = jiffies;
2039 buffer_info->dma = 0;
2040 i++;
2041 if (i == tx_ring->count)
2042 i = 0;
2043 tx_ring->next_to_use = i;
2044
2045 return true;
2046 } 2055 }
2047 2056
2048 return false; 2057 vlan_macip_lens = skb_checksum_start_offset(skb) -
2058 skb_network_offset(skb);
2059no_csum:
2060 vlan_macip_lens |= skb_network_offset(skb) << E1000_ADVTXD_MACLEN_SHIFT;
2061 vlan_macip_lens |= tx_flags & IGBVF_TX_FLAGS_VLAN_MASK;
2062
2063 igbvf_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, 0);
2064 return true;
2049} 2065}
2050 2066
2051static int igbvf_maybe_stop_tx(struct net_device *netdev, int size) 2067static int igbvf_maybe_stop_tx(struct net_device *netdev, int size)
@@ -2264,7 +2280,7 @@ static netdev_tx_t igbvf_xmit_frame_ring_adv(struct sk_buff *skb,
2264 2280
2265 if (tso) 2281 if (tso)
2266 tx_flags |= IGBVF_TX_FLAGS_TSO; 2282 tx_flags |= IGBVF_TX_FLAGS_TSO;
2267 else if (igbvf_tx_csum(adapter, tx_ring, skb, tx_flags, protocol) && 2283 else if (igbvf_tx_csum(tx_ring, skb, tx_flags, protocol) &&
2268 (skb->ip_summed == CHECKSUM_PARTIAL)) 2284 (skb->ip_summed == CHECKSUM_PARTIAL))
2269 tx_flags |= IGBVF_TX_FLAGS_CSUM; 2285 tx_flags |= IGBVF_TX_FLAGS_CSUM;
2270 2286
@@ -2717,11 +2733,11 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2717 adapter->bd_number = cards_found++; 2733 adapter->bd_number = cards_found++;
2718 2734
2719 netdev->hw_features = NETIF_F_SG | 2735 netdev->hw_features = NETIF_F_SG |
2720 NETIF_F_IP_CSUM | 2736 NETIF_F_TSO |
2721 NETIF_F_IPV6_CSUM | 2737 NETIF_F_TSO6 |
2722 NETIF_F_TSO | 2738 NETIF_F_RXCSUM |
2723 NETIF_F_TSO6 | 2739 NETIF_F_HW_CSUM |
2724 NETIF_F_RXCSUM; 2740 NETIF_F_SCTP_CRC;
2725 2741
2726 netdev->features = netdev->hw_features | 2742 netdev->features = netdev->hw_features |
2727 NETIF_F_HW_VLAN_CTAG_TX | 2743 NETIF_F_HW_VLAN_CTAG_TX |
@@ -2731,11 +2747,14 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2731 if (pci_using_dac) 2747 if (pci_using_dac)
2732 netdev->features |= NETIF_F_HIGHDMA; 2748 netdev->features |= NETIF_F_HIGHDMA;
2733 2749
2734 netdev->vlan_features |= NETIF_F_TSO; 2750 netdev->vlan_features |= NETIF_F_SG |
2735 netdev->vlan_features |= NETIF_F_TSO6; 2751 NETIF_F_TSO |
2736 netdev->vlan_features |= NETIF_F_IP_CSUM; 2752 NETIF_F_TSO6 |
2737 netdev->vlan_features |= NETIF_F_IPV6_CSUM; 2753 NETIF_F_HW_CSUM |
2738 netdev->vlan_features |= NETIF_F_SG; 2754 NETIF_F_SCTP_CRC;
2755
2756 netdev->mpls_features |= NETIF_F_HW_CSUM;
2757 netdev->hw_enc_features |= NETIF_F_HW_CSUM;
2739 2758
2740 /*reset the controller to put the device in a known good state */ 2759 /*reset the controller to put the device in a known good state */
2741 err = hw->mac.ops.reset_hw(hw); 2760 err = hw->mac.ops.reset_hw(hw);
diff --git a/drivers/net/ethernet/intel/igbvf/vf.h b/drivers/net/ethernet/intel/igbvf/vf.h
index 0f1eca639f68..f00a41d9a1ca 100644
--- a/drivers/net/ethernet/intel/igbvf/vf.h
+++ b/drivers/net/ethernet/intel/igbvf/vf.h
@@ -126,6 +126,7 @@ struct e1000_adv_tx_context_desc {
126#define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */ 126#define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */
127#define E1000_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */ 127#define E1000_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */
128#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */ 128#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */
129#define E1000_ADVTXD_TUCMD_L4T_SCTP 0x00001000 /* L4 packet TYPE of SCTP */
129#define E1000_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */ 130#define E1000_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */
130#define E1000_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */ 131#define E1000_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */
131 132