Compare commits

...

1 Commits

Author SHA1 Message Date
Arun Muthusamy
e1317bfcdc Qos: Read number of queue on target from libqos 2023-01-13 10:55:07 +01:00
6 changed files with 107 additions and 24 deletions

View File

@@ -5,7 +5,7 @@
ethwan="$(db -q get hw.board.ethernetWanPort)"
populate_no_of_queue(){
queue_num=4
local queue_num=$(get_no_of_queue "airoha")
# writing no. of queue per port into file and read on classify generate
if [ ! -d "/tmp/qos" ]; then
@@ -61,4 +61,3 @@ touch /etc/config/qos
# generate qos queue config
config_load ports
config_foreach generate_queue ethport

View File

@@ -25,6 +25,36 @@ configure_qos() {
configure_classify
}
get_no_of_queue() {
platform_name=$1
cpu_model=$2
if [ -z "$platform_name" ];then
return
fi
if [ "$platform_name" == "airoha" ]; then
queue_num=4
echo "Fix: airohai no_of_queue: $queue_num"
elif [ "$platform_name" == "broadcom" ]; then
if [[ $cpu_model == "BCM68"* ]]; then
queue_num=4
echo "Fix: broadcom bcm no_of_queue: $queue_num"
elif grep -qE '[0-9]+ archer$' /proc/devices; then
queue_num=4
echo "Fix: broadcom arcee no_of_queue: $queue_num"
else
queue_num=8
echo "Fix: broadcom else no_of_queue: $queue_num"
fi
elif [ "$platform_name" == "linux" ]; then
queue_num=8
echo "Fix: linux no_of_queue: $queue_num"
fi
echo $queue_num
}
reload_qos() {
local service_name="$1"

View File

@@ -4,17 +4,10 @@
ethwan="$(db -q get hw.board.ethernetWanPort)"
cpu_model="$(cat /proc/socinfo | grep 'SoC Name' | cut -d':' -f2)"
queue_num=8
queue_num=0
populate_no_of_queue(){
case $cpu_model in
BCM68*) queue_num=4;;
esac
if grep -qE '[0-9]+ archer$' /proc/devices; then
queue_num=4
fi
queue_num=$(get_no_of_queue "broadcom")
# writing no. of queue per port into file and read on classify generate
if [ ! -d "/tmp/qos" ]; then
mkdir -p "/tmp/qos"

View File

@@ -642,7 +642,7 @@ handle_ebtables_rules() {
*)
if [ -n "$protocol" ] || [ -n "$dscp_filter" ]; then
ip_version=1 #neither ether_type nor ip address used
#ethertype is not configured by user so install
#ethertype is not configured by user so install
#both proto ipv4 and ipv6 rule
BR6_RULE="$BR_RULE"
broute_filter_on_ether_type "IPv4"
@@ -1372,7 +1372,7 @@ reload_qos_service() {
fi
if [ "$policer" == "true" ]; then
reload_qos "policer"
# change in policer config may need reconfiguration
# change in policer config may need reconfiguration
# of classifier
reload_qos "classify"
fi
@@ -1383,3 +1383,35 @@ reload_qos_service() {
fi
cp /etc/config/qos /tmp/qos/qos
}
get_no_of_queue() {
platform_name=$1
cpu_model=$2
if [ -z "$platform_name" ];then
return
fi
if [ "$platform_name" == "airoha" ]; then
queue_num=4
echo "Fix: airohai no_of_queue: $queue_num"
elif [ "$platform_name" == "broadcom" ]; then
if [[ $cpu_model == "BCM68"* ]]; then
queue_num=4
echo "Fix: broadcom bcm no_of_queue: $queue_num"
elif grep -qE '[0-9]+ archer$' /proc/devices; then
queue_num=4
echo "Fix: broadcom arcee no_of_queue: $queue_num"
else
queue_num=8
echo "Fix: broadcom else no_of_queue: $queue_num"
fi
elif [ "$platform_name" == "linux" ]; then
queue_num=8
echo "Fix: linux no_of_queue: $queue_num"
fi
echo $queue_num
}

View File

@@ -5,7 +5,7 @@
ethwan="$(db -q get hw.board.ethernetWanPort)"
populate_no_of_queue(){
queue_num=8
local queue_num=$(get_no_of_queue "linux")
# writing no. of queue per port into file and read on classify generate
if [ ! -d "/tmp/qos" ]; then

View File

@@ -555,22 +555,22 @@ pre_configure_queue() {
done
}
get_link_rate() {
intf="$1"
speed=0
config_load ports
get_link_rate() {
intf="$1"
speed=0
config_load ports
get_speed() {
psid="$1"
psid="$1"
iname="$2"
config_load ports
config_load ports
config_get ifname "$psid" "ifname"
if [ "$ifname" == "$iname" ]; then
config_get speed "$psid" "speed"
fi
}
config_foreach get_speed ethport $intf
echo "$speed"
}
}
config_foreach get_speed ethport $intf
echo "$speed"
}
configure_queue() {
qdisc_idx=0
@@ -657,6 +657,35 @@ configure_policer() {
echo $POLICER_COUNT > /tmp/qos/max_policer_inst
}
get_no_of_queue() {
platform_name=$1
cpu_model=$2
if [ -z "$platform_name" ];then
return
fi
if [ "$platform_name" == "airoha" ]; then
queue_num=4
echo "Fix: airohai no_of_queue: $queue_num"
elif [ "$platform_name" == "broadcom" ]; then
if [[ $cpu_model == "BCM68"* ]]; then
queue_num=4
echo "Fix: broadcom bcm no_of_queue: $queue_num"
elif grep -qE '[0-9]+ archer$' /proc/devices; then
queue_num=4
echo "Fix: broadcom arcee no_of_queue: $queue_num"
else
queue_num=8
echo "Fix: broadcom else no_of_queue: $queue_num"
fi
elif [ "$platform_name" == "linux" ]; then
queue_num=8
echo "Fix: linux no_of_queue: $queue_num"
fi
echo $queue_num
}
configure_qos() {
pre_configure_queue