diff options
-rw-r--r-- | sys/dev/ena/ena.c | 6 | ||||
-rw-r--r-- | sys/dev/ena/ena.h | 1 | ||||
-rw-r--r-- | sys/dev/ena/ena_sysctl.c | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 5c5da5cc864d..e6662125c157 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -1888,6 +1888,8 @@ ena_get_counter(if_t ifp, ift_counter cnt) return (counter_u64_fetch(stats->tx_bytes)); case IFCOUNTER_IQDROPS: return (counter_u64_fetch(stats->rx_drops)); + case IFCOUNTER_OQDROPS: + return (counter_u64_fetch(stats->tx_drops)); default: return (if_get_counter_default(ifp, cnt)); } @@ -2710,12 +2712,16 @@ static void ena_keep_alive_wd(void *adapter_data, struct ena_admin_aenq_keep_alive_desc *desc; sbintime_t stime; uint64_t rx_drops; + uint64_t tx_drops; desc = (struct ena_admin_aenq_keep_alive_desc *)aenq_e; rx_drops = ((uint64_t)desc->rx_drops_high << 32) | desc->rx_drops_low; + tx_drops = ((uint64_t)desc->tx_drops_high << 32) | desc->tx_drops_low; counter_u64_zero(adapter->hw_stats.rx_drops); counter_u64_add(adapter->hw_stats.rx_drops, rx_drops); + counter_u64_zero(adapter->hw_stats.tx_drops); + counter_u64_add(adapter->hw_stats.tx_drops, tx_drops); stime = getsbinuptime(); atomic_store_rel_64(&adapter->keep_alive_timestamp, stime); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 387f30971266..e3d45d3ae4f4 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -380,6 +380,7 @@ struct ena_hw_stats { counter_u64_t tx_bytes; counter_u64_t rx_drops; + counter_u64_t tx_drops; }; /* Board specific private data structure */ diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index bdf9158c6ff4..12d5c3fc118e 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -267,6 +267,8 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &hw_stats->tx_bytes, "Bytes transmitted"); SYSCTL_ADD_COUNTER_U64(ctx, hw_list, OID_AUTO, "rx_drops", CTLFLAG_RD, &hw_stats->rx_drops, "Receive packet drops"); + SYSCTL_ADD_COUNTER_U64(ctx, hw_list, OID_AUTO, "tx_drops", CTLFLAG_RD, + &hw_stats->tx_drops, "Transmit packet drops"); /* ENA Admin queue stats */ admin_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "admin_stats", |