Skip to Content.

rare-dev - Re: [rare-dev] qos (re)marking

Subject: Rare project developers

List archive


Re: [rare-dev] qos (re)marking


Chronological Thread 
  • From: mc36 <>
  • To: Carmen Misa Moreira <>, "" <>
  • Subject: Re: [rare-dev] qos (re)marking
  • Date: Thu, 23 Jun 2022 17:04:19 +0200

well, so to have such a functionality, one just have to put them to
https://github.com/rare-freertr/freeRtr/blob/master/misc/p4lang/include/ig_ctl_qos_in.p4
(and export the proper ones from freerouter too:))

during the vc you also mentioned ebpf... it's a thing, nowadays in openwrt,
and that one
also can do it btw... rare have an ebpf dataplane (xdp is the new name btw)..
if you need
inspiration, look at
https://github.com/rare-freertr/freeRtr/blob/master/misc/native/p4xdp_kern.c
it easily impose mpls and sgt tags on my 5+yo openwrts at 300mbps rate!

root@apl:~# bpftool prog
18: xdp name xdp_router tag fcc10189c36376b1
loaded_at 2022-06-23T15:50:45+0200 uid 0
xlated 36360B jited 34340B memlock 36864B map_ids
66,67,68,69,70,71,76,75,77,78,74,72,73
btf_id 30
root@apl:~# bpftool map
66: array name cpu_port flags 0x0
key 4B value 4B max_entries 2 memlock 4096B
btf_id 30
67: hash name rx_ports flags 0x0
key 4B value 24B max_entries 128 memlock 8192B
btf_id 30
68: hash name tx_ports flags 0x0
key 4B value 24B max_entries 128 memlock 8192B
btf_id 30
69: hash name vlan_in flags 0x0
key 8B value 4B max_entries 512 memlock 24576B
btf_id 30
70: hash name pppoes flags 0x0
key 8B value 4B max_entries 128 memlock 8192B
btf_id 30
71: hash name vrf_port flags 0x0
key 4B value 72B max_entries 128 memlock 16384B
btf_id 30
72: hash name labels flags 0x0
key 4B value 48B max_entries 1024 memlock 90112B
btf_id 30
73: lpm_trie name routes4 flags 0x1
key 12B value 32B max_entries 2048 memlock 135168B
btf_id 30
74: lpm_trie name routes6 flags 0x1
key 24B value 32B max_entries 2048 memlock 159744B
btf_id 30
75: hash name bridges flags 0x0
key 12B value 56B max_entries 1024 memlock 106496B
btf_id 30
76: hash name neighs flags 0x0
key 4B value 40B max_entries 512 memlock 40960B
btf_id 30
77: hash name vlan_out flags 0x0
key 4B value 24B max_entries 512 memlock 32768B
btf_id 30
78: hash name bundles flags 0x0
key 4B value 88B max_entries 256 memlock 32768B
btf_id 30
root@apl:~# bpftool map dump name labels | grep pack
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 150053,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 150053,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
"pack": 0,
root@apl:~# cat /proc/cpuinfo
system type : Qualcomm Atheros QCA956X ver 1 rev 0
machine : TP-Link Archer C7 v4
processor : 0
cpu model : MIPS 74Kc V5.0
BogoMIPS : 385.84
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc,
0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp dsp2
Options implemented : tlb 4kex 4k_cache prefetch mcheck ejtag llsc
dc_aliases perf_cntr_intr_bit cdmm contextconfig perf
shadow register sets : 1
kscratch registers : 0
package : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available

root@apl:~#



On 6/23/22 16:39, mc36 wrote:
hi,
so during the vc i missed the point, that my sw router uplinks over mpls and
sgt and none of these are handled in the set parts yet...
without these, the stuff works as expected:
the first 10 packets from 5555::6 comes in as flow label 0,
the packets 10-20 from 5555::6 comes in as flowlabel 0x3039 that is 12345,
and packets 20-30 from 5555::6 comes in as flowlabel 0xd431 that is 54321...
and it's completely optional to have anything in the match statements, i mean,
a dumb acl who matches everything will do the trick, then you can do port
based
(re)marking... if that helps you, we can easily have this functionality in hw
less than a week.... :)
br,
cs



sid#ping 2001:db8:8319:0:200:11ff:fe11:2222 vrf v2 source hairpin12 tos 0
pinging 2001:db8:8319::200:11ff:fe11:2222, src=5555::6, vrf=v2, cnt=5,
len=64, df=false, tim=1000, gap=0, ttl=255, tos=0, sgt=0, flow=0, fill=0,
sweep=false, multi=false
!!!!!
result=100%, recv/sent/lost/err=5/5/0/0, rtt min/avg/max/sum=1/1/2/7, ttl
min/avg/max=59/59/59, tos min/avg/max=0/0/0
sid#ping 2001:db8:8319:0:200:11ff:fe11:2222 vrf v2 source hairpin12 tos 123
pinging 2001:db8:8319::200:11ff:fe11:2222, src=5555::6, vrf=v2, cnt=5,
len=64, df=false, tim=1000, gap=0, ttl=255, tos=123, sgt=0, flow=0, fill=0,
sweep=false, multi=false
!!!!!
result=100%, recv/sent/lost/err=5/5/0/0, rtt min/avg/max/sum=1/1/2/7, ttl
min/avg/max=59/59/59, tos min/avg/max=123/123/123
sid#ping 2001:db8:8319:0:200:11ff:fe11:2222 vrf v2 source hairpin12 tos 222
pinging 2001:db8:8319::200:11ff:fe11:2222, src=5555::6, vrf=v2, cnt=5,
len=64, df=false, tim=1000, gap=0, ttl=255, tos=222, sgt=0, flow=0, fill=0,
sweep=false, multi=false
!!!!!
result=100%, recv/sent/lost/err=5/5/0/0, rtt min/avg/max/sum=1/1/2/7, ttl
min/avg/max=59/59/59, tos min/avg/max=222/222/222
sid#show config-differences
ipv4 route v2 0.0.0.0 0.0.0.0 5.5.5.5
ipv6 route v2 :: :: 5555::5
policy-map asdf
sequence 10 action transit
sequence 10 match tos 123
sequence 10 set flow set 12345
sequence 20 action transit
sequence 20 match tos 222
sequence 20 set flow set 54321
sequence 9999 action transit
exit
hairpin 1
exit
interface hairpin11
vrf forwarding v1
ipv4 address 5.5.5.5 255.255.255.252
ipv6 address 5555::5 ffff:ffff:ffff:ffff::
no shutdown
no log-link-change
exit
interface hairpin12
service-policy-out asdf
vrf forwarding v2
ipv4 address 5.5.5.6 255.255.255.252
ipv6 address 5555::6 ffff:ffff:ffff:ffff::
no shutdown
no log-link-change
exit

sid#show policy-map interface hairpin12 out
seq chld queue intrvl byt/int rxb rxp trnsmt
10 0 0/128 100 0 990 15
tx=990(15) rx=990(15) drp=0(0)
20 0 0/128 100 0 330 5
tx=330(5) rx=330(5) drp=0(0)
9999 0 0/128 100 0 6000 74
tx=1918(29) rx=1918(29) drp=0(0)

sid#



Archive powered by MHonArc 2.6.19.

Top of Page