mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
qosmngr: qos q map based on traffic class
This commit is contained in:
parent
1c752ef851
commit
d30c1615ca
9 changed files with 19 additions and 8 deletions
6
qosmngr/files/airoha/lib/qos/chains.iptables.sh
Executable file
6
qosmngr/files/airoha/lib/qos/chains.iptables.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Install iptables rules
|
||||||
|
|
||||||
|
iptables_set_traffic_class() {
|
||||||
|
IP_RULE="$IP_RULE -j MARK --set-xmark 0x${1}0/0xF0"
|
||||||
|
}
|
||||||
|
|
@ -5,13 +5,14 @@
|
||||||
include /lib/ethernet
|
include /lib/ethernet
|
||||||
|
|
||||||
. /lib/qos/iptables.sh
|
. /lib/qos/iptables.sh
|
||||||
. /lib/qos/common/chains.ebtables.sh
|
. /lib/qos/chains.ebtables.sh
|
||||||
|
. /lib/qos/chains.iptables.sh
|
||||||
. /lib/qos/ebtables.sh
|
. /lib/qos/ebtables.sh
|
||||||
. /lib/qos/ip_rule.sh
|
. /lib/qos/ip_rule.sh
|
||||||
. /lib/qos/classify.sh
|
. /lib/qos/classify.sh
|
||||||
. /lib/qos/common/policer.sh
|
. /lib/qos/policer.sh
|
||||||
. /lib/qos/common/queue.sh
|
. /lib/qos/queue.sh
|
||||||
. /lib/qos/common/shaper.sh
|
. /lib/qos/shaper.sh
|
||||||
. /lib/qos/airoha.sh
|
. /lib/qos/airoha.sh
|
||||||
|
|
||||||
get_rate_per_queue() {
|
get_rate_per_queue() {
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,10 @@ handle_queue() {
|
||||||
Q_COUNT=$((Q_COUNT + 1))
|
Q_COUNT=$((Q_COUNT + 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iptables_set_traffic_class() {
|
||||||
|
IP_RULE="$IP_RULE -j MARK --set-xmark 0x$1/0x$1"
|
||||||
|
}
|
||||||
|
|
||||||
ebt_match_ipv6_dscp() {
|
ebt_match_ipv6_dscp() {
|
||||||
#when ethertype is not configured by user then both proto rules of ipv4
|
#when ethertype is not configured by user then both proto rules of ipv4
|
||||||
#and ipv6 to be installed so update BR6_RULE string as well otherwise
|
#and ipv6 to be installed so update BR6_RULE string as well otherwise
|
||||||
|
|
|
||||||
|
|
@ -55,10 +55,6 @@ iptables_set_dscp_mark() {
|
||||||
IP_RULE="$IP_RULE -j DSCP --set-dscp $1"
|
IP_RULE="$IP_RULE -j DSCP --set-dscp $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
iptables_set_traffic_class() {
|
|
||||||
IP_RULE="$IP_RULE -j MARK --set-xmark 0x${1}0/0xF0"
|
|
||||||
}
|
|
||||||
|
|
||||||
append_rule_to_mangle_table() {
|
append_rule_to_mangle_table() {
|
||||||
if [ "$2" == 4 ]; then
|
if [ "$2" == 4 ]; then
|
||||||
echo "iptables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.iptables
|
echo "iptables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.iptables
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,10 @@ handle_queue() {
|
||||||
Q_COUNT=$((Q_COUNT + 1))
|
Q_COUNT=$((Q_COUNT + 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iptables_set_traffic_class() {
|
||||||
|
IP_RULE="$IP_RULE -j MARK --set-mark $1"
|
||||||
|
}
|
||||||
|
|
||||||
ebt_match_ipv6_dscp() {
|
ebt_match_ipv6_dscp() {
|
||||||
#when ethertype is not configured by user then both proto rules of ipv4
|
#when ethertype is not configured by user then both proto rules of ipv4
|
||||||
#and ipv6 to be installed so update BR6_RULE string as well otherwise
|
#and ipv6 to be installed so update BR6_RULE string as well otherwise
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue