Coder Social home page Coder Social logo

Comments (41)

rchac avatar rchac commented on May 28, 2024 3

@interduo Started working on it this morning. Here's a rough alpha version of 1.2 with support for multiple devices/IPs per subscriber circuit. https://github.com/rchac/LibreQoS/tree/main/v1.2

I had to change from assuming a single device to assuming "circuits" which can have multiple devices and fall within one queue.

If an entry in ShapedDevices.csv has the same Circuit ID as another before it, it will be added to that circuit.

from libreqos.

interduo avatar interduo commented on May 28, 2024 1

@rchac do You know when will You code that?

I am asking about this because I would like to test LQoS in real envirnoment and this is the only thing whitch is blocking me from that.

I feel like 'Curious George' only having LibreQoS on my VM ;)

from libreqos.

interduo avatar interduo commented on May 28, 2024 1

Yes I noticed that. Now we are going further...

from libreqos.

rchac avatar rchac commented on May 28, 2024

So I'm thinking of adding a "HostGroupID" field to Shaper.csv. If a client has two IPs for the same client/service location, each could be defined with the same HostGroup ID # and be placed into the same queue/qdisc. Entries without any HostGroup ID # would be individually handled. Would that work for your use case?

from libreqos.

interduo avatar interduo commented on May 28, 2024

Yes - that is it.
My little suggestion is only to name this as "CustomerServiceID" (many Devices/CRMs use HostGroupID for different thing)

from libreqos.

interduo avatar interduo commented on May 28, 2024

The minor thing is also to have statistics per CustomerServiceID/HostGroupID.
But this is done because we do statistics based on tc class show info.

from libreqos.

interduo avatar interduo commented on May 28, 2024

Proposition of implementation:
Check if row contains CustomerServiceID (first test) and then check if CustomerServiceID was set in Shaper.json (second test) in earlier rows (https://github.com/rchac/LibreQoS/blob/main/v1.1/LibreQoS.py#L177 - bellow this line is good place for that)

  • if its the first occurance of CustomerServiceID (second test is false), save it into some variable of type array(CustomerServiceID, major, minior) for future use,
  • if its the next usage (second test if true) get the minor and major number from array and create variable nextUsage = 1,

Then bellow:

This idea for implementation seems to be simple.

@rchac what do You think about it? I use PHP not python, could You help in implementing that?

from libreqos.

interduo avatar interduo commented on May 28, 2024

The last thing for that: for statistics we need to have unique, constant ID, If I change the order of rows/or delete some rows/add CircuitID does it matter for others rows?

We would like to ommit the situation that we presenting not the right customer graph.

from libreqos.

rchac avatar rchac commented on May 28, 2024

from libreqos.

interduo avatar interduo commented on May 28, 2024

If some customer got two ip's and in Shaper.json got some mistake (different speeds per class). Do LibreQoS rise an error or just use first definition for Circuit?

from libreqos.

rchac avatar rchac commented on May 28, 2024

It will use the first bandwidth download/upload definition it sees for that circuit. If it would help, we can make it check for different rates and raise an error if they are different.

from libreqos.

interduo avatar interduo commented on May 28, 2024

Warning it would be better than error (Error - stops the program, Warnings - just prints info).

from libreqos.

rchac avatar rchac commented on May 28, 2024

Done. a3ce20b

from libreqos.

interduo avatar interduo commented on May 28, 2024

testing and got an error:

root@rty-libreqos:~/LibreQoS2/v1.2# python3 LibreQoS.py
  File "/root/LibreQoS2/v1.2/LibreQoS.py", line 88
    "devices" = deviceListForCircuit
            ^
SyntaxError: ':' expected after dictionary key

root@rty-libreqos:~/LibreQoS2/v1.2# cat ShapedDevices.csv

Circuit ID,Circuit Name,Device ID,Device Name,Parent Node,MAC,IPv4,IPv6,Download Min,Upload Min,Download Max,Upload Max
,"CID100",1,"NODEID567",AP_A,,100.64.0.2,,25,5,105,18
2000,"CID1456",2,"NODEID2345",AP_A,,100.64.0.3,,25,5,105,18
2000,"CID1456",3,"NODEID3456",AP_A,,100.64.0.4,,25,5,105,18

from libreqos.

rchac avatar rchac commented on May 28, 2024

Sorry about that. Corrected.

from libreqos.

interduo avatar interduo commented on May 28, 2024

More is here:

root@rty-libreqos:~/LibreQoS2/v1.2# python3 LibreQoS.py
  File "/root/LibreQoS2/v1.2/LibreQoS.py", line 92
    "downloadMin": round(int(downloadMin)*tcpOverheadFactor),
    ^^^^^^^^^^^^^
SyntaxError: invalid syntax

No comma at the end of previous line and in the 118 line. This line also needs a change = to :

from libreqos.

interduo avatar interduo commented on May 28, 2024
root/LibreQoS2/v1.2/./LibreQoS.py:59: UserWarning: Device NODEID3456 with ID 3 had different bandwidth parameters than other devices on this circuit. Will instead use the bandwidth parameters defined by the first device added to its circuit.
  warnings.warn("Device " + deviceName + " with ID " + deviceID + " had different bandwidth parameters than other devices on this circuit. Will instead use the bandwidth parameters defined by the first device added to its circuit.")
Traceback (most recent call last):
  File "/root/LibreQoS2/v1.2/./LibreQoS.py", line 299, in <module>
    refreshShapers()
  File "/root/LibreQoS2/v1.2/./LibreQoS.py", line 128, in refreshShapers
    network = json.loads(j.read())
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 70 (char 71)

here the warning goes to some variable

# python3 LibreQoS.py
Traceback (most recent call last):
  File "/root/LibreQoS2/v1.2/LibreQoS.py", line 301, in <module>
    refreshShapers()
  File "/root/LibreQoS2/v1.2/LibreQoS.py", line 51, in refreshShapers
    circuitID, circuitName, deviceID, deviceName, ParentNode, mac, ipv4, ipv6, downloadMin, uploadMin, downloadMax, uploadMax = row
ValueError: not enough values to unpack (expected 12, got 11)

Here we don't know where the mistake is because we dont know the line number. The line number should be printed.

from libreqos.

rchac avatar rchac commented on May 28, 2024

Tested more. I think the check for bandwidth mismatch is now working with latest change.

For the first error, are we sure your Network.json is free of JSON syntax errors? It suggests at line 2 column 70 (char 71) of network.json could be the location of the error.

For the second error, does your ShapedDevices.csv have the correct columns? It looks to be missing one.

from libreqos.

interduo avatar interduo commented on May 28, 2024

network.json

{
	"AP_A": { "downloadBandwidthMbps":4000,	"uploadBandwidthMbps":4000, },
	"AP_B": { "downloadBandwidthMbps":4000,	"uploadBandwidthMbps":4000, },
	"AP_C": { "downloadBandwidthMbps":4000,	"uploadBandwidthMbps":4000, },
	"AP_D": { "downloadBandwidthMbps":4000,	"uploadBandwidthMbps":4000, }
}

ShapedDevices.csv

Circuit ID,"Circuit Name",Device ID,"Device Name",Parent Node,MAC,IPv4,IPv6,Download Min,Upload Min,Download Max,Upload Max
,"CID100",1,"NODEID567",AP_A,,100.64.0.2,,25,5,105,18
2000,"CID1456",2,"NODEID2345",AP_A,,100.64.0.3,,25,5,105,18
2000,"CID1456",3,"NODEID3456",AP_A,,100.64.0.4,,25,5,105,18

from libreqos.

rchac avatar rchac commented on May 28, 2024

Network.json should be:

{
	"AP_A": { "downloadBandwidthMbps":4000,	"uploadBandwidthMbps":4000},
	"AP_B": { "downloadBandwidthMbps":4000,	"uploadBandwidthMbps":4000},
	"AP_C": { "downloadBandwidthMbps":4000,	"uploadBandwidthMbps":4000},
	"AP_D": { "downloadBandwidthMbps":4000,	"uploadBandwidthMbps":4000}
}

(note the last comma after "uploadBandwidthMbps":4000 is removed for each AP)

from libreqos.

interduo avatar interduo commented on May 28, 2024

Doesn't help that.

from libreqos.

interduo avatar interduo commented on May 28, 2024

Some more errors LibreQoS.py gives me at first run.

root@rty-libreqos:~/LibreQoS2/v1.2# python3 ./LibreQoS.py

tc filter delete dev ens16f0
Error: Class doesn't support blocks.
We have an error talking to the kernel
tc filter delete dev ens16f0 root
Error: Parent Qdisc doesn't exists.
We have an error talking to the kernel
tc qdisc delete dev ens16f0 root
Error: Cannot delete qdisc with handle of zero.
tc qdisc delete dev ens16f0
Error: Failed to find qdisc with specified handle.
tc filter delete dev ens16f1
Error: Class doesn't support blocks.
We have an error talking to the kernel
tc filter delete dev ens16f1 root
Error: Parent Qdisc doesn't exists.
We have an error talking to the kernel
tc qdisc delete dev ens16f1 root
Error: Cannot delete qdisc with handle of zero.
tc qdisc delete dev ens16f1
Error: Failed to find qdisc with specified handle.
NIC queues:	20
CPU cores:	20
./xdp-cpumap-tc/bin/xps_setup.sh -d ens16f0 --default --disable
./xdp-cpumap-tc/bin/xps_setup.sh -d ens16f1 --default --disable
./xdp-cpumap-tc/src/xdp_iphash_to_cpu --dev ens16f0 --lan
libbpf: Error loading BTF: Invalid argument(22)
libbpf: magic: 0xeb9f
version: 1
flags: 0x0
hdr_len: 24
type_off: 0
type_len: 504
str_off: 504
str_len: 1726
btf_total_size: 2254
[1] PTR (anon) type_id=2
[2] STRUCT xdp_md size=24 vlen=6
	data type_id=3 bits_offset=0
	data_end type_id=3 bits_offset=32
	data_meta type_id=3 bits_offset=64
	ingress_ifindex type_id=3 bits_offset=96
	rx_queue_index type_id=3 bits_offset=128
	egress_ifindex type_id=3 bits_offset=160
[3] TYPEDEF __u32 type_id=4
[4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none)
[5] FUNC_PROTO (anon) return=6 args=(1 ctx)
[6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
[7] FUNC xdp_program type_id=5
[8] STRUCT bpf_map_def size=24 vlen=6
	type type_id=4 bits_offset=0
	key_size type_id=4 bits_offset=32
	value_size type_id=4 bits_offset=64
	max_entries type_id=4 bits_offset=96
	map_flags type_id=4 bits_offset=128
	inner_map_idx type_id=4 bits_offset=160
[9] VAR map_ip_hash type_id=8 linkage=1
[10] VAR map_txq_config type_id=8 linkage=1
[11] VAR map_ifindex_type type_id=8 linkage=1
[12] VAR cpu_map type_id=8 linkage=1
[13] VAR cpus_available type_id=8 linkage=1
[14] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED
[15] ARRAY (anon) type_id=14 index_type_id=16 nr_elems=4
[16] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none)
[17] VAR _license type_id=15 linkage=1
[18] DATASEC license size=0 vlen=1 size == 0

libbpf: Error loading ELF section .BTF: -22. Ignored and continue.
Added CPU:0 queue_size:2048

Added CPU:1 queue_size:2048

Added CPU:2 queue_size:2048

Added CPU:3 queue_size:2048

Added CPU:4 queue_size:2048

Added CPU:5 queue_size:2048

Added CPU:6 queue_size:2048

Added CPU:7 queue_size:2048

Added CPU:8 queue_size:2048

Added CPU:9 queue_size:2048

Added CPU:10 queue_size:2048

Added CPU:11 queue_size:2048

Added CPU:12 queue_size:2048

Added CPU:13 queue_size:2048

Added CPU:14 queue_size:2048

Added CPU:15 queue_size:2048

Added CPU:16 queue_size:2048

Added CPU:17 queue_size:2048

Added CPU:18 queue_size:2048

Added CPU:19 queue_size:2048

Documentation:

 XDP: Lookup IPv4 and redirect to CPU hash



This program loads the XDP eBPF program into the kernel.

Use the cmdline tool for add/removing dest IPs to the hash



 - Attached to device:ens16f0 (ifindex:3) prog_id:22

./xdp-cpumap-tc/src/xdp_iphash_to_cpu --dev ens16f1 --wan
libbpf: Error loading BTF: Invalid argument(22)
libbpf: magic: 0xeb9f
version: 1
flags: 0x0
hdr_len: 24
type_off: 0
type_len: 504
str_off: 504
str_len: 1726
btf_total_size: 2254
[1] PTR (anon) type_id=2
[2] STRUCT xdp_md size=24 vlen=6
	data type_id=3 bits_offset=0
	data_end type_id=3 bits_offset=32
	data_meta type_id=3 bits_offset=64
	ingress_ifindex type_id=3 bits_offset=96
	rx_queue_index type_id=3 bits_offset=128
	egress_ifindex type_id=3 bits_offset=160
[3] TYPEDEF __u32 type_id=4
[4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none)
[5] FUNC_PROTO (anon) return=6 args=(1 ctx)
[6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
[7] FUNC xdp_program type_id=5
[8] STRUCT bpf_map_def size=24 vlen=6
	type type_id=4 bits_offset=0
	key_size type_id=4 bits_offset=32
	value_size type_id=4 bits_offset=64
	max_entries type_id=4 bits_offset=96
	map_flags type_id=4 bits_offset=128
	inner_map_idx type_id=4 bits_offset=160
[9] VAR map_ip_hash type_id=8 linkage=1
[10] VAR map_txq_config type_id=8 linkage=1
[11] VAR map_ifindex_type type_id=8 linkage=1
[12] VAR cpu_map type_id=8 linkage=1
[13] VAR cpus_available type_id=8 linkage=1
[14] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED
[15] ARRAY (anon) type_id=14 index_type_id=16 nr_elems=4
[16] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none)
[17] VAR _license type_id=15 linkage=1
[18] DATASEC license size=0 vlen=1 size == 0

libbpf: Error loading ELF section .BTF: -22. Ignored and continue.
TC workaround for mapname: map_ifindex_type map_fd:7

Added CPU:0 queue_size:2048

Added CPU:1 queue_size:2048

Added CPU:2 queue_size:2048

Added CPU:3 queue_size:2048

Added CPU:4 queue_size:2048

Added CPU:5 queue_size:2048

Added CPU:6 queue_size:2048

Added CPU:7 queue_size:2048

Added CPU:8 queue_size:2048

Added CPU:9 queue_size:2048

Added CPU:10 queue_size:2048

Added CPU:11 queue_size:2048

Added CPU:12 queue_size:2048

Added CPU:13 queue_size:2048

Added CPU:14 queue_size:2048

Added CPU:15 queue_size:2048

Added CPU:16 queue_size:2048

Added CPU:17 queue_size:2048

Added CPU:18 queue_size:2048

Added CPU:19 queue_size:2048

Documentation:

 XDP: Lookup IPv4 and redirect to CPU hash



This program loads the XDP eBPF program into the kernel.

Use the cmdline tool for add/removing dest IPs to the hash



 - Attached to device:ens16f1 (ifindex:4) prog_id:25

./xdp-cpumap-tc/src/xdp_iphash_to_cpu_cmdline --clear
./xdp-cpumap-tc/src/tc_classify --dev-egress ens16f0
TC: Control program for tc_classify_kern.o

 - When using --dev, loads TC-egress filter calling BPF program

 - Config of map_txq_config, that control CPU to queue_mapping

 - List current queue_mapping (txq) config via --list



 Map filename: /sys/fs/bpf/tc/globals/map_txq_config

Dev:ens16f0 -- Loading: TC-clsact egress

 - Run: tc qdisc del dev ens16f0 clsact 2> /dev/null

 - (First time loading clsact?)

 - Run: tc qdisc add dev ens16f0 clsact

 - Run: tc filter add dev ens16f0 egress prio 1 handle 1 bpf da obj ./xdp-cpumap-tc/src/tc_classify_kern.o sec tc_classify

./xdp-cpumap-tc/src/tc_classify --dev-egress ens16f1
TC: Control program for tc_classify_kern.o

 - When using --dev, loads TC-egress filter calling BPF program

 - Config of map_txq_config, that control CPU to queue_mapping

 - List current queue_mapping (txq) config via --list



 Map filename: /sys/fs/bpf/tc/globals/map_txq_config

Dev:ens16f1 -- Loading: TC-clsact egress

 - Run: tc qdisc del dev ens16f1 clsact 2> /dev/null

 - (First time loading clsact?)

 - Run: tc qdisc add dev ens16f1 clsact

 - Run: tc filter add dev ens16f1 egress prio 1 handle 1 bpf da obj ./xdp-cpumap-tc/src/tc_classify_kern.o sec tc_classify

tc qdisc replace dev ens16f0 root handle 7FFF: mq
tc qdisc add dev ens16f0 parent 7FFF:0x1 handle 0x1: htb default 2
tc class add dev ens16f0 parent 0x1: classid 0x1:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x1:1 cake diffserv4
tc class add dev ens16f0 parent 0x1:1 classid 0x1:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x1:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x2 handle 0x2: htb default 2
tc class add dev ens16f0 parent 0x2: classid 0x2:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x2:1 cake diffserv4
tc class add dev ens16f0 parent 0x2:1 classid 0x2:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x2:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x3 handle 0x3: htb default 2
tc class add dev ens16f0 parent 0x3: classid 0x3:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x3:1 cake diffserv4
tc class add dev ens16f0 parent 0x3:1 classid 0x3:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x3:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x4 handle 0x4: htb default 2
tc class add dev ens16f0 parent 0x4: classid 0x4:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x4:1 cake diffserv4
tc class add dev ens16f0 parent 0x4:1 classid 0x4:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x4:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x5 handle 0x5: htb default 2
tc class add dev ens16f0 parent 0x5: classid 0x5:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x5:1 cake diffserv4
tc class add dev ens16f0 parent 0x5:1 classid 0x5:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x5:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x6 handle 0x6: htb default 2
tc class add dev ens16f0 parent 0x6: classid 0x6:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x6:1 cake diffserv4
tc class add dev ens16f0 parent 0x6:1 classid 0x6:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x6:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x7 handle 0x7: htb default 2
tc class add dev ens16f0 parent 0x7: classid 0x7:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x7:1 cake diffserv4
tc class add dev ens16f0 parent 0x7:1 classid 0x7:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x7:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x8 handle 0x8: htb default 2
tc class add dev ens16f0 parent 0x8: classid 0x8:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x8:1 cake diffserv4
tc class add dev ens16f0 parent 0x8:1 classid 0x8:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x8:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x9 handle 0x9: htb default 2
tc class add dev ens16f0 parent 0x9: classid 0x9:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x9:1 cake diffserv4
tc class add dev ens16f0 parent 0x9:1 classid 0x9:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x9:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0xa handle 0xa: htb default 2
tc class add dev ens16f0 parent 0xa: classid 0xa:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0xa:1 cake diffserv4
tc class add dev ens16f0 parent 0xa:1 classid 0xa:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0xa:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0xb handle 0xb: htb default 2
tc class add dev ens16f0 parent 0xb: classid 0xb:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0xb:1 cake diffserv4
tc class add dev ens16f0 parent 0xb:1 classid 0xb:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0xb:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0xc handle 0xc: htb default 2
tc class add dev ens16f0 parent 0xc: classid 0xc:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0xc:1 cake diffserv4
tc class add dev ens16f0 parent 0xc:1 classid 0xc:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0xc:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0xd handle 0xd: htb default 2
tc class add dev ens16f0 parent 0xd: classid 0xd:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0xd:1 cake diffserv4
tc class add dev ens16f0 parent 0xd:1 classid 0xd:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0xd:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0xe handle 0xe: htb default 2
tc class add dev ens16f0 parent 0xe: classid 0xe:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0xe:1 cake diffserv4
tc class add dev ens16f0 parent 0xe:1 classid 0xe:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0xe:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0xf handle 0xf: htb default 2
tc class add dev ens16f0 parent 0xf: classid 0xf:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0xf:1 cake diffserv4
tc class add dev ens16f0 parent 0xf:1 classid 0xf:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0xf:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x10 handle 0x10: htb default 2
tc class add dev ens16f0 parent 0x10: classid 0x10:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x10:1 cake diffserv4
tc class add dev ens16f0 parent 0x10:1 classid 0x10:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x10:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x11 handle 0x11: htb default 2
tc class add dev ens16f0 parent 0x11: classid 0x11:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x11:1 cake diffserv4
tc class add dev ens16f0 parent 0x11:1 classid 0x11:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x11:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x12 handle 0x12: htb default 2
tc class add dev ens16f0 parent 0x12: classid 0x12:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x12:1 cake diffserv4
tc class add dev ens16f0 parent 0x12:1 classid 0x12:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x12:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x13 handle 0x13: htb default 2
tc class add dev ens16f0 parent 0x13: classid 0x13:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x13:1 cake diffserv4
tc class add dev ens16f0 parent 0x13:1 classid 0x13:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x13:2 cake diffserv4
tc qdisc add dev ens16f0 parent 7FFF:0x14 handle 0x14: htb default 2
tc class add dev ens16f0 parent 0x14: classid 0x14:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f0 parent 0x14:1 cake diffserv4
tc class add dev ens16f0 parent 0x14:1 classid 0x14:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f0 parent 0x14:2 cake diffserv4
tc qdisc replace dev ens16f1 root handle 7FFF: mq
tc qdisc add dev ens16f1 parent 7FFF:0x1 handle 0x1: htb default 2
tc class add dev ens16f1 parent 0x1: classid 0x1:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x1:1 cake diffserv4
tc class add dev ens16f1 parent 0x1:1 classid 0x1:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x1:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x2 handle 0x2: htb default 2
tc class add dev ens16f1 parent 0x2: classid 0x2:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x2:1 cake diffserv4
tc class add dev ens16f1 parent 0x2:1 classid 0x2:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x2:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x3 handle 0x3: htb default 2
tc class add dev ens16f1 parent 0x3: classid 0x3:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x3:1 cake diffserv4
tc class add dev ens16f1 parent 0x3:1 classid 0x3:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x3:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x4 handle 0x4: htb default 2
tc class add dev ens16f1 parent 0x4: classid 0x4:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x4:1 cake diffserv4
tc class add dev ens16f1 parent 0x4:1 classid 0x4:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x4:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x5 handle 0x5: htb default 2
tc class add dev ens16f1 parent 0x5: classid 0x5:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x5:1 cake diffserv4
tc class add dev ens16f1 parent 0x5:1 classid 0x5:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x5:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x6 handle 0x6: htb default 2
tc class add dev ens16f1 parent 0x6: classid 0x6:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x6:1 cake diffserv4
tc class add dev ens16f1 parent 0x6:1 classid 0x6:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x6:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x7 handle 0x7: htb default 2
tc class add dev ens16f1 parent 0x7: classid 0x7:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x7:1 cake diffserv4
tc class add dev ens16f1 parent 0x7:1 classid 0x7:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x7:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x8 handle 0x8: htb default 2
tc class add dev ens16f1 parent 0x8: classid 0x8:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x8:1 cake diffserv4
tc class add dev ens16f1 parent 0x8:1 classid 0x8:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x8:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x9 handle 0x9: htb default 2
tc class add dev ens16f1 parent 0x9: classid 0x9:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x9:1 cake diffserv4
tc class add dev ens16f1 parent 0x9:1 classid 0x9:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x9:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0xa handle 0xa: htb default 2
tc class add dev ens16f1 parent 0xa: classid 0xa:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0xa:1 cake diffserv4
tc class add dev ens16f1 parent 0xa:1 classid 0xa:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0xa:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0xb handle 0xb: htb default 2
tc class add dev ens16f1 parent 0xb: classid 0xb:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0xb:1 cake diffserv4
tc class add dev ens16f1 parent 0xb:1 classid 0xb:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0xb:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0xc handle 0xc: htb default 2
tc class add dev ens16f1 parent 0xc: classid 0xc:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0xc:1 cake diffserv4
tc class add dev ens16f1 parent 0xc:1 classid 0xc:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0xc:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0xd handle 0xd: htb default 2
tc class add dev ens16f1 parent 0xd: classid 0xd:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0xd:1 cake diffserv4
tc class add dev ens16f1 parent 0xd:1 classid 0xd:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0xd:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0xe handle 0xe: htb default 2
tc class add dev ens16f1 parent 0xe: classid 0xe:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0xe:1 cake diffserv4
tc class add dev ens16f1 parent 0xe:1 classid 0xe:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0xe:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0xf handle 0xf: htb default 2
tc class add dev ens16f1 parent 0xf: classid 0xf:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0xf:1 cake diffserv4
tc class add dev ens16f1 parent 0xf:1 classid 0xf:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0xf:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x10 handle 0x10: htb default 2
tc class add dev ens16f1 parent 0x10: classid 0x10:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x10:1 cake diffserv4
tc class add dev ens16f1 parent 0x10:1 classid 0x10:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x10:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x11 handle 0x11: htb default 2
tc class add dev ens16f1 parent 0x11: classid 0x11:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x11:1 cake diffserv4
tc class add dev ens16f1 parent 0x11:1 classid 0x11:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x11:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x12 handle 0x12: htb default 2
tc class add dev ens16f1 parent 0x12: classid 0x12:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x12:1 cake diffserv4
tc class add dev ens16f1 parent 0x12:1 classid 0x12:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x12:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x13 handle 0x13: htb default 2
tc class add dev ens16f1 parent 0x13: classid 0x13:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x13:1 cake diffserv4
tc class add dev ens16f1 parent 0x13:1 classid 0x13:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x13:2 cake diffserv4
tc qdisc add dev ens16f1 parent 7FFF:0x14 handle 0x14: htb default 2
tc class add dev ens16f1 parent 0x14: classid 0x14:1 htb rate 10000mbit ceil 10000mbit
tc qdisc add dev ens16f1 parent 0x14:1 cake diffserv4
tc class add dev ens16f1 parent 0x14:1 classid 0x14:2 htb rate 25.0mbit ceil 100mbit prio 5
tc qdisc add dev ens16f1 parent 0x14:2 cake diffserv4

AP_A
Download:  3800 to 4000 Mbps
Upload:    3800 to 4000 Mbps
tc class add dev ens16f0 parent 1:1 classid 0x3 htb rate 3800mbit ceil 4000mbit prio 3
tc class add dev ens16f1 parent 1:1 classid 0x3 htb rate 3800mbit ceil 4000mbit prio 3

Traceback (most recent call last):
  File "/root/LibreQoS2/v1.2/./LibreQoS.py", line 303, in <module>
    refreshShapers()
  File "/root/LibreQoS2/v1.2/./LibreQoS.py", line 285, in refreshShapers
    finalMinor = traverseNetwork(network, 0, major=1, minor=3, queue=1, parentClassID="1:1", parentMaxDL=upstreamBandwidthCapacityDownloadMbps, parentMaxUL=upstreamBandwidthCapacityUploadMbps)
  File "/root/LibreQoS2/v1.2/./LibreQoS.py", line 237, in traverseNetwork
    if elem == device['ParentNode']:
UnboundLocalError: local variable 'device' referenced before assignment

from libreqos.

rchac avatar rchac commented on May 28, 2024

The majority of those errors are benign but UnboundLocalError: local variable 'device' referenced before assignment is not. Let me work on that one moment.

from libreqos.

rchac avatar rchac commented on May 28, 2024

Could you please try with 8b3db72

from libreqos.

interduo avatar interduo commented on May 28, 2024
Traceback (most recent call last):
  File "/root/LibreQoS2/v1.2/./LibreQoS.py", line 303, in <module>
    refreshShapers()
  File "/root/LibreQoS2/v1.2/./LibreQoS.py", line 288, in refreshShapers
    for device in devices:
NameError: name 'devices' is not defined. Did you mean: 'device'?

from libreqos.

interduo avatar interduo commented on May 28, 2024
root@rty-libreqos:~/LibreQoS2/v1.2# git fetch origin
root@rty-libreqos:~/LibreQoS2/v1.2# git pull origin main
From https://github.com/rchac/LibreQoS
 * branch            main       -> FETCH_HEAD
Already up to date.

from libreqos.

interduo avatar interduo commented on May 28, 2024

Firstly:

./xdp-cpumap-tc/src/xdp_iphash_to_cpu --dev ens16f1 --wan
libbpf: Error loading BTF: Invalid argument(22)
libbpf: magic: 0xeb9f
version: 1
flags: 0x0
hdr_len: 24
type_off: 0
type_len: 504
str_off: 504
str_len: 1726
btf_total_size: 2254
[1] PTR (anon) type_id=2
[2] STRUCT xdp_md size=24 vlen=6
	data type_id=3 bits_offset=0
	data_end type_id=3 bits_offset=32
	data_meta type_id=3 bits_offset=64
	ingress_ifindex type_id=3 bits_offset=96
	rx_queue_index type_id=3 bits_offset=128
	egress_ifindex type_id=3 bits_offset=160
[3] TYPEDEF __u32 type_id=4
[4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none)
[5] FUNC_PROTO (anon) return=6 args=(1 ctx)
[6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
[7] FUNC xdp_program type_id=5
[8] STRUCT bpf_map_def size=24 vlen=6
	type type_id=4 bits_offset=0
	key_size type_id=4 bits_offset=32
	value_size type_id=4 bits_offset=64
	max_entries type_id=4 bits_offset=96
	map_flags type_id=4 bits_offset=128
	inner_map_idx type_id=4 bits_offset=160
[9] VAR map_ip_hash type_id=8 linkage=1
[10] VAR map_txq_config type_id=8 linkage=1
[11] VAR map_ifindex_type type_id=8 linkage=1
[12] VAR cpu_map type_id=8 linkage=1
[13] VAR cpus_available type_id=8 linkage=1
[14] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED
[15] ARRAY (anon) type_id=14 index_type_id=16 nr_elems=4
[16] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none)
[17] VAR _license type_id=15 linkage=1
[18] DATASEC license size=0 vlen=1 size == 0

libbpf: Error loading ELF section .BTF: -22. Ignored and continue.
TC workaround for mapname: map_ifindex_type map_fd:7

This was working in v1.1

from libreqos.

rchac avatar rchac commented on May 28, 2024

Making progress. How is it with e726ac7 ?

from libreqos.

interduo avatar interduo commented on May 28, 2024

still: #46 (comment)

and second

tc filter delete dev ens16f0
Error: Class doesn't support blocks.
We have an error talking to the kernel
tc filter delete dev ens16f0 root
Error: Parent Qdisc doesn't exists.
We have an error talking to the kernel
tc qdisc delete dev ens16f0 root
Error: Cannot delete qdisc with handle of zero.
tc qdisc delete dev ens16f0
Error: Failed to find qdisc with specified handle.
tc filter delete dev ens16f1
Error: Class doesn't support blocks.
We have an error talking to the kernel
tc filter delete dev ens16f1 root
Error: Parent Qdisc doesn't exists.
We have an error talking to the kernel
tc qdisc delete dev ens16f1 root
Error: Cannot delete qdisc with handle of zero.
tc qdisc delete dev ens16f1
Error: Failed to find qdisc with specified handle.

at first run

from libreqos.

rchac avatar rchac commented on May 28, 2024
  1. Those warnings do not stop it from working, it's some libbpf thing but should not impact functinality
  2. Those errors are benign. They appear because the qdiscs havent been made yet. It clears existing qdiscs and classes on each load.

from libreqos.

interduo avatar interduo commented on May 28, 2024
  1. Nice to know.
  2. I know that but maybe some check should be done in script? (on my ubuntu desktop there is no error like this: Error: Class doesn't support blocks.)

from libreqos.

rchac avatar rchac commented on May 28, 2024

Yeah it's the parsed console output response from Linux Traffic Control. Basically that's Linux TC saying "we can't make that change to that item". It won't show all that after the first run.

from libreqos.

interduo avatar interduo commented on May 28, 2024

tc command got no option to make quiet those warnings I checked it.

Ok - now it's running.

from libreqos.

rchac avatar rchac commented on May 28, 2024

Yay! Awesome

from libreqos.

interduo avatar interduo commented on May 28, 2024

One more thing - service LibreQoS. If I change the file - how long it takes to regenerate the rules?
Do I need to manually run LibreQoS.py for reloading? (both options are completly fine)

Need to know that because of next question:
Is there any "check syntax" validator for ShapedDevices.csv and network.json?

I will be generating big ShapedDevices.csv in my CRM - but I need to be sure if it completly ok before running.

Maybe the LibreQoS should save some startup-configuration rules in startup.sh?

Maybe I get this comment into next issue?

from libreqos.

rchac avatar rchac commented on May 28, 2024

Usually once you've got sudo python3 LibreQoS.py working, you'll want to run it as a service from then on. As a service, you can get graphing to work. Once that's set up I usually use sudo systemctl restart LibreQoS.service to reload it manually if I know the ShapedDevices.csv has been changed in any way. Running it as a service, it will automatically resresh the queues every morning at 4AM (you can change that time of course). And when the service is restarted it will immediately refresh the queues as well.

And it depends on the number of queues it has to make but usually ~2 seconds.

from libreqos.

rchac avatar rchac commented on May 28, 2024

Is there any "check syntax" validator for ShapedDevices.csv and network.json?

There should be. It's a good feature to add. Technically if those have errors, LibreQoS.py exits before any changes are made to existing queues. Still, let me see how to add that for Network.json first since that's a common pain point for users.

from libreqos.

interduo avatar interduo commented on May 28, 2024

I make some more issues for not making this issue trashed.
I think the most important thing is to generate all commands before running them.

Pros are:

  • we have startup configs,
  • reloading takes less time,
  • if we got an error we can "get back" using earlier generated files,

If we got that the pain You mention is easier to endure/defeat.

from libreqos.

interduo avatar interduo commented on May 28, 2024

As it CircutID is generating good commands I will close that issue. Thanks for commits.

from libreqos.

rchac avatar rchac commented on May 28, 2024

from libreqos.

interduo avatar interduo commented on May 28, 2024

Why You don't create whole tc-rules-file and then use --batch command only one time?
Maybe this would help for dropping packets when reloading?

from libreqos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.