]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
igb: Add update to last_rx_timestamp in Rx rings
authorMatthew Vick <matthew.vick@intel.com>
Wed, 24 Apr 2013 07:42:06 +0000 (07:42 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 21 May 2013 09:31:43 +0000 (02:31 -0700)
In order to support a more accurate check for a PTP Rx hang where the
device can no longer timestamp received packets, we need to update, per
ring, when the last Rx timestamp was. Because of how the PTP Rx hang logic
works, the current logic is valid, but properly updating the ring variable
increases the accuracy of the check.

Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb.h
drivers/net/ethernet/intel/igb/igb_main.c

index 9d6c075e232d9c5c2885cebcfa58c297e03b049e..a90570755ddc65feb78d2ea90b0cfdcc285db4bf 100644 (file)
@@ -514,13 +514,18 @@ extern void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector,
 extern void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector,
                                unsigned char *va,
                                struct sk_buff *skb);
-static inline void igb_ptp_rx_hwtstamp(struct igb_q_vector *q_vector,
+static inline void igb_ptp_rx_hwtstamp(struct igb_ring *rx_ring,
                                       union e1000_adv_rx_desc *rx_desc,
                                       struct sk_buff *skb)
 {
        if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TS) &&
            !igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP))
-               igb_ptp_rx_rgtstamp(q_vector, skb);
+               igb_ptp_rx_rgtstamp(rx_ring->q_vector, skb);
+
+       /* Update the last_rx_timestamp timer in order to enable watchdog check
+        * for error case of latched timestamp on a dropped packet.
+        */
+       rx_ring->last_rx_timestamp = jiffies;
 }
 
 extern int igb_ptp_hwtstamp_ioctl(struct net_device *netdev,
index 64cbe0dfe04347aff1af3fd15f5eb130caefaff6..2c8f7e04b02bff6c2e49f48b7d2c7985e5a23329 100644 (file)
@@ -6622,7 +6622,7 @@ 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->q_vector, rx_desc, skb);
+       igb_ptp_rx_hwtstamp(rx_ring, rx_desc, skb);
 
        if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
            igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) {