ixgbe: add statistic indicating number of skipped Tx timestamps
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 3 May 2017 17:29:00 +0000 (10:29 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 13 Jun 2017 23:11:48 +0000 (16:11 -0700)
The ixgbe driver can only handle one Tx timestamp request at a time.
This means it is possible for an application timestamp request to be
ignored.

There is no easy way for an administrator to determine if this occurred.
Add a new statistic which tracks this, tx_hwtstamp_skipped.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe.h
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 7626376..eb36106 100644 (file)
@@ -733,6 +733,7 @@ struct ixgbe_adapter {
        struct timecounter hw_tc;
        u32 base_incval;
        u32 tx_hwtstamp_timeouts;
+       u32 tx_hwtstamp_skipped;
        u32 rx_hwtstamp_cleared;
        void (*ptp_setup_sdp)(struct ixgbe_adapter *);
 
index 9113e80..2890e92 100644 (file)
@@ -111,6 +111,9 @@ static const struct ixgbe_stats ixgbe_gstrings_stats[] = {
        {"os2bmc_tx_by_bmc", IXGBE_STAT(stats.b2ospc)},
        {"os2bmc_tx_by_host", IXGBE_STAT(stats.o2bspc)},
        {"os2bmc_rx_by_host", IXGBE_STAT(stats.b2ogprc)},
+       {"tx_hwtstamp_timeouts", IXGBE_STAT(tx_hwtstamp_timeouts)},
+       {"tx_hwtstamp_skipped", IXGBE_STAT(tx_hwtstamp_skipped)},
+       {"rx_hwtstamp_cleared", IXGBE_STAT(rx_hwtstamp_cleared)},
 #ifdef IXGBE_FCOE
        {"fcoe_bad_fccrc", IXGBE_STAT(stats.fccrc)},
        {"rx_fcoe_dropped", IXGBE_STAT(stats.fcoerpdc)},
index 5773df2..4ea1137 100644 (file)
@@ -8337,16 +8337,19 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
        protocol = vlan_get_protocol(skb);
 
        if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
-           adapter->ptp_clock &&
-           !test_and_set_bit_lock(__IXGBE_PTP_TX_IN_PROGRESS,
-                                  &adapter->state)) {
-               skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
-               tx_flags |= IXGBE_TX_FLAGS_TSTAMP;
-
-               /* schedule check for Tx timestamp */
-               adapter->ptp_tx_skb = skb_get(skb);
-               adapter->ptp_tx_start = jiffies;
-               schedule_work(&adapter->ptp_tx_work);
+           adapter->ptp_clock) {
+               if (!test_and_set_bit_lock(__IXGBE_PTP_TX_IN_PROGRESS,
+                                          &adapter->state)) {
+                       skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
+                       tx_flags |= IXGBE_TX_FLAGS_TSTAMP;
+
+                       /* schedule check for Tx timestamp */
+                       adapter->ptp_tx_skb = skb_get(skb);
+                       adapter->ptp_tx_start = jiffies;
+                       schedule_work(&adapter->ptp_tx_work);
+               } else {
+                       adapter->tx_hwtstamp_skipped++;
+               }
        }
 
        skb_tx_timestamp(skb);