aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ena
diff options
context:
space:
mode:
authorMarcin Wojtas <mw@FreeBSD.org>2020-05-26 15:31:28 +0000
committerMarcin Wojtas <mw@FreeBSD.org>2020-05-26 15:31:28 +0000
commit6c84cec3738e2979f3e402c69d9d3924305cee88 (patch)
tree4b3c6fecc2a6f26adf39cecf3da238b8ee39fd43 /sys/dev/ena
parent8483b844e7e48dbfc61c6e38908921c4fa691d4c (diff)
downloadsrc-6c84cec3738e2979f3e402c69d9d3924305cee88.tar.gz
src-6c84cec3738e2979f3e402c69d9d3924305cee88.zip
Enable Tx drops reporting in the ENA driver
Tx drops statistics are fetched from HW every ena_keepalive_wd() call and are observable using one of the commands: * sysctl dev.ena.0.hw_stats.tx_drops * netstat -I ena0 -d Submitted by: Maciej Bielski <mba@semihalf.com> Obtained from: Semihalf Sponsored by: Amazon, Inc.
Notes
Notes: svn path=/head/; revision=361512
Diffstat (limited to 'sys/dev/ena')
-rw-r--r--sys/dev/ena/ena.c6
-rw-r--r--sys/dev/ena/ena.h1
-rw-r--r--sys/dev/ena/ena_sysctl.c2
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",