SQM Qos fail on 23.05.02

Gurus can not get Sqm working on the above version of Openwrt. Start log file shows errors but I'm too thick to understand how to trouble shoot. Would really appreciate a little guidance please. Log file attached.`start-sqm: Log for interface myIOTbridge: Thu Mar 7 07:17:14 GMT 2024

Thu Mar  7 07:17:14 GMT 2024: Starting.
Starting SQM script: piece_of_cake.qos on myIOTbridge, in: 50000 Kbps, out: 6000 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_0cacc type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link add name SQM_IFB_0cacc type ifb
cmd_wrapper: COMMAND: /sbin/tc qdisc replace dev SQM_IFB_0cacc root cake
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc replace dev SQM_IFB_0cacc root cake
QDISC cake is useable.
cmd_wrapper: COMMAND: /sbin/ip link set dev SQM_IFB_0cacc down
cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev SQM_IFB_0cacc down
cmd_wrapper: COMMAND: /sbin/ip link delete SQM_IFB_0cacc type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link delete SQM_IFB_0cacc type ifb
cmd_wrapper: COMMAND: /sbin/ip link add name SQM_IFB_98271 type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link add name SQM_IFB_98271 type ifb
cmd_wrapper: COMMAND: /sbin/tc qdisc replace dev SQM_IFB_98271 root cake
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc replace dev SQM_IFB_98271 root cake
QDISC cake is useable.
cmd_wrapper: COMMAND: /sbin/ip link set dev SQM_IFB_98271 down
cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev SQM_IFB_98271 down
cmd_wrapper: COMMAND: /sbin/ip link delete SQM_IFB_98271 type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link delete SQM_IFB_98271 type ifb
sqm_start_default: Starting piece_of_cake.qos
ifb associated with interface myIOTbridge: 
Currently no ifb is associated with myIOTbridge, this is normal during starting of the sqm system.
cmd_wrapper: COMMAND: /sbin/ip link add name ifb4myIOTbridge type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link add name ifb4myIOTbridge 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 myIOTbridge root
cmd_wrapper: tc: FAILURE (2): /sbin/tc qdisc del dev myIOTbridge root
cmd_wrapper: tc: LAST ERROR: Error: Cannot delete qdisc with handle of zero.
LLA: default link layer adjustment method for cake is cake
cmd_wrapper: COMMAND: /sbin/tc qdisc add dev myIOTbridge root cake bandwidth 6000kbit besteffort
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc add dev myIOTbridge root cake bandwidth 6000kbit besteffort
sqm_start_default: egress shaping activated
cmd_wrapper: COMMAND: /sbin/ip link add name SQM_IFB_47183 type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link add name SQM_IFB_47183 type ifb
cmd_wrapper: COMMAND: /sbin/tc qdisc replace dev SQM_IFB_47183 ingress
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc replace dev SQM_IFB_47183 ingress
QDISC ingress is useable.
cmd_wrapper: COMMAND: /sbin/ip link set dev SQM_IFB_47183 down
cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev SQM_IFB_47183 down
cmd_wrapper: COMMAND: /sbin/ip link delete SQM_IFB_47183 type ifb
cmd_wrapper: ip: SUCCESS: /sbin/ip link delete SQM_IFB_47183 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 myIOTbridge handle ffff: ingress
cmd_wrapper: tc: FAILURE (2): /sbin/tc qdisc del dev myIOTbridge handle ffff: ingress
cmd_wrapper: tc: LAST ERROR: Error: Cannot find specified qdisc on specified device.
cmd_wrapper: COMMAND: /sbin/tc qdisc add dev myIOTbridge handle ffff: ingress
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc add dev myIOTbridge handle ffff: ingress
cmd_wrapper: tc: invocation silenced by request, FAILURE either expected or acceptable.
cmd_wrapper: COMMAND: /sbin/tc qdisc del dev ifb4myIOTbridge root
cmd_wrapper: tc: FAILURE (2): /sbin/tc qdisc del dev ifb4myIOTbridge root
cmd_wrapper: tc: LAST ERROR: Error: Cannot delete qdisc with handle of zero.
LLA: default link layer adjustment method for cake is cake
cmd_wrapper: COMMAND: /sbin/tc qdisc add dev ifb4myIOTbridge root cake bandwidth 50000kbit besteffort wash
cmd_wrapper: tc: SUCCESS: /sbin/tc qdisc add dev ifb4myIOTbridge root cake bandwidth 50000kbit besteffort wash
cmd_wrapper: COMMAND: /sbin/ip link set dev ifb4myIOTbridge up
cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev ifb4myIOTbridge up
cmd_wrapper: COMMAND: /sbin/tc filter add dev myIOTbridge parent ffff: protocol all prio 10 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb4myIOTbridge
cmd_wrapper: tc: SUCCESS: /sbin/tc filter add dev myIOTbridge parent ffff: protocol all prio 10 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb4myIOTbridge
sqm_start_default: ingress shaping activated
piece_of_cake.qos was started on myIOTbridge successfully
`

Please post the output of:

  1. cat /etc/config/sqm
  2. tc -s qdisc
  3. a screenshot of a speedtest
    https://speed.cloudflare.com
    from a device inside the shaped network segment.
config queue
	option enabled '1'
	option interface 'myIOTbridge'
	option download '50000'
	option upload '6000'
	option debug_logging '1'
	option verbosity '8'
	option qdisc 'cake'
	option script 'piece_of_cake.qos'
	option linklayer 'none'



BusyBox v1.36.1 (2023-11-14 13:38:11 UTC)
built-in shell (ash)
  _______                     ________
    __
 |       |.-----.-----.-----.|  |  |  |.--
--.|  |_
 |   -   ||  _  |  -__|     ||  |  |  || _||   _|
 |_______||   __|_____|__|__||________||__
|  |____|
          |__| W I R E L E S S   F R E E D
 O M
 -----------------------------------------
------------
 OpenWrt 23.05.2, r23630-842932a63d
 -----------------------------------------
------------
root@NH:~# tc -s qdisc
qdisc noqueue 0: dev lo root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc mq 0: dev eth0 root
 Sent 70458624 bytes 101591 pkt (dropped 0, overlimits 0 requeues 5)
 backlog 0b 0p requeues 5
qdisc fq_codel 0: dev eth0 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 70458624 bytes 101591 pkt (dropped 0, overlimits 0 requeues 5)
 backlog 0b 0p requeues 5
  maxpacket 1514 drop_overlimit 0 new_flow_count 12 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc mq 0: dev eth1 root
 Sent 16871964 bytes 697653 pkt (dropped 0, overlimits 0 requeues 6)
 backlog 0b 0p requeues 6
qdisc fq_codel 0: dev eth1 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 16871964 bytes 697653 pkt (dropped 0, overlimits 0 requeues 6)
 backlog 0b 0p requeues 6
  maxpacket 1514 drop_overlimit 0 new_flow_count 13 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc cake 8009: dev myIOTbridge root refcnt 2 bandwidth 6Mbit besteffort triple-isolate nonat nowash no-ack-filter split-gso rtt 100ms raw overhead 0
 Sent 24182744 bytes 41952 pkt (dropped
1961, overlimits 36633 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 888704b of 4Mb
 capacity estimate: 6Mbit
 min/max network layer size:           42 /    1514
 min/max overhead-adjusted size:       42 /    1514
 average network hdr offset:           14
                  Tin 0
  thresh          6Mbit
  target            5ms
  interval        100ms
  pk_delay       5.12ms
  av_delay        364us
  sp_delay         23us
  backlog            0b
  pkts            43913
  bytes        27140700
  way_inds           11
  way_miss          527
  way_cols            0
  drops            1961
  marks               0
  ack_drop            0
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len         13113
  quantum           300
qdisc ingress ffff: dev myIOTbridge parent ffff:fff1 ----------------
 Sent 61633943 bytes 62888 pkt (dropped
0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth1.4 root refcnt
2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev mybridge root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth1.3 root refcnt
2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.2 root refcnt
2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev phy1-ap0 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev phy0-ap0 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev phy0-ap1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 800a: dev ifb4myIOTbridge root refcnt 2 bandwidth 50Mbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100ms raw overhead 0
 Sent 63564945 bytes 62885 pkt (dropped
3, overlimits 40168 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 306042b of 4Mb
 capacity estimate: 50Mbit
 min/max network layer size:           20 /    1514
 min/max overhead-adjusted size:       20 /    1514
 average network hdr offset:           14
                  Tin 0
  thresh         50Mbit
  target            5ms
  interval        100ms
  pk_delay        641us
  av_delay        142us
  sp_delay          3us
  backlog            0b
  pkts            62888
  bytes        63569307
  way_inds          286
  way_miss          629
  way_cols            0
  drops               3
  marks               0
  ack_drop            0
  sp_flows            2
  bk_flows            1
  un_flows            0
  max_len         13947
  quantum          1514



![Screenshot_2024-03-07-08-59-16-91_3aea4af51f236e4932235fdada7d1643|223x499](upload://jaHASKQUk2tJJo7DLmL14i1iXxO.jpeg)

1 Like

Sorry first paste seemed to disappear

config queue
option enabled '1'
option interface 'myIOTbridge'
option download '50000'
option upload '6000'
option debug_logging '1'
option verbosity '8'
option qdisc 'cake'
option script 'piece_of_cake.qos'
option linklayer 'none'

It's so erratic

So the tc -s qdisc output seems to imply that everything as you configured it.
Question, your myIOTbridge interface, is that a LAN-facing port? If yes you would need to put the desired internet download capacity into
option upload '6000'
and the internet upload capacity into
option download '50000'

as internally SQM does not know about the internet, only about an interfaces ingress and egress direction... when creating the GUI the options were, either to explain to each and every user how interface ingress/egress relate to internet download/upload, or use verbiage that works as intuitively expected by most users for the default configuration with SQM on the WAN interface. We opted for the latter...

The speedtests look rather odd, though:
the first looks like it might be from within myIOTbridge, and shows the expected inversion of the meaning of upload and download
But the second does not fit that pattern, are you sure the phone was logged into the correct SSID?

Thank you so much. The inversion although a little counterintuitive to the lay person like me, although I do understand the logic now seems to be working. Yes I was logged into the correct SSID. I will test a bit more over next few days then hopefully mark up as solved...

OK so it seems not as "fixed" as I'd hoped.
You asked "Question, your myIOTbridge interface, is that a LAN-facing port ?" The myIOTbridge interface (which is bridging a wired vlan & a wlan) still seems to be working ok but I have a second interface "mybridge" & again bridging another wired vlan & wlan is not applying the sqm settings even though I have inverted the upload & download once again :frowning:

If possible could you see if I am missing anything in my config

config queue
option enabled '1'
option interface 'myIOTbridge'
option download '6000'
option upload '50000'
option debug_logging '0'
option verbosity '5'
option qdisc 'cake'
option script 'piece_of_cake.qos'
option linklayer 'none'

config queue
option enabled '1'
option interface 'mybridge'
option download '9000'
option upload '200000'
option debug_logging '1'
option verbosity '5'
option qdisc 'cake'
option script 'piece_of_cake.qos'
option linklayer 'none'


tc -s qdisc

qdisc noqueue 0: dev lo root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc mq 0: dev eth0 root
Sent 796058872 bytes 4547635 pkt (dropped 0, overlimits 0 requeues 8)
backlog 0b 0p requeues 8
qdisc fq_codel 0: dev eth0 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
Sent 796058872 bytes 4547635 pkt (dropped 0, overlimits 0 requeues 8)
backlog 0b 0p requeues 8
maxpacket 1514 drop_overlimit 0 new_flow_count 14 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc mq 0: dev eth1 root
Sent 6926384662 bytes 8554960 pkt (dropped 0, overlimits 0 requeues 7)
backlog 0b 0p requeues 7
qdisc fq_codel 0: dev eth1 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
Sent 6926384662 bytes 8554960 pkt (dropped 0, overlimits 0 requeues 7)
backlog 0b 0p requeues 7
maxpacket 1514 drop_overlimit 0 new_flow_count 16 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc cake 8025: dev myIOTbridge root refcnt 2 bandwidth 50Mbit besteffort triple-isolate nonat nowash no-ack-filter split-gso rtt 100ms raw overhead 0
Sent 1234226737 bytes 823649 pkt (dropped 5152, overlimits 682385 requeues 0)
backlog 165026b 109p requeues 0
memory used: 589056b of 4Mb
capacity estimate: 50Mbit
min/max network layer size: 42 / 1514
min/max overhead-adjusted size: 42 / 1514
average network hdr offset: 14

              Tin 0

thresh 50Mbit
target 5ms
interval 100ms
pk_delay 31.1ms
av_delay 27.6ms
sp_delay 24.5ms
backlog 165026b
pkts 828910
bytes 1242176631
way_inds 0
way_miss 521
way_cols 0
drops 5152
marks 0
ack_drop 0
sp_flows 1
bk_flows 1
un_flows 0
max_len 19682
quantum 1514

qdisc ingress ffff: dev myIOTbridge parent ffff:fff1 ----------------
Sent 49647139 bytes 701970 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth1.4 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc cake 8029: dev mybridge root refcnt 2 bandwidth 200Mbit besteffort triple-isolate nonat nowash no-ack-filter split-gso rtt 100ms raw overhead 0
Sent 559192134 bytes 416101 pkt (dropped 0, overlimits 53481 requeues 0)
backlog 0b 0p requeues 0
memory used: 132160b of 10000000b
capacity estimate: 200Mbit
min/max network layer size: 42 / 1514
min/max overhead-adjusted size: 42 / 1514
average network hdr offset: 14

              Tin 0

thresh 200Mbit
target 5ms
interval 100ms
pk_delay 78us
av_delay 28us
sp_delay 3us
backlog 0b
pkts 416101
bytes 559192134
way_inds 601
way_miss 760
way_cols 0
drops 0
marks 0
ack_drop 0
sp_flows 4
bk_flows 1
un_flows 0
max_len 67962
quantum 1514

qdisc ingress ffff: dev mybridge parent ffff:fff1 ----------------
Sent 53867505 bytes 102860 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth1.3 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.2 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev phy1-ap0 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev phy0-ap0 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev phy0-ap1 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc cake 8026: dev ifb4myIOTbridge root refcnt 2 bandwidth 6Mbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100ms raw overhead 0
Sent 59480367 bytes 701953 pkt (dropped 17, overlimits 772351 requeues 0)
backlog 0b 0p requeues 0
memory used: 53408b of 4Mb
capacity estimate: 6Mbit
min/max network layer size: 20 / 1514
min/max overhead-adjusted size: 20 / 1514
average network hdr offset: 14

              Tin 0

thresh 6Mbit
target 5ms
interval 100ms
pk_delay 1.15ms
av_delay 466us
sp_delay 74us
backlog 0b
pkts 701970
bytes 59497219
way_inds 189
way_miss 628
way_cols 0
drops 17
marks 0
ack_drop 0
sp_flows 1
bk_flows 1
un_flows 0
max_len 10719
quantum 300

qdisc cake 802a: dev ifb4mybridge root refcnt 2 bandwidth 9Mbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100ms raw overhead 0
Sent 56311281 bytes 102756 pkt (dropped 104, overlimits 78385 requeues 0)
backlog 0b 0p requeues 0
memory used: 78720b of 4Mb
capacity estimate: 9Mbit
min/max network layer size: 38 / 1514
min/max overhead-adjusted size: 38 / 1514
average network hdr offset: 14

              Tin 0

thresh 9Mbit
target 5ms
interval 100ms
pk_delay 1.73ms
av_delay 135us
sp_delay 6us
backlog 0b
pkts 102860
bytes 56455005
way_inds 413
way_miss 799
way_cols 0
drops 104
marks 0
ack_drop 0
sp_flows 3
bk_flows 1
un_flows 0
max_len 11632
quantum 300

What kind of internet do you have?
cable, adsl, fiber?

What speed are you paying for?

Cable 350Mb

Then you have almost nothing set up right. Maybe 'Queue Discipline' is right but ingress and egress don't look like they were calculated and tweaked in any way.

Read all of this, do the math and set upload, download etc per instructions.

It just looks scary but you can navigate it.

Use Speedtest net because you can set it to Kb/s to make the math easier.

Thanks for that. Followed those instructions but still something not quite right. Deleted the two instances notably myIOTbridge & mybridge as mentioned above and started from scratch only tyrying to shape the wan as suggested. An unloaded speed test before any configuration showed my ISP speed to be 250Mb so 90% = 225Mb but setting that as my Download speed (ingress) still limited the bufferbloat results to only 120Mb down. The upload (egress) is shaping perfectly though...

Respectfully, how can you assess that without knowing the OP's goals?

What router make and model do you use?

I am using the Virginmedia Superhub3 in modem mode which connects to the Wan of my Netgear R7800

Because these numbers (option download '6000'
option upload '50000') do not work with 250Mb tested nor 350Mb purchased.

But LuCI asks for kbit/s. So what did you use for ingress?

Well, the initial goal seems to have been to restrict some IOT devices, so having this shaper well below the wan limit is IMHO a rather rational and useful configuration, no?

Correct that was the intention