selftests: mlxsw: Add test cases for devlink-trap policers

Add test cases that verify that each registered packet trap policer:

* Honors that imposed limitations of rate and burst size
* Able to police trapped packets to the specified rate
* Able to police trapped packets to the specified burst size
* Able to be unbound from its trap group

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ido Schimmel
2020-03-30 22:38:32 +03:00
committed by David S. Miller
parent 39defcbba0
commit 9f3e63c5d6
2 changed files with 390 additions and 0 deletions

View File

@@ -457,6 +457,12 @@ devlink_trap_group_policer_get()
| jq '.[][][]["policer"]'
}
devlink_trap_policer_ids_get()
{
devlink -j -p trap policer show \
| jq '.[]["'$DEVLINK_DEV'"][]["policer"]'
}
devlink_port_by_netdev()
{
local if_name=$1