mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 03:24:14 +08:00
Compare commits
1 Commits
devel-no-h
...
Bug_9545
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1317bfcdc |
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user