selftests: tc-testing: u32: Add tests covering sample option
authorPhil Sutter <phil@nwl.cc>
Mon, 8 Feb 2021 15:10:04 +0000 (16:10 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Feb 2021 23:18:57 +0000 (15:18 -0800)
commit373e13bc63639169708444c4918c65291ec8156f
tree9128125fcf246b4272359768795738e3f08bd977
parent1a9b86c9fd9536b5c0dfbf7b4acbb7f61c820b74
selftests: tc-testing: u32: Add tests covering sample option

Kernel's key folding basically consists of shifting away least
significant zero bits in mask and masking the resulting value with
(divisor - 1). Test for u32's 'sample' option to behave identical.

Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/tc-testing/tc-tests/filters/u32.json