Hi,
I've been using OpenWRT on the Raspberry Pi 4B for 2.5 years. I've been using SQM since I first started using OpenWRT on the Raspberry Pi.
Up till today, the firmware that I was running was 21.02.1. This weekend I decided to finally upgrade to 22.03.3
I took a backup from the 21.02.1 installation, then I compiled my own image, and then I swapped out the SD cards and uploaded the 21.02.1 backup file onto the new 22.03.3 image.
I configure SQM from Luci. Everything seems to be working in version 22.03.3 - as far as I can tell (and I can get to the Internet) except that when SQM is enabled, shaping doesn't work. My current ISP speed is 900 mbps down and 24 mbps up. The way I set up OpenWRT on the Raspberry Pi 4B is that I use one interface for both WAN and LAN. I had created a VLAN interface (this was done 2.5 years ago) eth0.10 (VLAN 10) and assigned WAN to it. In my setup, LAN is on interface eth0. So, WAN is tagged with VLAN10 and LAN is untagged. I have a Layer 3 switch assisting this setup. The cable modem is plugged into an access switch port that is in VLAN10. The Raspberry Pi 4B is connected to another switch port that is configured as a trunk port with VLAN 10 being tagged over the trunk port and VLAN 150 being untagged (native VLAN). The rest of the ports on the switch are configured either as access ports (in any VLAN other than VLAN10) or as trunk ports (with VLAN10 excluded).
When I configured SQM, I assigned it to interface eth0.10. SQM shaping bandwidth applied to download worked perfectly fine in OpenWRT version 21.02.1 as well as in previous versions. The shaping would limit the download to the amount I would specify (or a little lower). However, when SQM is applied to interface eth0.10 in OpenWRT 22.03.3, shaping no longer works. Regardless of what I set for the download bandwidth, I get the full 900+ Mbps (904, 905, 907, etc.).
I've tried to disable / re-enabled SQM, I tried to remove VLAN interface eth0.10 and then re-create it, I restarted interface WAN assigned to eth0.10. I can't get shaping to work when SQM is applied to interface eth0.10. Just as a troubleshooting step, I used the same shaping policy (800000 kbps down and 24 kbps up) and applied it to interface eth0 (my LAN interface), and the shaping worked. When i tried to run a test from speedtest.com, I got the download speed in the low 20s Mbps. So, it appears that the shaping works when applied to a physical interface but it doesn't work when applied to a VLAN interface (whether it's because it's a subinterface on the physical interface or whether it's because it's set with a VLAN tag on it).
Here's my SQM config:
root@firewall:/etc/config# cat sqm
config queue
option download '800000'
option upload '23000'
option debug_logging '0'
option verbosity '5'
option qdisc 'cake'
option script 'piece_of_cake.qos'
option qdisc_advanced '1'
option squash_dscp '1'
option squash_ingress '1'
option ingress_ecn 'ECN'
option egress_ecn 'NOECN'
option qdisc_really_really_advanced '1'
option iqdisc_opts 'mpu 64'
option eqdisc_opts 'mpu 64'
option linklayer 'ethernet'
option overhead '18'
option enabled '1'
option interface 'eth0.10'
Here's my network config
root@firewall:/etc/config# cat network
config interface 'loopback'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
option device 'lo'
config globals 'globals'
option ula_prefix 'fd73:79f7:33c5::/48'
option packet_steering '1'
config interface 'lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.150.1'
option device 'eth0'
config interface 'MRA'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.220.1'
option device 'eth0.220'
config interface 'ColLab_1'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.240.1'
option device 'eth0.241'
config interface 'VOICE_HOME'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.250.1'
option device 'eth0.250'
config interface 'UniFi_MGMT'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.2.1'
option device 'eth0.2'
config interface 'MIDI'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.255.1'
option device 'eth0.255'
config route
option target '172.18.224.0'
option netmask '255.255.255.0'
option gateway '192.168.150.154'
option interface 'lan'
config route
option interface 'lan'
option target '172.19.224.0/24'
option netmask '255.255.255.0'
option gateway '192.168.150.154'
config route
option interface 'lan'
option target '10.100.100.0'
option netmask '255.255.255.0'
option gateway '192.168.150.154'
config route
option interface 'lan'
option target '10.46.3.0'
option netmask '255.255.255.0'
option gateway '192.168.150.154'
config interface 'UniFi_CFG'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.1.1'
option device 'eth0.1'
config interface 'DATA_HOME'
option proto 'static'
option ipaddr '192.168.200.1'
option netmask '255.255.255.0'
option device 'eth0.200'
config interface 'ColLab_2'
option proto 'static'
option ipaddr '192.168.241.1'
option netmask '255.255.255.0'
option device 'eth0.240'
config interface 'WG'
option proto 'wireguard'
list addresses '10.0.0.1/32'
option listen_port '59575'
config wireguard_WG
option description 'Client'
option route_allowed_ips '1'
option persistent_keepalive '25'
list allowed_ips '10.0.0.2/32'
config route
option interface 'lan'
option target '192.168.234.0'
option netmask '255.255.255.0'
option gateway '192.168.150.254'
config device
option name 'eth0.2'
option type '8021q'
config device
option name 'eth0.1'
option type '8021q'
config device
option type '8021q'
option ifname 'eth0'
option vid '10'
option name 'eth0.10'
config interface 'WAN'
option proto 'dhcp'
option device 'eth0.10'
option hostname '*'
Here's the SQM logs:
root@firewall:/tmp/run/sqm# cat eth0.10.start-sqm.log
start-sqm: Log for interface eth0.10: Sun Mar 12 16:31:30 EDT 2023
Sun Mar 12 16:31:30 EDT 2023: Starting.
Starting SQM script: piece_of_cake.qos on eth0.10, in: 800000 Kbps, out: 23000 Kbps
fn_exists: function candidate name: sqm_start
fn_exists: TYPE_OUTPUT: sqm_start: not found
fn_exists: return value: 1
Using generic sqm_start_default function.
fn_exists: function candidate name: sqm_prepare_script
fn_exists: TYPE_OUTPUT: sqm_prepare_script is a function
fn_exists: return value: 0
sqm_start_default: starting sqm_prepare_script
cmd_wrapper: COMMAND: /sbin/ip link add name SQM_IFB_9306c type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link add name SQM_IFB_9306c type ifb
cmd_wrapper: COMMAND: /sbin/tc qdisc replace dev SQM_IFB_9306c root cake
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc replace dev SQM_IFB_9306c root cake
QDISC cake is useable.
cmd_wrapper: COMMAND: /sbin/ip link set dev SQM_IFB_9306c down
cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev SQM_IFB_9306c down
cmd_wrapper: COMMAND: /sbin/ip link delete SQM_IFB_9306c type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link delete SQM_IFB_9306c type ifb
cmd_wrapper: COMMAND: /sbin/ip link add name SQM_IFB_aa3e6 type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link add name SQM_IFB_aa3e6 type ifb
cmd_wrapper: COMMAND: /sbin/tc qdisc replace dev SQM_IFB_aa3e6 root cake
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc replace dev SQM_IFB_aa3e6 root cake
QDISC cake is useable.
cmd_wrapper: COMMAND: /sbin/ip link set dev SQM_IFB_aa3e6 down
cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev SQM_IFB_aa3e6 down
cmd_wrapper: COMMAND: /sbin/ip link delete SQM_IFB_aa3e6 type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link delete SQM_IFB_aa3e6 type ifb
sqm_start_default: Starting piece_of_cake.qos
ifb associated with interface eth0.10:
Currently no ifb is associated with eth0.10, this is normal during starting of the sqm system.
cmd_wrapper: COMMAND: /sbin/ip link add name ifb4eth0.10 type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link add name ifb4eth0.10 type ifb
fn_exists: function candidate name: egress
fn_exists: TYPE_OUTPUT: egress is a function
fn_exists: return value: 0
egress
cmd_wrapper: tc: invocation silenced by request, FAILURE either expected or acceptable.
cmd_wrapper: COMMAND: /sbin/tc qdisc del dev eth0.10 root
cmd_wrapper: tc: FAILURE (2): /sbin/tc qdisc del dev eth0.10 root
cmd_wrapper: tc: LAST ERROR: RTNETLINK answers: No such file or directory
LLA: default link layer adjustment method for cake is cake
cake link layer adjustments: overhead 18 mpu 0
cmd_wrapper: COMMAND: /sbin/tc qdisc add dev eth0.10 root cake bandwidth 23000kbit overhead 18 mpu 0 besteffort
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc add dev eth0.10 root cake bandwidth 23000kbit overhead 18 mpu 0 besteffort
sqm_start_default: egress shaping activated
cmd_wrapper: COMMAND: /sbin/ip link add name SQM_IFB_6fc4e type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link add name SQM_IFB_6fc4e type ifb
cmd_wrapper: COMMAND: /sbin/tc qdisc replace dev SQM_IFB_6fc4e ingress
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc replace dev SQM_IFB_6fc4e ingress
QDISC ingress is useable.
cmd_wrapper: COMMAND: /sbin/ip link set dev SQM_IFB_6fc4e down
cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev SQM_IFB_6fc4e down
cmd_wrapper: COMMAND: /sbin/ip link delete SQM_IFB_6fc4e type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link delete SQM_IFB_6fc4e type ifb
fn_exists: function candidate name: ingress
fn_exists: TYPE_OUTPUT: ingress is a function
fn_exists: return value: 0
ingress
cmd_wrapper: tc: invocation silenced by request, FAILURE either expected or acceptable.
cmd_wrapper: COMMAND: /sbin/tc qdisc del dev eth0.10 handle ffff: ingress
cmd_wrapper: tc: FAILURE (2): /sbin/tc qdisc del dev eth0.10 handle ffff: ingress
cmd_wrapper: tc: LAST ERROR: RTNETLINK answers: Invalid argument
cmd_wrapper: COMMAND: /sbin/tc qdisc add dev eth0.10 handle ffff: ingress
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc add dev eth0.10 handle ffff: ingress
cmd_wrapper: tc: invocation silenced by request, FAILURE either expected or acceptable.
cmd_wrapper: COMMAND: /sbin/tc qdisc del dev ifb4eth0.10 root
cmd_wrapper: tc: FAILURE (2): /sbin/tc qdisc del dev ifb4eth0.10 root
cmd_wrapper: tc: LAST ERROR: RTNETLINK answers: No such file or directory
LLA: default link layer adjustment method for cake is cake
cake link layer adjustments: overhead 18 mpu 0
cmd_wrapper: COMMAND: /sbin/tc qdisc add dev ifb4eth0.10 root cake bandwidth 800000kbit overhead 18 mpu 0 besteffort wash
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc add dev ifb4eth0.10 root cake bandwidth 800000kbit overhead 18 mpu 0 besteffort wash
cmd_wrapper: COMMAND: /sbin/ip link set dev ifb4eth0.10 up
cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev ifb4eth0.10 up
cmd_wrapper: COMMAND: /sbin/tc filter add dev eth0.10 parent ffff: protocol all prio 10 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb4eth0.10
cmd_wrapper: tc: SUCCESS: /sbin/tc filter add dev eth0.10 parent ffff: protocol all prio 10 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb4eth0.10
sqm_start_default: ingress shaping activated
piece_of_cake.qos was started on eth0.10 successfully
root@firewall:/tmp/run/sqm# cat eth0.10.stop-sqm.log
stop-sqm: Log for interface eth0.10: Sun Mar 12 16:31:30 EDT 2023
Sun Mar 12 16:31:30 EDT 2023: Stopping.
Stopping SQM on eth0.10
ifb associated with interface eth0.10: ifb4eth0.10
cmd_wrapper: COMMAND: /sbin/tc qdisc del dev eth0.10 ingress
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc del dev eth0.10 ingress
cmd_wrapper: COMMAND: /sbin/tc qdisc del dev eth0.10 root
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc del dev eth0.10 root
cmd_wrapper: COMMAND: /sbin/tc qdisc del dev ifb4eth0.10 root
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc del dev ifb4eth0.10 root
/usr/lib/sqm/stop-sqm: ifb4eth0.10 shaper deleted
cmd_wrapper: COMMAND: /sbin/ip link set dev ifb4eth0.10 down
cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev ifb4eth0.10 down
cmd_wrapper: COMMAND: /sbin/ip link delete ifb4eth0.10 type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link delete ifb4eth0.10 type ifb
/usr/lib/sqm/stop-sqm: ifb4eth0.10 interface deleted
root@firewall:/tmp/run/sqm# cat eth0.10.state
ALL_MODULES="sch_cake sch_ingress act_mirred cls_fw cls_flow cls_u32 sch_htb"
AUTOFLOW="0"
CUR_DIRECTION="ingress"
DOWNLINK="800000"
EECN="NOECN"
EGRESS_CAKE_OPTS="besteffort"
ELIMIT=""
EQDISC_OPTS=""
ESHAPER_BURST_DUR_US="1000"
ESHAPER_QUANTUM_DUR_US="1000"
ETARGET=""
IECN="ECN"
IFACE="eth0.10"
IGNORE_DSCP_INGRESS="1"
ILIMIT=""
INGRESS_CAKE_OPTS="besteffort wash"
INSMOD="/sbin/modprobe -q"
IP="ip_wrapper"
IP6TABLES="ip6tables_wrapper"
IP6TABLES_BINARY=""
IPTABLES="iptables_wrapper"
IPTABLES_ARGS="-w 1"
IPTABLES_BINARY="/usr/sbin/iptables-nft"
IPT_MASK="0xff"
IPT_TRANS_LOG="/var/run/sqm/eth0.10.iptables.log"
IP_BINARY="/sbin/ip"
IQDISC_OPTS=""
ISHAPER_BURST_DUR_US="1000"
ISHAPER_QUANTUM_DUR_US="1000"
ITARGET=""
LIMIT="1001"
LINKLAYER="ethernet"
LLAM="default"
OUTPUT_TARGET="/var/run/sqm/eth0.10.start-sqm.log"
OVERHEAD="18"
QDISC="cake"
SCRIPT="piece_of_cake.qos"
SHAPER_BURST_DUR_US="1000"
SHAPER_QUANTUM_DUR_US="1000"
SILENT="0"
SQM_DEBUG="1"
SQM_DEBUG_LOG="/var/run/sqm/eth0.10.start-sqm.log"
SQM_DEBUG_STEM="/var/run/sqm/eth0.10"
SQM_START_LOG="/var/run/sqm/eth0.10.start-sqm.log"
SQM_STOP_LOG="/var/run/sqm/eth0.10.stop-sqm.log"
SQM_VERBOSITY_MAX="10"
SQM_VERBOSITY_MIN="0"
STAB_MPU="0"
STAB_MTU="2047"
STAB_TSIZE="512"
TARGET="5ms"
TC="tc_wrapper"
TC_BINARY="/sbin/tc"
UPLINK="23000"
VERBOSITY_DEBUG="8"
VERBOSITY_ERROR="1"
VERBOSITY_INFO="5"
VERBOSITY_SILENT="0"
VERBOSITY_TRACE="10"
VERBOSITY_WARNING="2"
ZERO_DSCP_INGRESS="1"
I think I've reached the limit of my knowledge with OpenWRT here, so I desperately need help. Thank you!