]> git.droids-corp.org - dpdk.git/commit
app/testpmd: add host shaper command
authorSpike Du <spiked@nvidia.com>
Thu, 16 Jun 2022 08:41:54 +0000 (11:41 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Thu, 23 Jun 2022 15:25:04 +0000 (17:25 +0200)
commitf41a5092e6ae655954bf14f33f54ddf4c83e1cc0
treeceb21e8447a84aeb6d9d1cd0f641a085e1354aa2
parent2235fcda125763fa1a5b3c341b2799de9e44d479
app/testpmd: add host shaper command

Add command line options to support host shaper configure.
- Command syntax:
  mlx5 set port <port_id> host_shaper avail_thresh_triggered <0|1> rate
<rate_num>

- Example commands:
To enable avail_thresh_triggered on port 1 and disable current host
shaper:
testpmd> mlx5 set port 1 host_shaper avail_thresh_triggered 1 rate 0

To disable avail_thresh_triggered and current host shaper on port 1:
testpmd> mlx5 set port 1 host_shaper avail_thresh_triggered 0 rate 0

The rate unit is 100Mbps.
To disable avail_thresh_triggered and configure a shaper of 5Gbps on
port 1:
testpmd> mlx5 set port 1 host_shaper avail_thresh_triggered 0 rate 50

Add sample code to handle rxq available descriptor threshold event, it
delays a while so that rxq empties, then disables host shaper and
rearms available descriptor threshold event.

Signed-off-by: Spike Du <spiked@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
app/test-pmd/testpmd.c
doc/guides/nics/mlx5.rst
drivers/net/mlx5/meson.build
drivers/net/mlx5/mlx5_testpmd.c [new file with mode: 0644]
drivers/net/mlx5/mlx5_testpmd.h [new file with mode: 0644]