19 lines · bash
1# SPDX-License-Identifier: GPL-2.02source ../router_scale.sh3 4router_get_target()5{6 local should_fail=$17 local target8 9 target=$(devlink_resource_size_get kvd hash_single)10 11 if [[ $should_fail -eq 0 ]]; then12 target=$((target * 85 / 100))13 else14 target=$((target + 1))15 fi16 17 echo $target18}19