Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cff57141 authored by Jacob Keller's avatar Jacob Keller Committed by Jeff Kirsher
Browse files

e1000e: add statistic indicating number of skipped Tx timestamps



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: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 74344e32
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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,
+1 −0
Original line number Diff line number Diff line
@@ -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)
+10 −7
Original line number Diff line number Diff line
@@ -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) {
		    (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);