OSDN Git Service

selftests: mlxsw: Add tc sample tests
authorIdo Schimmel <idosch@nvidia.com>
Sun, 14 Mar 2021 12:19:40 +0000 (14:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 14 Mar 2021 22:00:44 +0000 (15:00 -0700)
commitbb24d592e66eb059e086595510e0f0b064e4114d
tree145db1bc35b99623997e7a7a861500b5c19a6c25
parent2073c600444349b18a80b0b38dc20df92fd74155
selftests: mlxsw: Add tc sample tests

Test that packets are sampled when tc-sample is used and that reported
metadata is correct. Two sets of hosts (with and without LAG) are used,
since metadata extraction in mlxsw is a bit different when LAG is
involved.

 # ./tc_sample.sh
 TEST: tc sample rate (forward)                                      [ OK ]
 TEST: tc sample rate (local receive)                                [ OK ]
 TEST: tc sample maximum rate                                        [ OK ]
 TEST: tc sample group conflict test                                 [ OK ]
 TEST: tc sample iif                                                 [ OK ]
 TEST: tc sample lag iif                                             [ OK ]
 TEST: tc sample oif                                                 [ OK ]
 TEST: tc sample lag oif                                             [ OK ]
 TEST: tc sample out-tc                                              [ OK ]
 TEST: tc sample out-tc-occ                                          [ OK ]

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/mlxsw/tc_sample.sh [new file with mode: 0755]