Compare commits

...

8 Commits

Author SHA1 Message Date
Maxim Menshikov
27260b776e qosmngr/airoha: generate 8 queues by default 2023-01-31 08:27:58 +00:00
Maxim Menshikov
82dd82e9e0 qosmngr/airoha: set correct queue marks 2023-01-31 08:27:58 +00:00
Maxim Menshikov
eb9f8840f0 qosmngr/airoha: be clear that per-queue rate is not supported 2023-01-31 08:27:58 +00:00
Maxim Menshikov
318e1aae6a qosmngr/airoha: use huge rate limit by default if rate shaping is not enabled 2023-01-31 08:27:58 +00:00
Maxim Menshikov
e59b4a7b2b qosmngr/airoha: maintain correct queue counter for different scenarios 2023-01-31 08:27:58 +00:00
Maxim Menshikov
cf9c3c2d13 qosmngr/airoha: calculate queue mask by queue counter 2023-01-31 08:27:58 +00:00
Maxim Menshikov
44250138b2 qosmngr/airoha: use 8 queues in more places 2023-01-31 08:27:58 +00:00
Maxim Menshikov
0fb476bdb7 qosmngr/airoha: enable eight queue PQ/WRR 2023-01-31 08:27:58 +00:00
3 changed files with 28 additions and 17 deletions

View File

@@ -5,7 +5,7 @@
ethwan="$(db -q get hw.board.ethernetWanPort)"
populate_no_of_queue(){
queue_num=4
queue_num=8
# writing no. of queue per port into file and read on classify generate
if [ ! -d "/tmp/qos" ]; then
@@ -26,7 +26,7 @@ generate_queue(){
fi
# guaranteed number of queues
no_of_q="0 1 2 3"
no_of_q="0 1 2 3 4 5 6 7"
i=0
local total_q=$((${no_of_q##* } + 1))

View File

@@ -27,7 +27,6 @@ hw_intf_init() {
# Initialize the hardware setup library
hw_init_all() {
export TMP_HW_QUEUE_LIST=""
export TMP_HW_QUEUE_MASK="0"
return 0
}
@@ -58,7 +57,10 @@ hw_queue_set() {
export TMP_HW_QUEUE_${order}_rate="${rate}"
export TMP_HW_QUEUE_${order}_burstsize="${burstsize}"
export TMP_HW_QUEUE_LIST="${TMP_HW_QUEUE_LIST} ${order}"
export TMP_HW_QUEUE_MASK="$((TMP_HW_QUEUE_MASK | 1 << index))"
if [ "${rate}" != "" ] && [ $(($rate != 0)) ] ; then
errmsg "Per-queue shape rate is not implemented"
fi
return 0
}
@@ -146,8 +148,8 @@ hw_commit_all() {
local weight_list=""
local glob_alg=""
local shape_rate="$TMP_HW_SHAPE_RATE"
local queue_mask="$TMP_HW_QUEUE_MASK"
local q_count="0"
local mac_qos_flag=""
# Reorder queues
for q in ${sorted_list} ; do
@@ -163,27 +165,36 @@ hw_commit_all() {
case "${sc_alg}" in
WRR)
if [ $(($q_count >= 4)) != 0 ] ; then
if [ $(($q_count >= 8)) != 0 ] ; then
errmsg "Too many queues, next queues will be ignored"
else
weight_list="$weight_list $wgt"
fi
q_count=$((q_count + 1))
;;
esac
q_count=$((q_count + 1))
done
if [ "${glob_alg}" == "WRR" ] ; then
while [ $((q_count < 4)) != 0 ] ; do
weight_list="$weight_list 1"
q_count=$((q_count + 1))
done
fi
case "${glob_alg}" in
WRR)
mac_qos_flag="8QWRR"
while [ $((q_count < 8)) != 0 ] ; do
weight_list="$weight_list 1"
q_count=$((q_count + 1))
done
;;
SP)
mac_qos_flag="8QPQ"
q_count="8"
;;
esac
if [ "${glob_alg}" != "" ] ; then
/userfs/bin/qosrule discpline $(hw_sc_alg2str ${glob_alg}) ${weight_list} \
uplink-bandwidth ${shape_rate:-0} \
queuemask $queue_mask
uplink-bandwidth ${shape_rate:-10000000} \
queuemask "$(((1 << q_count) - 1))"
echo ${mac_qos_flag} > /proc/qdma_wan/mac_qos_flag
else
/userfs/bin/qosrule discpline Enable 0
fi

View File

@@ -117,9 +117,9 @@ broute_filter_on_vid() {
}
broute_rule_set_traffic_class() {
BR_RULE="$BR_RULE -j mark --mark-or 0x$1 --mark-target ACCEPT"
BR_RULE="$BR_RULE -j mark --mark-or 0x${1}0 --mark-target ACCEPT"
if [ -n "$BR6_RULE" ]; then
BR6_RULE="$BR6_RULE -j mark --mark-or 0x$1 --mark-target ACCEPT"
BR6_RULE="$BR6_RULE -j mark --mark-or 0x${1}0 --mark-target ACCEPT"
fi
}