From 05448a3caead1837fa350ac8ff0e4a7a813321e8 Mon Sep 17 00:00:00 2001 From: Markus Gothe Date: Mon, 18 Sep 2023 16:13:40 +0200 Subject: [PATCH] qosmngr: Fix ingress rate limiting on Broadcom. The code for ingress rate limiting is not working on Broadcom. --- qosmngr/files/broadcom/lib/qos/qos.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/qosmngr/files/broadcom/lib/qos/qos.sh b/qosmngr/files/broadcom/lib/qos/qos.sh index 4465bbd7d..d159d6c3d 100755 --- a/qosmngr/files/broadcom/lib/qos/qos.sh +++ b/qosmngr/files/broadcom/lib/qos/qos.sh @@ -15,6 +15,25 @@ SP_Q_PRIO=7 cfg_name="" cfg_type="" +get_port_number() { + [ -z "$1" ] && return + local ports="0 1 2 3 4 5 6 7 8" + local units="0 1" + local port="$1" + local prt + local ifname + + for unit in $units; do + for prt in $ports; do + ifname="$(ethswctl getifname $unit $prt 2>/dev/null | awk '{print$NF}')" + if [ "$ifname" == "$port" ]; then + echo "$unit $prt" + return + fi + done + done +} + get_rate_per_queue() { echo "0" }