Compare commits

..

42 Commits

Author SHA1 Message Date
Rahul
dc1bb38882 mcastmngr: fix iptv in transparent bridge scenario 2021-03-09 18:24:10 +05:30
Amin Ben Ramdhane
9a622d41c0 bbf: 3.9-2021-02-26 2021-02-26 15:39:35 +01:00
Amin Ben Ramdhane
f274eda7f5 Revert "BulkData: Align with latest bbf changes"
This reverts commit 9cff7aa8a4.
2021-02-26 15:38:21 +01:00
Amin Ben Ramdhane
7c404c8a1e Revert "XMPP: Align with latest bbf changes"
This reverts commit ef3e5adc4c.
2021-02-26 15:38:12 +01:00
Amin Ben Ramdhane
af615cc65f Revert "TWAMP: Align with latest bbf changes"
This reverts commit cb4c41944b.
2021-02-26 15:38:02 +01:00
Amin Ben Ramdhane
e63f8f36ec Revert "UDPEchoServer: Align with latest bbf changes"
This reverts commit e5a018e3c0.
2021-02-26 15:37:52 +01:00
Rahul
76c4db8bfa mcastmngr: fix IGMP report leak issue
This commit fixes the report leak issue on lan side.

Note: this however causes another issue when fast leave is disabled,
that is, leave from 1 port affects the stream on other port for which
Broadcom will share a release expected in March 2021.
2021-02-24 13:29:05 +05:30
Amin Ben Ramdhane
b5721853dd bbf: 3.8-2021-02-22 2021-02-22 12:46:59 +01:00
Amin Ben Ramdhane
9cff7aa8a4 BulkData: Align with latest bbf changes 2021-02-22 12:45:33 +01:00
Amin Ben Ramdhane
ef3e5adc4c XMPP: Align with latest bbf changes 2021-02-22 12:45:20 +01:00
Amin Ben Ramdhane
cb4c41944b TWAMP: Align with latest bbf changes 2021-02-22 12:45:06 +01:00
Amin Ben Ramdhane
e5a018e3c0 UDPEchoServer: Align with latest bbf changes 2021-02-22 12:44:39 +01:00
Amin Ben Ramdhane
a435938a5c bbf: 3.7-2021-02-18 2021-02-18 18:06:12 +01:00
Rahul
f3584337fe qosmngr: more generic fix for bug #4389
Instead of relying on the model name, extract the index from the
port name itself.
2021-02-16 15:25:48 +05:30
Rahul
4bf5c782f6 qosmngr: fix 4323 on release-5.3
Problem: port order is different on FT

Solution: configure policer as per port order
2021-02-16 13:23:54 +05:30
Amin Ben Ramdhane
6836f6a597 bbf: 3.6-2021-02-01 2021-02-01 19:53:12 +01:00
Rahul
972c07e63f qosmngr: fix console hang
Cause: the ubus call with -S when ubus is implemented in rpcd and
returns nothing seems to take the default 30 seconds of wait time
before returning control to the console, this gives the impression
that the device is hung during boot if logged in via console.
No problem in ssh to the device, console just hangs for 30 additional
seconds approx before returning the login prompt.

Fix: Replace the ubus call with call to function from the lib/qos.
This is how it is now anyway in iop6 so should be fine.

Test:
- No regression.
- 10 reboots, prompt returned much faster on console.
2021-01-29 16:37:40 +05:30
Amin Ben Ramdhane
637e508106 bbf: 3.5-2021-01-20 2021-01-20 09:42:05 +01:00
Amin Ben Ramdhane
76a7832d48 bbf: 3.4-2021-01-13 2021-01-13 20:55:50 +01:00
Amin Ben Ramdhane
1416e4f0c5 bbf: 3.3-2021-01-12 2021-01-12 23:03:57 +01:00
Amin Ben Ramdhane
00f74031bb bbf: 3.2-2020-12-23 2020-12-23 20:16:50 +01:00
Yalu Zhang
f3bc9cd9de Update feed: endptmngr 2020-12-22 11:22:57 +01:00
Anjan Chanda
9d60fa591a easy-soc-libs: 5.3.17 2020-12-15 16:42:31 +01:00
Rahul
749f88ad66 qosmngr: read queue stats from correct queue id
This was a regression that got introduced by Precedence patch for
the eg400 and dg400 devices, on panther things were fine.

This will fix bug #4011
2020-12-12 11:52:31 +05:30
Rahul
cf868b2631 qosmngr: ignore precedence in case of WRR queues
Inherit the intelligence to ignore precendence value and use 0
in case of WRR queues from runner to qosmngr. This will uniformalise
the behaviour for eg400 and dg400prime devices.

test:
Pass on both panther and dg400prime devices
mixed mode works
SP works in isolation
WRR works in isolation
2020-12-11 17:41:29 +05:30
Rahul
0b7b82bbcb qosmngr: update dscp to 1 mapping for L2 scenario
Fix Bug #3755, this patch configures dscp to q mapping in L2 scenario.

Note: It has been verified that L3 scenario is not broken with this
change.
2020-12-08 21:07:12 +05:30
Rahul
8b79c93b70 qosmngr: update default config
Precedence value update to map with tr181 in default config,
now goes from 1 to 8, 8 meaning queue has lowest priority and 1
meaning that the queue has highest priority.

The broadcom script takes care of reversing this and mapping this
to 0 to 7 before configuring actual queues.
2020-12-03 21:23:44 +05:30
Amin Ben Ramdhane
41a2b33024 bbf: 3.1-2020-12-03 2020-12-03 11:04:28 +01:00
Rahul
42130215f4 qosmngr: fix regression
latest patch to resolve precedence issue causes regression.
Bug: queues for any port not configured at boot
fix: create the folders which store queue precedence
2020-12-02 19:07:51 +05:30
Amin Ben Ramdhane
9cab9f983e bbf: 3.0-2020-12-02 2020-12-02 09:59:15 +01:00
jjoseph
a651b4af52 qosmngr: Bug #3822: TR-181: Some Device.QoS.Queue parameters are returning invalid values
(cherry picked from commit 38f737fa20)
2020-12-02 06:40:01 +00:00
Amin Ben Ramdhane
1c6d940543 bbf: 2.9-2020-11-30 2020-11-30 17:11:22 +01:00
Sukru Senli
0824a450fb iop: deselect miniupnpc by default 2020-11-29 15:12:29 +01:00
Ronny Nilsson
3111194de3 TaaS: backport testing for Iopsys 5.3 too. 2020-11-29 14:42:32 +01:00
Omar Kallel
a4a366d4fb icwmp: Fix memory leak 2020-11-26 11:40:33 +01:00
Jakob Olsson
77ac04fbba ieee1905: 2.1.1 2020-11-24 14:32:24 +01:00
Omar
50250670d3 icwmp: 5.0-2020-11-24 2020-11-24 12:01:52 +01:00
Amin Ben Ramdhane
8fe1d9bae8 bbf: 2.8-2020-11-21 2020-11-21 14:20:42 +01:00
Amin Ben Ramdhane
e206909e61 bbf: 2.7-2020-11-20 2020-11-20 21:56:23 +01:00
Rahul
5123f6cdd2 Fix Bug #3822: BurstSize default value updated
The default value of burst size in config is set to -1 which is one
part of the problem. The other part of the problem is that the check
in tr181 is not good enough to disallow negative values. That will
be fixed in a seprate patch.
2020-11-20 11:46:44 +05:30
Amin Ben Ramdhane
f153266bbd bbf: 2.6-2020-11-13 2020-11-13 17:03:08 +01:00
Anjan Chanda
6b69a35d00 ieee1905: 2.1.0 2020-11-09 10:30:49 +01:00
11 changed files with 355 additions and 29 deletions

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libbbfdm
PKG_VERSION:=2.6-2020-11-13
PKG_VERSION:=3.9-2021-02-26
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=192a2f48b0d066e182e2bbe193a826487c90f11f
PKG_SOURCE_VERSION:=0ddc89bda0a9ad254f6d41992cfb1b827e8c62c7
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)

View File

@@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=easy-soc-libs
PKG_VERSION:=5.3.15
PKG_VERSION:=5.3.17
PKG_RELEASE:=1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=a2289131c5d1f602568a2e8cac1295442504827f
PKG_SOURCE_VERSION:=ecb53194e101cadecfc158eb459db4539dfecd7f
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_RELEASE:=1
PKG_VERSION:=0.3
PKG_SOURCE_VERSION:=34ae1996beda98691d779e49f231bd662fc87cda
PKG_SOURCE_VERSION:=0a2b7dd6f58eb0dc5255fee4ee3d776524b64fe9
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE

View File

@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=5.0-2020-10-13
PKG_VERSION:=5.0-2020-11-26
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=85ffabf799f769f9100068e887ed4f5ca8286620
PKG_SOURCE_VERSION:=772cafc55b332555ab1c73180ccd420054823df5
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=2.1.0
PKG_VERSION:=2.1.1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=5b712be46aadc0b54cdb72464150ab58892e9c3f
PKG_SOURCE_VERSION:=a0bcdb6eb791f5bebff4dc9024b99f51d00ed53b
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
endif

View File

@@ -53,7 +53,6 @@ CONFIG_PACKAGE_libreswan=m
CONFIG_PACKAGE_libwifi=y
CONFIG_PACKAGE_lscpu=y
CONFIG_PACKAGE_map=y
CONFIG_PACKAGE_miniupnpc=y
CONFIG_PACKAGE_miniupnpd=y
CONFIG_PACKAGE_mwan3=y
CONFIG_PACKAGE_nand-utils=y

95
iop/scripts/taas.sh Normal file
View File

@@ -0,0 +1,95 @@
# Shorthand command for doing a HIL runtime smoketest on the
# latest built image. Does the image boot up correctly?
# More info here:
# https://dev.iopsys.eu/iopsys/iopsys-taas
#--------------------------------------------------------------
function taas-init() {
local f
# Path to TaaS binarys. Try some likely ones.
if ! which taas-smoketest >/dev/null; then
PATH="${PATH}:${PWD}/../iopsys-taas/bin"
PATH="${PATH}:${PWD}/../taas/bin"
PATH="${PATH}:${HOME}/iopsys-taas/bin"
PATH="${PATH}:${HOME}/taas/bin"
PATH="${PATH}:${HOME}/bin"
PATH="${PATH}:/opt/iopsys-taas/bin"
PATH="${PATH}:/opt/taas/bin"
fi
if ! which taas-smoketest >/dev/null; then
echo "Error; TaaS is missing! Install it with:"
echo "git clone git@dev.iopsys.eu:iopsys/iopsys-taas.git ../iopsys-taas"
exit 1
fi
# NAND erase block size.
nandBlkSz=$(grep CONFIG_TARGET_NAND_BLOCKSZ .config | \
tr -s "=\"" " " | cut -d " " -f 2)
nandBlkSz=$((nandBlkSz / 1024))
# Create a list of all images which might be of use.
for f in ${PWD}/bin/targets/iopsys-*/generic/last.* \
${PWD}/build_dir/target-arm*/bcmkernel/bcm963xx/targets/9*/bcm*_linux_raw_image_${nandBlkSz}.bin; do
[[ -s "$f" ]] && images+=("$f")
done
# Convert Iopsys target name to the TaaS product name format
# according to what is available in the remote lab for HIL.
# Also find a suitable image.
product=$(grep CONFIG_TARGET_PROFILE .config | \
tr -s "=\"" " " | cut -d " " -f 2) || exit
case "$product" in
smarthub3)
export product="SmartHub3a"
;;
dg400prime|eg400|ex600)
export product=$(echo -n "$product" | tr [[:lower:]] [[:upper:]])
;;
*)
echo "Unsupported target; skipping!"
exit 0
;;
esac
if [[ ${#images[@]} -eq 0 ]]; then
echo "No image found"
exit 1
fi
}
#--------------------------------------------------------------
function taas-smoketest {
declare -a images
taas-init || return
echo "Testing a $product with ${images[@]}..."
command taas-smoketest "${images[@]}" "$product" "$@"
}
#--------------------------------------------------------------
function taas-bootstrap {
declare -a images
if [[ -n "$1" ]]; then
taas-init || return
echo "Flashing $1..."
command taas-bootstrap "${images[@]}" "$@"
else
echo "Usage: ./iop taas-bootstrap dutX"
exit 1
fi
}
register_command "taas-bootstrap" "Write image to a remote lab device."
register_command "taas-smoketest" "Write image to a remote lab device and test it."

View File

@@ -253,7 +253,11 @@ config_mcast_proxy_interface() {
echo "${p1}-proxy-interfaces $proxdevs" >> $CONFFILE
fi
[ -n "$proxdevs" ] && echo "${p1}-mcast-interfaces $proxdevs" >> $CONFFILE
if [ -n "$proxdevs" ]; then
echo "${p1}-mcast-interfaces $proxdevs" >> $CONFFILE
else
echo "${p1}-mcast-interfaces $ethwan" >> $CONFFILE
fi
}
configure_mcpd_snooping() {
@@ -261,7 +265,7 @@ configure_mcpd_snooping() {
local exceptions
local filter_ip=""
local fast_leave=0
# Configure snooping related params
if [ "$protocol" == "igmp" ]; then
config_snooping_common_params $protocol $igmp_s_version $igmp_s_robustness $igmp_s_mode
@@ -415,6 +419,22 @@ config_global_params() {
setup_mcast_mode() {
# set the mode at chip to allow both tagged and untagged multicast forwarding
bs /b/c iptv lookup_method=group_ip_src_ip
# redirect igmp and mld traffic to host so that mcpd is the only actor on it,
# linux snooping does not participate
local portorder="$(db -q get hw.board.ethernetPortOrder)"
local wanport="$(db -q get hw.board.ethernetWanPort)"
local i=0
for port in $portorder; do
if [ "$wanport" == "$port" ]; then
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=wan0 ingress_filter[igmp]={enabled=yes,action=host}
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=wan0 ingress_filter[mld]={enabled=yes,action=host}
else
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=lan$i ingress_filter[igmp]={enabled=yes,action=host}
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=lan$i ingress_filter[mld]={enabled=yes,action=host}
i=$(($i + 1))
fi
done
}
configure_mcast() {

View File

@@ -13,7 +13,7 @@ include /lib/qos
start_service() {
if [ -f "/etc/config/qos" ]; then
ubus -S call qos reload
reload_qos
fi
}

View File

@@ -24,15 +24,17 @@ generate_queue(){
fi
i=0
local total_q=$((${no_of_q##* } + 1))
for i in $no_of_q; do
order=$((total_q - i))
uci add qos queue
uci rename qos.@queue[-1]="q_${i}_${ifname}"
uci set qos.@queue[-1].enable="1"
uci set qos.@queue[-1].ifname="$ifname"
uci set qos.@queue[-1].precedence="$i"
uci set qos.@queue[-1].precedence="$order"
uci set qos.@queue[-1].scheduling="SP"
uci set qos.@queue[-1].rate="0"
uci set qos.@queue[-1].burst_size="-1"
uci set qos.@queue[-1].burst_size="0"
uci set qos.@queue[-1].weight="1"
done

View File

@@ -6,27 +6,141 @@ BR_RULE=""
is_bcm968=0
POLICER_COUNT=0
INTF_NAME=""
Q_COUNT=0
ITER=0
PREV_ORDER=""
CURR_ORDER=""
MAX_ORDER=""
#function to handle a queue section
handle_queue() {
# Function to handle a queue order and
# update total number of queues
handle_q_order() {
qid="$1" #queue section ID
config_get is_enable "$qid" "enable"
#no need to configure disabled queues
# No need to configure disabled queues
if [ $is_enable == '0' ]; then
return
fi
config_get ifname "$qid" "ifname"
#if ifname is empty that is good enough to break
# If ifname is empty that is good enough to break
if [ -z "$ifname" ];then
return
fi
# Create precedence file containing queue order per
# interface.
local precedence_file="/tmp/qos/$ifname/q_order"
local q_no=$(cat /tmp/qos/queue_stats/$ifname/q_idx)
#lower the value, lower the priority of queue on this chip
config_get order "$qid" "precedence"
config_get precedence "$qid" "precedence"
value=${precedence}_q${q_no}
echo $value >> $precedence_file
# Update the number of queues per interface.
q_no=$((q_no + 1))
echo $q_no > /tmp/qos/queue_stats/$ifname/q_idx
}
# Function to check if values are greater than (total number
# of queue -1) and map them to corresponding value.
configure_precedence_to_file() {
order="$1"
line="$2"
order_file="$3"
if [ $order == $PREV_ORDER ]; then
queue_id=${line#*_}
val=${CURR_ORDER}_${queue_id}
echo $val >> $order_file
else
PREV_ORDER=$order
queue_id=${line#*_}
val=${MAX_ORDER}_${queue_id}
echo $val >> $order_file
CURR_ORDER=$MAX_ORDER
MAX_ORDER=$((MAX_ORDER - 1))
fi
}
# Fucntion to map queue precedence per interface
# ranging from 1-X to 0-(no of queues -1)
map_queue_precedence() {
ifname="$1"
total_q=$(cat /tmp/qos/queue_stats/$ifname/q_idx)
q_no=`expr $total_q - 1`
MAX_ORDER=$q_no
local precedence_file="/tmp/qos/$ifname/q_precedence"
local order_file="/tmp/qos/$ifname/q_order"
sort -n -r -k1 $order_file >> $precedence_file
rm $order_file
while read line
do
order=${line%_*}
if [ $order -gt $q_no ]; then
ITER=$((ITER + 1))
configure_precedence_to_file $order $line $order_file
else
if [ $ITER == '0' ]; then
echo $line >> $order_file
else
configure_precedence_to_file $order $line $order_file
fi
fi
done < $precedence_file
}
map_precedence() {
for interf in $(db -q get hw.board.ethernetPortOrder); do
map_queue_precedence $interf
done
}
# function to handle a queue section
handle_queue() {
qid="$1" #queue section ID
config_get is_enable "$qid" "enable"
# no need to configure disabled queues
if [ $is_enable == '0' ]; then
return
fi
config_get ifname "$qid" "ifname"
# if ifname is empty that is good enough to break
if [ -z "$ifname" ];then
return
fi
# This is to get the qid per interface.
if [ $INTF_NAME == $ifname ]; then
Q_COUNT=$((Q_COUNT + 1))
else
Q_COUNT='0'
fi
INTF_NAME=$ifname
local total_q=$(cat /tmp/qos/queue_stats/$ifname/q_idx)
q_no=`expr $total_q - 1` local
precedence_file="/tmp/qos/$ifname/q_order"
# TR181 suggests lower the precedence value higher the priority
# but in the chip its the opposite ie lower the value, lower
# the priority of queue on this chip. So we need to reverse the
# precedence value.
precedence="$(grep -i q${Q_COUNT} $precedence_file)"
precedence=${precedence%_*}
order=`expr $q_no - $precedence`
config_get sc_alg "$qid" "scheduling"
config_get wgt "$qid" "weight"
@@ -47,12 +161,17 @@ handle_queue() {
;;
esac
# ignore precedence value in case of WRR
if [ $salg -eq 2 ]; then
order=0
fi
# Call tmctl which is a broadcomm command to configure queues on a port.
tmctl setqcfg --devtype 0 --if $ifname --qid $q_no --priority $order --qsize $qsize --weight $wgt --schedmode $salg --shapingrate $rate --burstsize $bs
tmctl setqcfg --devtype 0 --if $ifname --qid $Q_COUNT --priority $order --qsize $qsize --weight $wgt --schedmode $salg --shapingrate $rate --burstsize $bs
# In BCM968 chips, the counters for queues are read, on other model, its read and reset. So, to maintain counter
# value and uniform behaviour, we are storing counter value for each queue in files
local d_name="/tmp/qos/queue_stats/${ifname}/q_${q_no}"
local d_name="/tmp/qos/queue_stats/${ifname}/q_${Q_COUNT}"
mkdir $d_name
local f_name="$d_name/txPackets"
touch $f_name
@@ -67,8 +186,6 @@ handle_queue() {
touch $f_name
echo 0 > $f_name
q_no=$((q_no + 1))
echo $q_no > /tmp/qos/queue_stats/$ifname/q_idx
}
#function to handle a policer section
@@ -201,6 +318,14 @@ broute_append_rule() {
echo "ebtables -t broute -A qos $BR_RULE" >> /tmp/qos/classify.ebtables
}
broute_rule_enable_qosmap() {
if [ -n "$1" ]; then
BR_RULE="$BR_RULE -i $1 -j QOSMAP --dscp2q 1"
else
BR_RULE="$BR_RULE -j QOSMAP --dscp2q 1"
fi
}
handle_ebtables_rules() {
sid=$1
local is_l2_rule=0
@@ -212,6 +337,7 @@ handle_ebtables_rules() {
config_get src_if "$sid" "ifname"
config_get src_mac "$sid" "src_mac"
config_get dst_mac "$sid" "dst_mac"
config_get dscp_filter "$sid" "dscp_filter"
config_get pcp_check "$sid" "pcp_check"
config_get eth_type "$sid" "ethertype"
config_get vid "$sid" "vid_check"
@@ -250,6 +376,10 @@ handle_ebtables_rules() {
is_l2_rule=1
fi
if [ -n "$sdcp_filter" ]; then
is_l2_rule=1
fi
if [ -n "$eth_type" ]; then
broute_filter_on_ether_type $eth_type
is_l2_rule=1
@@ -324,10 +454,59 @@ handle_ebtables_rules() {
fi
fi
if [ -n "$dscp_filter" -a -n "$traffic_class" ]; then
# The parameter is called pbit but broadcom internally seems to
# treat this as traffic class, so not to be cofused with pbit in
# vlan header here, that is tackled by the dscp2pbit vlanctl
# which is part of the network config
tmctl setdscptopbit --dscp "$dscp_filter" --pbit "$traffic_class"
# If the target in the ebtables is mark, then, then mark value
# is the traffic class and there seems to be 1-o-1 mapping between
# traffic class and qid, for example, if packet is marked 3, then
# it is mapped to qid 3, following the same scheme here.
tmctl setpbittoq --pbit "$traffic_class" --qid "$traffic_class"
local wanport="$(db -q get hw.board.ethernetWanPort)"
local portorder="$(db -q get hw.board.ethernetPortOrder)"
if [ -n "$src_if" ]; then
# enable dscp2q mapping only for specified interfaces
if [ "$wanport+" == "$src_if" ]; then
# handling dowstream traffic scenario, src_if is
# always source interface in case of qos
for intf in $portorder; do
if [ "$wanport" == "$intf" ]; then
continue
fi
tmctl setpbittoq --devtype 0 --if "$intf"
done
else
# upstream traffic scenario
tmctl setpbittoq --devtype 0 --if "$wanport"
fi
else
# enable dscp to q mapping for all ports
for intf in $portorder; do
tmctl setpbittoq --devtype 0 --if "$intf"
done
fi
init_broute_rule
broute_rule_enable_qosmap $src_if
broute_append_rule
# dscp to traffic class mapping rule should not be used in tandem
# with other classification criteria, seprate rules should be added
# for each classification rule, hence we return from here in case
# the rules is a dscp to traffic class mapping rule
return
fi
if [ $is_l2_rule -eq 0 ]; then
return
fi
# Check and configure dscp to queue mapping
[ -n "$traffic_class" ] && broute_rule_set_traffic_class $traffic_class
[ -n "$BR_RULE" ] && broute_append_rule
@@ -529,17 +708,16 @@ assign_policer_to_port() {
local portorder="$(db -q get hw.board.ethernetPortOrder)"
local wanport="$(db -q get hw.board.ethernetWanPort)"
local i=0
for port in $portorder; do
if [ "$ifname" == "$port" ]; then
if [ "$wanport" == "$port" ]; then
bs /b/configure port/index=wan0 ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=wan0 ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
else
bs /b/configure port/index=lan$i ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
local i="${port: -1}"
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=lan$i ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
fi
break
fi
i=$((i + 1))
done
}
@@ -650,6 +828,28 @@ configure_shaper() {
config_foreach handle_shaper shaper
}
deconfig_dscp_to_q_mapping() {
# reset dscp to pbit (read traffic class) map
i=0
while :
do
if [ $i -eq 64 ]; then
break
fi
# by default all are mapped to pbit (read traffic class) are mapped
# to 0
tmctl setdscptopbit --dscp "$i" --pbit 0
i=$((i + 1))
done
# reset pbittoq map
for i in 0 1 2 3 4 5 6 7; do
# by default all are mapped to q 0
tmctl setpbittoq --pbit "$i" --qid 0
done
}
configure_classify() {
#processing classify section
# First remove old files
@@ -666,6 +866,8 @@ configure_classify() {
#add flush chain rules
flush_chains
deconfig_dscp_to_q_mapping
# Load UCI file
config_load qos
config_foreach handle_classify classify
@@ -685,6 +887,8 @@ configure_queue() {
rm -rf /tmp/qos/queue_stats
for intf in $(db get hw.board.ethernetPortOrder); do
rm -rf /tmp/qos/$intf
mkdir -p /tmp/qos/queue_stats/$intf
touch /tmp/qos/queue_stats/$intf/q_idx
echo 0 > /tmp/qos/queue_stats/$intf/q_idx
@@ -692,10 +896,16 @@ configure_queue() {
for i in 0 1 2 3 4 5 6 7; do
tmctl delqcfg --devtype 0 --if $intf --qid $i &>/dev/null
done
mkdir -p /tmp/qos/$intf
touch /tmp/qos/$intf/q_order
touch /tmp/qos/$intf/q_precedence
done
# Load UCI file
config_load qos
config_foreach handle_q_order queue
map_precedence
config_foreach handle_queue queue
}