aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-11-21 13:46:41 +0100
committerFelix Fietkau <nbd@nbd.name>2021-11-21 13:47:18 +0100
commite9610794fd978175702b715a17f7925915fd1479 (patch)
treeb11a738402bb9f1e10f657c877c4d420dd2954f8 /package/network
parent9962585f2d8ffa069becadff707fe660d31adb16 (diff)
downloadupstream-e9610794fd978175702b715a17f7925915fd1479.tar.gz
upstream-e9610794fd978175702b715a17f7925915fd1479.tar.bz2
upstream-e9610794fd978175702b715a17f7925915fd1479.zip
qosify: add support for configuring overhead
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/network')
-rw-r--r--package/network/config/qosify/files/qosify.conf1
-rw-r--r--package/network/config/qosify/files/qosify.init41
2 files changed, 41 insertions, 1 deletions
diff --git a/package/network/config/qosify/files/qosify.conf b/package/network/config/qosify/files/qosify.conf
index 865a023390..ac3423a8d4 100644
--- a/package/network/config/qosify/files/qosify.conf
+++ b/package/network/config/qosify/files/qosify.conf
@@ -28,6 +28,7 @@ config interface wan
option disabled 1
option bandwidth_up 100mbit
option bandwidth_down 100mbit
+ option overhead_type none
# defaults:
option ingress 1
option egress 1
diff --git a/package/network/config/qosify/files/qosify.init b/package/network/config/qosify/files/qosify.init
index eca79e6024..f676d92a52 100644
--- a/package/network/config/qosify/files/qosify.init
+++ b/package/network/config/qosify/files/qosify.init
@@ -72,7 +72,46 @@ add_interface() {
add_option boolean autorate_ingress
add_option string ingress_options
add_option string egress_options
- add_option string options
+
+ config_get user_options "$cfg" options
+
+ config_get otype "$cfg" overhead_type
+ options=
+ case "$otype" in
+ none);;
+ manual)
+ config_get overhead "$cfg" overhead
+ [ -n "$overhead" ] && append options "overhead $overhead"
+
+ config_get encap "$cfg" overhead_encap
+ [ -n "$encap" ] && append options "$encap"
+ ;;
+ conservative|\
+ pppoa-vcmux|\
+ pppoa-llc|\
+ pppoe-vcmux|\
+ pppoe-llcsnap|\
+ bridged-vcmux|\
+ bridged-llcsnap|\
+ ipoa-vcmux|\
+ ipoa-llcsnap|\
+ pppoe-ptm|\
+ bridged-ptm|\
+ docsis|\
+ ethernet)
+ append options "$otype"
+ ;;
+ esac
+
+ config_get mpu "$cfg" overhead_mpu
+ [ -n "$mpu" ] && append options "mpu $mpu"
+
+ config_get ovlan "$cfg" overhead_vlan
+ [ "${ovlan:-0}" -ge 2 ] && append options "ether-vlan"
+ [ "${ovlan:-0}" -ge 1 ] && append options "ether-vlan"
+
+ [ -n "$user_options" ] && append options "$user_options"
+ [ -n "$options" ] && json_add_string options "$options"
json_close_object
}