1741a7661SPetr Machata# SPDX-License-Identifier: GPL-2.0 2741a7661SPetr Machatasource ../tc_flower_scale.sh 3741a7661SPetr Machata 4741a7661SPetr Machatatc_flower_get_target() 5741a7661SPetr Machata{ 6741a7661SPetr Machata local should_fail=$1; shift 7741a7661SPetr Machata 8741a7661SPetr Machata # 6144 (6x1024) is the theoretical maximum. 9741a7661SPetr Machata # One bank of 512 rules is taken by the 18-byte MC router rule. 10741a7661SPetr Machata # One rule is the ACL catch-all. 11741a7661SPetr Machata # 6144 - 512 - 1 = 5631 12741a7661SPetr Machata local target=5631 13741a7661SPetr Machata 14741a7661SPetr Machata if ((! should_fail)); then 15741a7661SPetr Machata echo $target 16741a7661SPetr Machata else 17741a7661SPetr Machata echo $((target + 1)) 18741a7661SPetr Machata fi 19741a7661SPetr Machata} 20