[v2,3/5] net/ena: report Rx overrun errors in xstats

Message ID 20231025133609.17931-4-shaibran@amazon.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series net/ena: v2.8.0 driver release |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Brandes, Shai Oct. 25, 2023, 1:36 p.m. UTC
From: Shai Brandes <shaibran@amazon.com>

RX overrun error occur when a packet arrives but there are
not enough free buffers in the RX ring to receive it.
The driver publishes the extended statistics with the RX
buffer overrun errors as reported by the device.

Signed-off-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
---
 doc/guides/rel_notes/release_23_11.rst | 1 +
 drivers/net/ena/ena_ethdev.c           | 4 ++++
 drivers/net/ena/ena_ethdev.h           | 1 +
 3 files changed, 6 insertions(+)
  

Patch

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index eefbcc08fe..f622d93384 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -148,6 +148,7 @@  New Features
 
   * Upgraded ENA HAL to latest version.
   * Added support for connection tracking allowance utilization metric.
+  * Added support for reporting rx overrun errors in xstats.
 
 * **Updated Solarflare net driver.**
 
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index daec7f7d16..b3ebda6049 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -90,6 +90,7 @@  static const struct ena_stats ena_stats_global_strings[] = {
 	ENA_STAT_GLOBAL_ENTRY(dev_start),
 	ENA_STAT_GLOBAL_ENTRY(dev_stop),
 	ENA_STAT_GLOBAL_ENTRY(tx_drops),
+	ENA_STAT_GLOBAL_ENTRY(rx_overruns),
 };
 
 /*
@@ -3894,15 +3895,18 @@  static void ena_keep_alive(void *adapter_data,
 	struct ena_admin_aenq_keep_alive_desc *desc;
 	uint64_t rx_drops;
 	uint64_t tx_drops;
+	uint64_t rx_overruns;
 
 	adapter->timestamp_wd = rte_get_timer_cycles();
 
 	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;
+	rx_overruns = ((uint64_t)desc->rx_overruns_high << 32) | desc->rx_overruns_low;
 
 	adapter->drv_stats->rx_drops = rx_drops;
 	adapter->dev_stats.tx_drops = tx_drops;
+	adapter->dev_stats.rx_overruns = rx_overruns;
 }
 
 /**
diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h
index 9268d44dde..3f29764ca6 100644
--- a/drivers/net/ena/ena_ethdev.h
+++ b/drivers/net/ena/ena_ethdev.h
@@ -219,6 +219,7 @@  struct ena_stats_dev {
 	 * As a workaround it is being published as an extended statistic.
 	 */
 	u64 tx_drops;
+	u64 rx_overruns;
 };
 
 struct ena_stats_metrics {