net/mlx5e: Add hairpin debugfs files
authorGal Pressman <gal@nvidia.com>
Wed, 16 Nov 2022 12:18:27 +0000 (14:18 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 11 Jan 2023 05:24:41 +0000 (21:24 -0800)
commit0e414518d6d881075f0c944b365078b8049fcc2f
treeeda3044a899585fc58f4d1f09e96913e240b4ce0
parent3a3da78dd258cc164ab41ec09cf2feacca423fb4
net/mlx5e: Add hairpin debugfs files

We refer to a TC NIC rule that involves forwarding as "hairpin".
Hairpin queues are mlx5 hardware specific implementation for hardware
forwarding of such packets.

For debug purposes, introduce debugfs files which:
* Expose the number of active hairpins
* Dump the hairpin table
* Allow control over the number and size of the hairpin queues instead
  of the hard-coded values.

This allows us to get visibility of the feature in order to improve it
for next generation hardware.

Add debugfs files:
  fs/tc/hairpin_num_active
  fs/tc/hairpin_num_queues
  fs/tc/hairpin_queue_size
  fs/tc/hairpin_table_dump

Note that the new values will only take effect on the next queues
creation, it does not affect existing queues.

Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c