Lines Matching +full:class +full:- +full:d
1 .. SPDX-License-Identifier: GPL-2.0
26 - TX queues must be rated starting from txq0 that has highest priority
27 - Traffic classes are used starting from 0, that has highest priority
28 - CBS shapers should be used with rated queues
29 - The bandwidth for CBS shapers has to be set a little bit more then
32 - Real rates can differ, due to discreetness
33 - Map skb-priority to txq is not enough, also skb-priority to l2 prio
35 - Any l2/socket prio (0 - 7) for classes can be used, but for
37 - only 2 classes tested: A and B, but checked and can work with more,
45 +-------------------------------+
46 |--+ |
49 +-----------------------------+ +--|t | |
50 | | 1 | E | | |h |./tsn_listener -d \ |
51 | Target board: | 0 | t |--+ |0 | 18:03:73:66:87:42 -i eth0 \|
52 | AM572x EVM | 0 | h | | | -s 1500 |
53 | | 0 | 0 | |--+ |
54 | Only 2 classes: |Mb +---| +-------------------------------+
55 | class A, class B | |
56 | | +---| +-------------------------------+
57 | | 1 | E | |--+ |
59 | | 0 | h |--+ |E | MAC 20:cf:30:85:7d:fd |
60 | |Mb | 1 | +--|t | |
61 +-----------------------------+ |h |./tsn_listener -d \ |
62 |0 | 20:cf:30:85:7d:fd -i eth0 \|
63 | | -s 1500 |
64 |--+ |
65 +-------------------------------+
69 ----------------------------------------------------------------
73 - tc - traffic class
74 - txq - transmit queue
75 - p - priority
76 - f - fifo (cpsw fifo)
77 - S - shaper configured
81 +------------------------------------------------------------------+ u
82 | +---------------+ +---------------+ +------+ +------+ | s
85 | | Class A | | Class B | | Rest | | Rest | |
91 | +---|-----------+ +---|-----------+ +---|--+ +---|--+ |
92 +-----|------------------|------------------|--------|-------------+
93 +-+ +------------+ | |
94 | | +-----------------+ +--+
96 +---|-------|-------------|-----------------------|----------------+
97 | +----+ +----+ +----+ +----+ +----+ |
103 | | | +-----+ | | l
105 | +----+ +----+ +----+ +----+ | s
110 | | | +-----+ | |
114 | +----+ +----+ +----+ +----+ +----+ |
119 | +-|------|------|------|--+ +--|--------------+ |
121 +---|------|------|------|------------------------|----------------+
124 3 2 0-1, 4-7 <- L2 priority |
127 +---|------|------|------|------------------------|----------------+
128 | | | | | |----------+ |
129 | +----+ +----+ +----+ +----+ +----+ |
134 | | | | +----- | | w
136 | | | | | | | d
137 | +----+ +----+ +----+p p+----+ | r
144 +------------------------------------------------------------------+
151 $ ethtool -L eth0 rx 1 tx 5
157 $ ethtool -l eth0
159 Pre-set maximums:
176 $ echo 40 > /sys/class/net/eth0/queues/tx-0/tx_maxrate
177 $ echo 20 > /sys/class/net/eth0/queues/tx-1/tx_maxrate
182 $ cat /sys/class/net/eth0/queues/tx-*/tx_maxrate
191 // Map skb->priority to traffic class:
192 // 3pri -> tc0, 2pri -> tc1, (0,1,4-7)pri -> tc2
193 // Map traffic class to transmit queue:
194 // tc0 -> txq0, tc1 -> txq1, tc2 -> (txq2, txq3)
203 // packets to Eth1, so all prio -> tc0 and tc0 -> txq4
211 $ tc -g class show dev eth0
212 +---(100:ffe2) mqprio
213 | +---(100:3) mqprio
214 | +---(100:4) mqprio
216 +---(100:ffe1) mqprio
217 | +---(100:2) mqprio
219 +---(100:ffe0) mqprio
220 +---(100:1) mqprio
222 $ tc -g class show dev eth1
223 +---(100:ffe0) mqprio
224 +---(100:5) mqprio
228 // Set rate for class A - 41 Mbit (tc0, txq0) using CBS Qdisc
232 $ tc qdisc add dev eth0 parent 100:1 cbs locredit -1438 \
233 hicredit 62 sendslope -959000 idleslope 41000 offload 1
238 // Set rate for class B - 21 Mbit (tc1, txq1) using CBS Qdisc:
240 $ tc qdisc add dev eth0 parent 100:2 cbs locredit -1468 \
241 hicredit 65 sendslope -979000 idleslope 21000 offload 1
246 // Create vlan 100 to map sk->priority to vlan qos
255 // Map skb->priority to L2 prio, 1 to 1
270 // to 3 for class A and/or to 2 for class B
272 ./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p3 -s 1500&
273 ./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p2 -s 1500&
279 ./tsn_listener -d 18:03:73:66:87:42 -i enp5s0 -s 1500
303 $ ethtool -L eth0 rx 1 tx 1
306 ----------------------------------------------------------------
312 +------------------------------------------------------------------+ u
313 | +----------+ +----------+ +------+ +----------+ +----------+ | s
316 | | Class A | | Class B | | Rest | | Class B | | Class A | |
322 | +---|------+ +---|------+ +---|--+ +---|------+ +---|------+ |
323 +-----|-------------|-------------|---------|-------------|--------+
324 +-+ +-------+ | +----------+ +----+
325 | | +-------+------+ | |
327 +---|-------|-------------|--------------|-------------|-------|---+
328 | +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ |
334 | | | +----+ +----+ | | | l
336 | +----+ +----+ +----+ +----+ +----+ +----+ | s
341 | | | +-----+ +-----+ | | |
345 | +----+ +----+ +----+ +----+ t t +----+ +----+ +----+ +----+ |
350 | +-|------|------|------|--+ 0 0 +-|------|------|------|--+ |
352 +---|------|------|------|---------------|------|------|------|----+
355 3 2 0-1, 4-7 <-L2 pri-> 0-1, 4-7 2 3
358 +---|------|------|------|---------------|------|------|------|----+
360 | +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ |
365 | | | | +----- | | | | | w
366 | | | | | +----+ | | | |
367 | | | | | | | | | | d
368 | +----+ +----+ +----+p p+----+ +----+ +----+ | r
375 +------------------------------------------------------------------+
382 $ ethtool -L eth1 rx 1 tx 8
388 $ ethtool -l eth0
390 Pre-set maximums:
408 $ echo 40 > /sys/class/net/eth0/queues/tx-0/tx_maxrate
409 $ echo 20 > /sys/class/net/eth0/queues/tx-1/tx_maxrate
410 $ echo 30 > /sys/class/net/eth1/queues/tx-2/tx_maxrate
411 $ echo 10 > /sys/class/net/eth1/queues/tx-3/tx_maxrate
416 $ cat /sys/class/net/eth0/queues/tx-*/tx_maxrate
428 // Map skb->priority to traffic class for Eth0:
429 // 3pri -> tc0, 2pri -> tc1, (0,1,4-7)pri -> tc2
430 // Map traffic class to transmit queue:
431 // tc0 -> txq0, tc1 -> txq1, tc2 -> (txq4, txq5)
438 $ tc -g class show dev eth0
439 +---(100:ffe2) mqprio
440 | +---(100:5) mqprio
441 | +---(100:6) mqprio
443 +---(100:ffe1) mqprio
444 | +---(100:2) mqprio
446 +---(100:ffe0) mqprio
447 +---(100:1) mqprio
451 // Set rate for class A - 41 Mbit (tc0, txq0) using CBS Qdisc for Eth0
454 $ tc qdisc add dev eth0 parent 100:1 cbs locredit -1470 \
455 hicredit 62 sendslope -959000 idleslope 41000 offload 1
460 // Set rate for class B - 21 Mbit (tc1, txq1) using CBS Qdisc for Eth0
461 $ tc qdisc add dev eth0 parent 100:2 cbs locredit -1470 \
462 hicredit 65 sendslope -979000 idleslope 21000 offload 1
467 // Create vlan 100 to map sk->priority to vlan qos for Eth0
473 // Map skb->priority to L2 prio for Eth0.100, one to one
487 // Map skb->priority to traffic class for Eth1:
488 // 3pri -> tc0, 2pri -> tc1, (0,1,4-7)pri -> tc2
489 // Map traffic class to transmit queue:
490 // tc0 -> txq2, tc1 -> txq3, tc2 -> (txq6, txq7)
497 $ tc -g class show dev eth1
498 +---(100:ffe2) mqprio
499 | +---(100:7) mqprio
500 | +---(100:8) mqprio
502 +---(100:ffe1) mqprio
503 | +---(100:4) mqprio
505 +---(100:ffe0) mqprio
506 +---(100:3) mqprio
510 // Set rate for class A - 31 Mbit (tc0, txq2) using CBS Qdisc for Eth1
512 // for interface speed - 100Mb for eth1 port.
514 $ tc qdisc add dev eth1 parent 100:3 cbs locredit -1035 \
515 hicredit 465 sendslope -69000 idleslope 31000 offload 1
520 // Set rate for class B - 11 Mbit (tc1, txq3) using CBS Qdisc for Eth1
522 $ tc qdisc add dev eth1 parent 100:4 cbs locredit -1335 \
523 hicredit 405 sendslope -89000 idleslope 11000 offload 1
528 // Create vlan 100 to map sk->priority to vlan qos for Eth1
534 // Map skb->priority to L2 prio for Eth1.100, one to one
549 // for class A and to 2 for class B. For both interfaces
550 ./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p2 -s 1500&
551 ./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p3 -s 1500&
552 ./tsn_talker -d 20:cf:30:85:7d:fd -i eth1.100 -p2 -s 1500&
553 ./tsn_talker -d 20:cf:30:85:7d:fd -i eth1.100 -p3 -s 1500&
559 ./tsn_listener -d 18:03:73:66:87:42 -i enp5s0 -s 1500
587 $ ethtool -L eth0 rx 1 tx 1