Skip to content

Commit

Permalink
issue: 4159519 Adding TX interrupt stats
Browse files Browse the repository at this point in the history
Adding statistics for TX interrupt request and receive.

Signed-off-by: Alexander Grissik <[email protected]>
  • Loading branch information
AlexanderGrissik committed Nov 13, 2024
1 parent aa93da0 commit 49be19a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/dev/hw_queue_tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2025,6 +2025,8 @@ bool hw_queue_tx::request_notification()
PRINT_DOCA_ERR(hwqtx_logerr, rc, "doca_pe_request_notification");
return false;
}

++m_hwq_tx_stats.n_tx_interrupt_requests;
}

m_notification_armed = true;
Expand All @@ -2038,6 +2040,8 @@ void hw_queue_tx::clear_notification()
doca_error_t rc = doca_pe_clear_notification(m_doca_pe.get(), m_notification_handle);
if (unlikely(DOCA_IS_ERROR(rc))) {
PRINT_DOCA_ERR(hwqtx_logerr, rc, "doca_pe_clear_notification");
} else {
++m_hwq_tx_stats.n_tx_interrupt_received;
}
} else {
hwqtx_logwarn("Clear notification attempt on unarmed PE. hw_queue_tx: %p", this);
Expand Down
2 changes: 2 additions & 0 deletions src/core/util/xlio_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ typedef struct {
uint64_t n_tx_byte_count;
uint64_t n_tx_tso_pkt_count;
uint64_t n_tx_tso_byte_count;
uint64_t n_tx_interrupt_requests;
uint64_t n_tx_interrupt_received;
} hw_queue_tx_stats_t;

typedef struct {
Expand Down
13 changes: 13 additions & 0 deletions src/stats/stats_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,12 @@ void update_delta_hwq_tx_stat(hw_queue_tx_stats_t *p_curr_hwq_tx_stats,
p_prev_hwq_tx_stats->n_tx_tso_byte_count =
(p_curr_hwq_tx_stats->n_tx_tso_byte_count - p_prev_hwq_tx_stats->n_tx_tso_byte_count) /
delay;
p_prev_hwq_tx_stats->n_tx_interrupt_received = (p_curr_hwq_tx_stats->n_tx_interrupt_received -
p_prev_hwq_tx_stats->n_tx_interrupt_received) /
delay;
p_prev_hwq_tx_stats->n_tx_interrupt_requests = (p_curr_hwq_tx_stats->n_tx_interrupt_requests -
p_prev_hwq_tx_stats->n_tx_interrupt_requests) /
delay;
}

void update_delta_hwq_rx_stat(hw_queue_rx_stats_t *p_curr_hwq_rx_stats,
Expand Down Expand Up @@ -519,6 +525,13 @@ void print_ring_stats(ring_instance_block_t *p_ring_inst_arr)
printf(FORMAT_STATS_32bit, "TX buff in use:", p_ring_stats->n_tx_num_bufs);
printf(FORMAT_STATS_32bit, "TX ZC buff in use:", p_ring_stats->n_zc_num_bufs);

if (p_hwq_tx_stats->n_tx_interrupt_requests ||
p_hwq_tx_stats->n_tx_interrupt_received) {
printf(FORMAT_RING_INTERRUPT,
"TX Interrupts:", p_hwq_tx_stats->n_tx_interrupt_requests,
p_hwq_tx_stats->n_tx_interrupt_received, post_fix);
}

if (p_ring_stats->n_tx_dev_mem_allocated) {
printf(FORMAT_STATS_32bit,
"TX Dev Mem Alloc:", p_ring_stats->n_tx_dev_mem_allocated);
Expand Down

0 comments on commit 49be19a

Please sign in to comment.