diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index b8c9efb288e..b4b38051b03 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -439,6 +439,7 @@ ena_init_io_rings_advanced(struct ena_adapter *adapter) /* Allocate Tx statistics. */ ena_alloc_counters((counter_u64_t *)&txr->tx_stats, sizeof(txr->tx_stats)); + txr->tx_last_cleanup_ticks = ticks; /* Allocate Rx statistics. */ ena_alloc_counters((counter_u64_t *)&rxr->rx_stats, @@ -3007,6 +3008,8 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, device_t pdev = adapter->pdev; struct bintime curtime, time; struct ena_tx_buffer *tx_buf; + int time_since_last_cleanup; + int missing_tx_comp_to; sbintime_t time_offset; uint32_t missed_tx = 0; int i, rc = 0; @@ -3040,10 +3043,18 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, /* Check again if packet is still waiting */ if (unlikely(time_offset > adapter->missing_tx_timeout)) { - if (!tx_buf->print_once) + if (!tx_buf->print_once) { + time_since_last_cleanup = TICKS_2_USEC(ticks - + tx_ring->tx_last_cleanup_ticks); + missing_tx_comp_to = + sbttoms(adapter->missing_tx_timeout); ena_log(pdev, WARN, "Found a Tx that wasn't " - "completed on time, qid %d, index %d.\n", - tx_ring->qid, i); + "completed on time, qid %d, index %d." + "%d usecs have passed since last cleanup." + "Missing Tx timeout value %d msecs.\n", + tx_ring->qid, i, time_since_last_cleanup, + missing_tx_comp_to); + } tx_buf->print_once = true; missed_tx++; diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 85f353e7ab5..56e14bd800f 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -374,6 +374,8 @@ struct ena_ring { /* Used for LLQ */ uint8_t *push_buf_intermediate_buf; + int tx_last_cleanup_ticks; + #ifdef DEV_NETMAP bool initialized; #endif /* DEV_NETMAP */ diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 6c18a4f5c1f..85e9274eef1 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -344,6 +344,8 @@ ena_tx_cleanup(struct ena_ring *tx_ring) ENA_RING_MTX_UNLOCK(tx_ring); } + tx_ring->tx_last_cleanup_ticks = ticks; + return (work_done); }