igb: fix last_rx_timestamp usage
[linux.git] / drivers / net / ethernet / intel / igb / igb_main.c
index 55fc5596e2d045042a3f33251440fdc137214d13..fb98d4602f9d4fd130b660de0265bee786fec7a6 100644 (file)
@@ -2652,7 +2652,7 @@ err_eeprom:
                iounmap(hw->flash_address);
 err_sw_init:
        igb_clear_interrupt_scheme(adapter);
-       iounmap(hw->hw_addr);
+       pci_iounmap(pdev, hw->hw_addr);
 err_ioremap:
        free_netdev(netdev);
 err_alloc_etherdev:
@@ -2819,7 +2819,7 @@ static void igb_remove(struct pci_dev *pdev)
        igb_disable_sriov(pdev);
 #endif
 
-       iounmap(hw->hw_addr);
+       pci_iounmap(pdev, hw->hw_addr);
        if (hw->flash_address)
                iounmap(hw->flash_address);
        pci_release_selected_regions(pdev,
@@ -4605,6 +4605,7 @@ static int igb_tso(struct igb_ring *tx_ring,
        struct sk_buff *skb = first->skb;
        u32 vlan_macip_lens, type_tucmd;
        u32 mss_l4len_idx, l4len;
+       int err;
 
        if (skb->ip_summed != CHECKSUM_PARTIAL)
                return 0;
@@ -4612,11 +4613,9 @@ static int igb_tso(struct igb_ring *tx_ring,
        if (!skb_is_gso(skb))
                return 0;
 
-       if (skb_header_cloned(skb)) {
-               int err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
-               if (err)
-                       return err;
-       }
+       err = skb_cow_head(skb, 0);
+       if (err < 0)
+               return err;
 
        /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */
        type_tucmd = E1000_ADVTXD_TUCMD_L4T_TCP;
@@ -6955,7 +6954,9 @@ static void igb_process_skb_fields(struct igb_ring *rx_ring,
 
        igb_rx_checksum(rx_ring, rx_desc, skb);
 
-       igb_ptp_rx_hwtstamp(rx_ring, rx_desc, skb);
+       if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TS) &&
+           !igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP))
+               igb_ptp_rx_rgtstamp(rx_ring->q_vector, skb);
 
        if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
            igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) {