qosmngr: qos init script is platform unaware

This commit is contained in:
Sukru Senli 2020-04-07 08:39:05 +02:00
parent bdb29afd54
commit 158f1d94a6
3 changed files with 28 additions and 32 deletions

View file

@ -1,5 +1,5 @@
#
# Copyright (C) 2013-2019 iopsys
# Copyright (C) 2020 IOPSYS
#
include $(TOPDIR)/rules.mk
@ -16,8 +16,10 @@ PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/qosmngr
CATEGORY:=Utilities
TITLE:=qos manager daemon
SECTION:=utils
CATEGORY:=Utilities
TITLE:=QoS Manager
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm)
endef
define Package/qosmngr/description

View file

@ -9,19 +9,13 @@ STOP=90
USE_PROCD=1
NAME=qosmngr
# This function checks the hardware and calls corresponding
# scripts as per the platform
configure_queue()
{
if [ "$(db get hw.board.tm)" == "1" ]; then
. /lib/qos/broadcom.sh
fi
}
. /lib/functions.sh
include /lib/qos
start_service() {
# Call functions to configure queues
# Call functions to configure QoS
if [ -f "/etc/config/qos" ]; then
configure_queue
configure_qos
fi
# procd_open_instance
@ -37,10 +31,8 @@ stop() {
}
reload_service() {
# Call functions to configure queues
if [ -f "/etc/config/qos" ]; then
configure_queue
fi
# Call functions to configure QoS
start
# reload the daemon responsible for reading qos stats
# ubus -t 5 call qos reload

View file

@ -79,21 +79,23 @@ handle_shaper() {
tmctl setportshaper --devtype 0 --if $ifname --shapingrate $rate --burstsize $bs
}
for intf in $(db get hw.board.ethernetPortOrder); do
i=0
for i in 0 1 2 3 4 5 6 7; do
tmctl delqcfg --devtype 0 --if $intf --qid $i
done
done
configure_qos() {
# Delete queues
for intf in $(db get hw.board.ethernetPortOrder); do
i=0
for i in 0 1 2 3 4 5 6 7; do
tmctl delqcfg --devtype 0 --if $intf --qid $i
done
done
#load UCI file
config_load qos
# Load UCI file
config_load qos
#Processing shaper section(s)
config_foreach handle_shaper shaper
#Processing queue section(s)
for cmd in q pbit; do
config_foreach handle_queue queue $cmd
done
# Processing shaper section(s)
config_foreach handle_shaper shaper
# Processing queue section(s)
for cmd in q pbit; do
config_foreach handle_queue queue $cmd
done
}