[1/2] net/mlx5: add global hairpin out of buffer counter

Message ID 20240701181245.128810-2-shperetz@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series Added hairpin out of buffer counters |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Shani Peretz July 1, 2024, 6:12 p.m. UTC
Exposing ethtool dev_internal_queue_oob counter which counts
the number of hairpin dropped packets in xstats.

Signed-off-by: Shani Peretz <shperetz@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 doc/guides/rel_notes/release_24_07.rst  | 1 +
 drivers/net/mlx5/linux/mlx5_ethdev_os.c | 4 ++++
 2 files changed, 5 insertions(+)
  

Patch

diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst
index d4efb5be84..c3e4fa5038 100644
--- a/doc/guides/rel_notes/release_24_07.rst
+++ b/doc/guides/rel_notes/release_24_07.rst
@@ -98,6 +98,7 @@  New Features
   * Added match with external Tx queue.
   * Added match with E-Switch manager.
   * Added flow item and actions validation to async flow API.
+  * Added global out of buffer counter for hairpin queues.
 
 * **Updated TAP driver.**
 
diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index 70bba6c8e0..7995ac6bbc 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -1420,6 +1420,10 @@  static const struct mlx5_counter_ctrl mlx5_counters_init[] = {
 		.ctr_name = "out_of_buffer",
 		.dev = 1,
 	},
+	{
+		.dpdk_name = "dev_internal_queue_oob",
+		.ctr_name = "dev_internal_queue_oob",
+	},
 	{
 		.dpdk_name = "tx_phy_packets",
 		.ctr_name = "tx_packets_phy",