Linux-libre 5.3.12-gnu
[librecmc/linux-libre.git] / tools / testing / selftests / drivers / net / mlxsw / spectrum / tc_flower_scale.sh
1 # SPDX-License-Identifier: GPL-2.0
2 source ../tc_flower_scale.sh
3
4 tc_flower_get_target()
5 {
6         local should_fail=$1; shift
7
8         # 6144 (6x1024) is the theoretical maximum.
9         # One bank of 512 rules is taken by the 18-byte MC router rule.
10         # One rule is the ACL catch-all.
11         # 6144 - 512 - 1 = 5631
12         local target=5631
13
14         if ((! should_fail)); then
15                 echo $target
16         else
17                 echo $((target + 1))
18         fi
19 }