Skip to content

Commit 9d9291e

Browse files
linux/ena: Print last interrupt time on tx timeout
Adding the timestamp of the last interrupt to the TX timeout routine. This provides more information and may help identifying the reason of the timeout. Signed-off-by: Evgeny Ostrovsky <[email protected]>
1 parent cea2183 commit 9d9291e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

kernel/linux/ena/ena_netdev.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static void ena_tx_timeout(struct net_device *dev, unsigned int txqueue)
9898
enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_OS_NETDEV_WD;
9999
struct ena_adapter *adapter = netdev_priv(dev);
100100
unsigned int time_since_last_napi, threshold;
101+
unsigned long jiffies_since_last_intr;
101102
struct ena_ring *tx_ring;
102103
int napi_scheduled;
103104

@@ -112,12 +113,15 @@ static void ena_tx_timeout(struct net_device *dev, unsigned int txqueue)
112113
time_since_last_napi = jiffies_to_usecs(jiffies - tx_ring->tx_stats.last_napi_jiffies);
113114
napi_scheduled = !!(tx_ring->napi->state & NAPIF_STATE_SCHED);
114115

116+
jiffies_since_last_intr = jiffies - READ_ONCE(adapter->ena_napi[txqueue].last_intr_jiffies);
117+
115118
netdev_err(dev,
116-
"TX q %d is paused for too long (threshold %u). Time since last napi %u usec. napi scheduled: %d\n",
119+
"TX q %d is paused for too long (threshold %u). Time since last napi %u usec. napi scheduled: %d. msecs since last interrupt: %u\n",
117120
txqueue,
118121
threshold,
119122
time_since_last_napi,
120-
napi_scheduled);
123+
napi_scheduled,
124+
jiffies_to_msecs(jiffies_since_last_intr));
121125

122126
if (threshold < time_since_last_napi && napi_scheduled) {
123127
netdev_err(dev,

0 commit comments

Comments
 (0)