Thank you for implementing all my suggestions so quickly.
I was able to resolve most of the issues from time, such as Error: Exclusivity flag on, cannot modify.
.
I think I had an instance of QoSify or the default cake SQM running. After setting them all to disabled
under the luci startup section and rebooting, the error disappeared.
But one command is still failing for me:
root@FriendlyWrt:~# tc filter add dev eth0 parent ffff: protocol ip matchall action ctinfo dscp 63 128 action mirred egress redirect dev ifb-eth0
Error: TC classifier not found.
We have an error talking to the kernel
Since it seems to be working for everyone else, I think it may have something to do with my system. I am not using the offical OpenWRT, but a fork of it for the NanoPi R4S router, which is called FriendlyWRT. Perhaps this build doesn't include some kernel modules.
But I have a few more suggestions:
Print command descriptions to make error output easier to debug
Currently the script outputs errors in this way:
root@FriendlyWrt:~/cake-qos-simple# /etc/init.d/cake-qos-simple start
Error: Exclusivity flag on, cannot modify.
RTNETLINK answers: File exists
Error: TC classifier not found.
We have an error talking to the kernel
Error: Exclusivity flag on, cannot modify.
Error: Exclusivity flag on, cannot modify.
It's very hard to understand which command these errors come from and what they mean.
Instead I would suggest output like this:
root@FriendlyWrt:~/cake-qos-simple# /etc/init.d/cake-qos-simple start
Adding qdisc for device eth0...
Error: Exclusivity flag on, cannot modify.
Creating ifb download interface ifb-eth0...
RTNETLINK answers: File exists
Bringing ifb download interface ifb-eth0 up...
Adding filter to restore upload DSCP onto download flows...
Error: TC classifier not found.
We have an error talking to the kernel
Setting up cake for the upload interface eth0 with rate 10Mbit...
Error: Exclusivity flag on, cannot modify.
Setting up cake for the download interface ifb-eth0 with rate 10Mbit...
Error: Exclusivity flag on, cannot modify.
Here is a patch for the echos I added that I found helpful:
diff --git a/cake-qos-simple b/cake-qos-simple
index f66332d..6fa59a2 100644
--- a/cake-qos-simple
+++ b/cake-qos-simple
@@ -45,25 +45,36 @@ EXTRA_HELP="
start()
{
+ echo -e "Adding qdisc for device ${ul_if}..."
tc qdisc add dev ${ul_if} handle ffff: ingress
# If no $dl_if specified, then create appropriate IFB and redirect ingress on $ul_if thereto
if [[ -z ${dl_if} ]]; then
dl_if=ifb-${ul_if}
+
+ echo -e "\nCreating ifb download interface ${dl_if}..."
ip link add name ${dl_if} type ifb
+
+ echo -e "\nBringing ifb download interface ${dl_if} up..."
ip link set ${dl_if} up
+
# For each upload interface ingress packet conditionally restore DSCP from conntrack if available and redirect to IFB
+ echo -e "\nAdding filter to restore upload DSCP onto download flows..."
tc filter add dev ${ul_if} parent ffff: protocol ip matchall action ctinfo dscp 63 128 action mirred egress redirect dev $dl_if
# If $dl_if specified, then skip IFB creation
else
# For each upload interface ingress packet conditionally restore DSCP from conntrack if available
+ echo -e "\nAdding filter to restore upload DSCP onto download flows..."
tc filter add dev ${ul_if} parent ffff: protocol ip matchall action ctinfo dscp 63 128
fi
# These lines set up the cake instances and must be modified for desired operation including cake bandwidths
+ echo -e "\nSetting up cake for the upload interface ${ul_if} with rate ${cake_ul_rate_Mbps}Mbit..."
tc qdisc add dev ${ul_if} root cake bandwidth ${cake_ul_rate_Mbps}Mbit ${cake_ul_options}
+
+ echo -e "\nSetting up cake for the download interface ${dl_if} with rate ${cake_dl_rate_Mbps}Mbit..."
tc qdisc add dev ${dl_if} root cake bandwidth ${cake_dl_rate_Mbps}Mbit ${cake_dl_options}
logger -t cake-qos-simple "Started cake-qos-simple."
@@ -72,12 +83,22 @@ start()
stop()
{
[[ -z ${dl_if} ]] && dl_if=ifb-${ul_if}
+
+ echo -e "\nDeleting ingress qdisc for ${ul_if}..."
tc qdisc del dev ${ul_if} ingress
+
+ echo -e "\nDeleting root qdisc for ${ul_if}..."
tc qdisc del dev ${ul_if} root
- tc qdisc del dev ${dl_if} root
- ip link set ${dl_if} down
- ip link del ${dl_if}
-
+
+ echo -e "\nDeleting root qdisc for ${dl_if}..."
+ tc qdisc del dev ${dl_if} root
+
+ echo -e "\nPutting down interface ${dl_if}..."
+ ip link set ${dl_if} down
+
+ echo -e "\nDeleting interface ${dl_if}..."
+ ip link del ${dl_if}
+
logger -t cake-qos-simple "Stopped cake-qos-simple."
}
Disabling the cake-qos-simple service doesn't seem to work
I set the service to Disabled
in Luci -> Startup, but upon reboot it seemed like the script was started.
I am not sure how the enabled/disabled system is working in OpenWRT and whether the issue is with OpenWRT itself or the init.d script.
But I just wanted to make you aware of the possibility of this.