e1000e: add statistic indicating number of skipped Tx timestamps
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 3 May 2017 17:28:57 +0000 (10:28 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 6 Jun 2017 08:01:27 +0000 (01:01 -0700)
The e1000e 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: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/e1000e/e1000.h
drivers/net/ethernet/intel/e1000e/ethtool.c
drivers/net/ethernet/intel/e1000e/netdev.c

index c7c994eb410e6a00e91095e83c9762451d78430d..98e68888abb1d94a5f18616d1bed78fbe4e2742f 100644 (file)
@@ -268,6 +268,7 @@ struct e1000_adapter {
        u32 tx_fifo_size;
        u32 tx_dma_failed;
        u32 tx_hwtstamp_timeouts;
+       u32 tx_hwtstamp_skipped;
 
        /* Rx */
        bool (*clean_rx)(struct e1000_ring *ring, int *work_done,
index e23dbd9190d6b4ff47cd71bd30849676b2689acc..c658f6ebf7cb4d0a1d205782aac68f7088c0b5de 100644 (file)
@@ -105,6 +105,7 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
        E1000_STAT("uncorr_ecc_errors", uncorr_errors),
        E1000_STAT("corr_ecc_errors", corr_errors),
        E1000_STAT("tx_hwtstamp_timeouts", tx_hwtstamp_timeouts),
+       E1000_STAT("tx_hwtstamp_skipped", tx_hwtstamp_skipped),
 };
 
 #define E1000_GLOBAL_STATS_LEN ARRAY_SIZE(e1000_gstrings_stats)
index 96257349a1b87ecefa30645c18bfea1e336f46b5..fc1d92ca3ea257c27afed1fc2d32a45bf5485bc5 100644 (file)
@@ -5867,13 +5867,16 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
                             nr_frags);
        if (count) {
                if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
-                   (adapter->flags & FLAG_HAS_HW_TIMESTAMP) &&
-                   !adapter->tx_hwtstamp_skb) {
-                       skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
-                       tx_flags |= E1000_TX_FLAGS_HWTSTAMP;
-                       adapter->tx_hwtstamp_skb = skb_get(skb);
-                       adapter->tx_hwtstamp_start = jiffies;
-                       schedule_work(&adapter->tx_hwtstamp_work);
+                   (adapter->flags & FLAG_HAS_HW_TIMESTAMP)) {
+                       if (!adapter->tx_hwtstamp_skb) {
+                               skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
+                               tx_flags |= E1000_TX_FLAGS_HWTSTAMP;
+                               adapter->tx_hwtstamp_skb = skb_get(skb);
+                               adapter->tx_hwtstamp_start = jiffies;
+                               schedule_work(&adapter->tx_hwtstamp_work);
+                       } else {
+                               adapter->tx_hwtstamp_skipped++;
+                       }
                }
 
                skb_tx_timestamp(skb);