net/mvpp2: support forwarding bad packets
[dpdk.git] / doc / guides / nics / mvpp2.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2017 Marvell International Ltd.
3     Copyright(c) 2017 Semihalf.
4
5 .. _mvpp2_poll_mode_driver:
6
7 MVPP2 Poll Mode Driver
8 ======================
9
10 The MVPP2 PMD (**librte_net_mvpp2**) provides poll mode driver support
11 for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter.
12
13 Detailed information about SoCs that use PPv2 can be obtained here:
14
15 * https://www.marvell.com/embedded-processors/armada-70xx/
16 * https://www.marvell.com/embedded-processors/armada-80xx/
17
18
19 Features
20 --------
21
22 Features of the MVPP2 PMD are:
23
24 - Speed capabilities
25 - Link status
26 - Tx Queue start/stop
27 - MTU update
28 - Jumbo frame
29 - Promiscuous mode
30 - Allmulticast mode
31 - Unicast MAC filter
32 - Multicast MAC filter
33 - RSS hash
34 - VLAN filter
35 - CRC offload
36 - L3 checksum offload
37 - L4 checksum offload
38 - Packet type parsing
39 - Basic stats
40 - :ref:`Extended stats <extstats>`
41 - RX flow control
42 - Scattered TX frames
43 - :ref:`QoS <extconf>`
44 - :ref:`Flow API <flowapi>`
45 - :ref:`Traffic metering and policing <mtrapi>`
46 - :ref:`Traffic Management API <tmapi>`
47
48 Limitations
49 -----------
50
51 - Number of lcores is limited to 9 by MUSDK internal design. If more lcores
52   need to be allocated, locking will have to be considered. Number of available
53   lcores can be changed via ``MRVL_MUSDK_HIFS_RESERVED`` define in
54   ``mrvl_ethdev.c`` source file.
55
56 - Flushing vlans added for filtering is not possible due to MUSDK missing
57   functionality. Current workaround is to reset board so that PPv2 has a
58   chance to start in a sane state.
59
60 - MUSDK architecture does not support changing configuration in run time.
61   All necessary configurations should be done before first dev_start().
62
63 - RX queue start/stop is not supported.
64
65 - Current implementation does not support replacement of buffers in the HW buffer pool
66   at run time, so it is responsibility of the application to ensure that MTU does not exceed the configured buffer size.
67
68 - Configuring TX flow control currently is not supported.
69
70 - In current implementation, mechanism for acknowledging transmitted packets (``tx_done_cleanup``) is not supported.
71
72 - Running more than one DPDK-MUSDK application simultaneously is not supported.
73
74
75 Prerequisites
76 -------------
77
78 - Custom Linux Kernel sources
79
80   .. code-block:: console
81
82      git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell.git -b linux-4.4.120-armada-18.09
83
84 - Out of tree `mvpp2x_sysfs` kernel module sources
85
86   .. code-block:: console
87
88      git clone https://github.com/MarvellEmbeddedProcessors/mvpp2x-marvell.git -b mvpp2x-armada-18.09
89
90 - MUSDK (Marvell User-Space SDK) sources
91
92   .. code-block:: console
93
94      git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell.git -b musdk-release-SDK-10.3.5.0-PR2
95
96   MUSDK is a light-weight library that provides direct access to Marvell's
97   PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
98   requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
99   approval has been granted, library can be found by typing ``musdk`` in
100   the search box.
101
102   To get better understanding of the library one can consult documentation
103   available in the ``doc`` top level directory of the MUSDK sources.
104
105 - DPDK environment
106
107   Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup
108   DPDK environment.
109
110
111 Building MUSDK
112 --------------
113
114 Driver needs precompiled MUSDK library during compilation.
115
116 .. code-block:: console
117
118    export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu-
119    ./bootstrap
120    ./configure --host=aarch64-linux-gnu
121    make install
122
123 MUSDK will be installed to `usr/local` under current directory.
124 For the detailed build instructions please consult ``doc/musdk_get_started.txt``.
125
126
127 Building DPDK
128 -------------
129
130 Add path to libmusdk.pc in PKG_CONFIG_PATH environment variable.
131
132 .. code-block:: console
133
134    export PKG_CONFIG_PATH=$<musdk_install_dir>/lib/pkgconfig/:$PKG_CONFIG_PATH
135
136    meson build --cross-file config/arm/arm64_armada_linux_gcc
137    ninja -C build
138
139
140 Usage Example
141 -------------
142
143 MVPP2 PMD requires extra out of tree kernel modules to function properly.
144 `musdk_cma` sources are part of the MUSDK. Please consult
145 ``doc/musdk_get_started.txt`` for the detailed build instructions.
146 For `mvpp2x_sysfs` please consult ``Documentation/pp22_sysfs.txt`` for the
147 detailed build instructions.
148
149 .. code-block:: console
150
151    insmod musdk_cma.ko
152    insmod mvpp2x_sysfs.ko
153
154 Additionally interfaces used by DPDK application need to be put up:
155
156 .. code-block:: console
157
158    ip link set eth0 up
159    ip link set eth2 up
160
161 In order to run testpmd example application following command can be used:
162
163 .. code-block:: console
164
165    ./dpdk-testpmd --vdev=eth_mvpp2,iface=eth0,iface=eth2 -c 7 -- \
166      --burst=128 --txd=2048 --rxd=1024 --rxq=2 --txq=2  --nb-cores=2 \
167      -i -a --rss-udp
168
169 .. _extstats:
170
171 Extended stats
172 --------------
173
174 MVPP2 PMD supports the following extended statistics:
175
176         - ``rx_bytes``: number of RX bytes
177         - ``rx_packets``: number of RX packets
178         - ``rx_unicast_packets``: number of RX unicast packets
179         - ``rx_errors``: number of RX MAC errors
180         - ``rx_fullq_dropped``: number of RX packets dropped due to full RX queue
181         - ``rx_bm_dropped``: number of RX packets dropped due to no available buffers in the HW pool
182         - ``rx_early_dropped``: number of RX packets that were early dropped
183         - ``rx_fifo_dropped``: number of RX packets dropped due to RX fifo overrun
184         - ``rx_cls_dropped``: number of RX packets dropped by classifier
185         - ``tx_bytes``: number of TX bytes
186         - ``tx_packets``: number of TX packets
187         - ``tx_unicast_packets``: number of TX unicast packets
188         - ``tx_errors``: number of TX MAC errors
189
190
191 .. _extconf:
192
193 External Configuration
194 ----------------------
195
196 Several driver configuration (e.g. QoS) can be done through external configuration file. Path to the
197 file must be given as `cfg` in driver's vdev parameter list.
198
199 Configuration syntax
200 ~~~~~~~~~~~~~~~~~~~~
201
202 .. code-block:: console
203
204    [policer <policer_id>]
205    token_unit = <token_unit>
206    color = <color_mode>
207    cir = <cir>
208    ebs = <ebs>
209    cbs = <cbs>
210
211    [parser udf <udf_id>]
212    proto = <proto>
213    field = <field>
214    key = <key>
215    mask = <mask>
216    offset = <offset>
217
218    [port <portnum> default]
219    start_hdr = <start_hdr>
220    forward_bad_frames = <forward_bad_frames>
221    default_tc = <default_tc>
222    mapping_priority = <mapping_priority>
223
224    rate_limit_enable = <rate_limit_enable>
225    rate_limit = <rate_limit>
226    burst_size = <burst_size>
227
228    default_policer = <policer_id>
229
230    [port <portnum> tc <traffic_class>]
231    rxq = <rx_queue_list>
232    pcp = <pcp_list>
233    dscp = <dscp_list>
234    default_color = <default_color>
235
236    [port <portnum> tc <traffic_class>]
237    rxq = <rx_queue_list>
238    pcp = <pcp_list>
239    dscp = <dscp_list>
240
241    [port <portnum> txq <txqnum>]
242    sched_mode = <sched_mode>
243    wrr_weight = <wrr_weight>
244
245    rate_limit_enable = <rate_limit_enable>
246    rate_limit = <rate_limit>
247    burst_size = <burst_size>
248
249 Where:
250
251 - ``<udf_id>``: Logical UDF id.
252
253 - ``<proto>``: Indicate the preceding hdr before the UDF header (`eth` or `udp`).
254
255 - ``<field>``: Indicate the field of the <proto> hdr (`type` (eth) or `dport` (udp).
256
257 - ``<key>``: UDF key in string format starting with '0x'.
258
259 - ``<mask>``: UDF mask in string format starting with '0x'.
260
261 - ``<offset>``: Starting UDF offset from the <proto> hdr.
262
263 - ``<portnum>``: DPDK Port number (0..n).
264
265 - ``<start_hdr>``: Indicate what is the start header mode (`none` (eth), `dsa`, `ext_dsa` or `custom`).
266
267 - ``<forward_bad_frames>``: Indicate whether to forward or drop l2 bad packets (0 or 1).
268
269 - ``<default_tc>``: Default traffic class (e.g. 0)
270
271 - ``<mapping_priority>``: QoS priority for mapping (`ip`, `vlan`, `ip/vlan` or `vlan/ip`).
272
273 - ``<traffic_class>``: Traffic Class to be configured.
274
275 - ``<rx_queue_list>``: List of DPDK RX queues (e.g. 0 1 3-4)
276
277 - ``<pcp_list>``: List of PCP values to handle in particular TC (e.g. 0 1 3-4 7).
278
279 - ``<dscp_list>``: List of DSCP values to handle in particular TC (e.g. 0-12 32-48 63).
280
281 - ``<default_policer>``: Id of the policer configuration section to be used as default.
282
283 - ``<policer_id>``: Id of the policer configuration section (0..31).
284
285 - ``<token_unit>``: Policer token unit (`bytes` or `packets`).
286
287 - ``<color_mode>``: Policer color mode (`aware` or `blind`).
288
289 - ``<cir>``: Committed information rate in unit of kilo bits per second (data rate) or packets per second.
290
291 - ``<cbs>``: Committed burst size in unit of kilo bytes or number of packets.
292
293 - ``<ebs>``: Excess burst size in unit of kilo bytes or number of packets.
294
295 - ``<default_color>``: Default color for specific tc.
296
297 - ``<rate_limit_enable>``: Enables per port or per txq rate limiting (`0`/`1` to disable/enable).
298
299 - ``<rate_limit>``: Committed information rate, in kilo bits per second.
300
301 - ``<burst_size>``: Committed burst size, in kilo bytes.
302
303 - ``<sched_mode>``: Egress scheduler mode (`wrr` or `sp`).
304
305 - ``<wrr_weight>``: Txq weight.
306
307 Setting PCP/DSCP values for the default TC is not required. All PCP/DSCP
308 values not assigned explicitly to particular TC will be handled by the
309 default TC.
310
311 Configuration file example
312 ^^^^^^^^^^^^^^^^^^^^^^^^^^
313
314 .. code-block:: console
315
316    [policer 0]
317    token_unit = bytes
318    color = blind
319    cir = 100000
320    ebs = 64
321    cbs = 64
322
323    [port 0 default]
324    default_tc = 0
325    mapping_priority = ip
326
327    rate_limit_enable = 1
328    rate_limit = 1000
329    burst_size = 2000
330
331    [port 0 tc 0]
332    rxq = 0 1
333
334    [port 0 txq 0]
335    sched_mode = wrr
336    wrr_weight = 10
337
338    [port 0 txq 1]
339    sched_mode = wrr
340    wrr_weight = 100
341
342    [port 0 txq 2]
343    sched_mode = sp
344
345    [port 0 tc 1]
346    rxq = 2
347    pcp = 5 6 7
348    dscp = 26-38
349
350    [port 1 default]
351    default_tc = 0
352    mapping_priority = vlan/ip
353
354    default_policer = 0
355
356    [port 1 tc 0]
357    rxq = 0
358    dscp = 10
359
360    [port 1 tc 1]
361    rxq = 1
362    dscp = 11-20
363
364    [port 1 tc 2]
365    rxq = 2
366    dscp = 30
367
368    [port 1 txq 0]
369    rate_limit_enable = 1
370    rate_limit = 10000
371    burst_size = 2000
372
373 Configuration file example with UDF
374 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
375
376 .. code-block:: console
377
378    [parser udf 0]
379    proto = eth
380    field = type
381    key = 0x8842
382    mask = 0xffff
383    offset = 6
384
385 Usage example
386 ^^^^^^^^^^^^^
387
388 .. code-block:: console
389
390    ./dpdk-testpmd --vdev=eth_mvpp2,iface=eth0,iface=eth2,cfg=/home/user/mrvl.conf \
391      -c 7 -- -i -a --disable-hw-vlan-strip --rxq=3 --txq=3
392
393 .. _flowapi:
394
395 Flow API
396 --------
397
398 PPv2 offers packet classification capabilities via classifier engine which
399 can be configured via generic flow API offered by DPDK.
400
401 The :ref:`flow_isolated_mode` is supported.
402
403 For an additional description please refer to DPDK :doc:`../prog_guide/rte_flow`.
404
405 Supported flow actions
406 ~~~~~~~~~~~~~~~~~~~~~~
407
408 Following flow action items are supported by the driver:
409
410 * DROP
411 * QUEUE
412 * METER
413
414 Supported flow items
415 ~~~~~~~~~~~~~~~~~~~~
416
417 Following flow items and their respective fields are supported by the driver:
418
419 * ETH
420
421   * source MAC
422   * destination MAC
423   * ethertype
424
425 * VLAN
426
427   * PCP
428   * VID
429
430 * IPV4
431
432   * DSCP
433   * protocol
434   * source address
435   * destination address
436
437 * IPV6
438
439   * flow label
440   * next header
441   * source address
442   * destination address
443
444 * UDP
445
446   * source port
447   * destination port
448
449 * TCP
450
451   * source port
452   * destination port
453
454 Classifier match engine
455 ~~~~~~~~~~~~~~~~~~~~~~~
456
457 Classifier has an internal match engine which can be configured to
458 operate in either exact or maskable mode.
459
460 Mode is selected upon creation of the first unique flow rule as follows:
461
462 * maskable, if key size is up to 8 bytes.
463 * exact, otherwise, i.e for keys bigger than 8 bytes.
464
465 Where the key size equals the number of bytes of all fields specified
466 in the flow items.
467
468 .. table:: Examples of key size calculation
469
470    +----------------------------------------------------------------------------+-------------------+-------------+
471    | Flow pattern                                                               | Key size in bytes | Used engine |
472    +============================================================================+===================+=============+
473    | ETH (destination MAC) / VLAN (VID)                                         | 6 + 2 = 8         | Maskable    |
474    +----------------------------------------------------------------------------+-------------------+-------------+
475    | VLAN (VID) / IPV4 (source address)                                         | 2 + 4 = 6         | Maskable    |
476    +----------------------------------------------------------------------------+-------------------+-------------+
477    | TCP (source port, destination port)                                        | 2 + 2 = 4         | Maskable    |
478    +----------------------------------------------------------------------------+-------------------+-------------+
479    | VLAN (priority) / IPV4 (source address)                                    | 1 + 4 = 5         | Maskable    |
480    +----------------------------------------------------------------------------+-------------------+-------------+
481    | IPV4 (destination address) / UDP (source port, destination port)           | 6 + 2 + 2 = 10    | Exact       |
482    +----------------------------------------------------------------------------+-------------------+-------------+
483    | VLAN (VID) / IPV6 (flow label, destination address)                        | 2 + 3 + 16 = 21   | Exact       |
484    +----------------------------------------------------------------------------+-------------------+-------------+
485    | IPV4 (DSCP, source address, destination address)                           | 1 + 4 + 4 = 9     | Exact       |
486    +----------------------------------------------------------------------------+-------------------+-------------+
487    | IPV6 (flow label, source address, destination address)                     | 3 + 16 + 16 = 35  | Exact       |
488    +----------------------------------------------------------------------------+-------------------+-------------+
489
490 From the user perspective maskable mode means that masks specified
491 via flow rules are respected. In case of exact match mode, masks
492 which do not provide exact matching (all bits masked) are ignored.
493
494 If the flow matches more than one classifier rule the first
495 (with the lowest index) matched takes precedence.
496
497 Flow rules usage example
498 ~~~~~~~~~~~~~~~~~~~~~~~~
499
500 Before proceeding run testpmd user application:
501
502 .. code-block:: console
503
504    ./dpdk-testpmd --vdev=eth_mvpp2,iface=eth0,iface=eth2 -c 3 -- -i --p 3 -a --disable-hw-vlan-strip
505
506 Example #1
507 ^^^^^^^^^^
508
509 .. code-block:: console
510
511    testpmd> flow create 0 ingress pattern eth src is 10:11:12:13:14:15 / end actions drop / end
512
513 In this case key size is 6 bytes thus maskable type is selected. Testpmd
514 will set mask to ff:ff:ff:ff:ff:ff i.e traffic explicitly matching
515 above rule will be dropped.
516
517 Example #2
518 ^^^^^^^^^^
519
520 .. code-block:: console
521
522    testpmd> flow create 0 ingress pattern ipv4 src spec 10.10.10.0 src mask 255.255.255.0 / tcp src spec 0x10 src mask 0x10 / end action drop / end
523
524 In this case key size is 8 bytes thus maskable type is selected.
525 Flows which have IPv4 source addresses ranging from 10.10.10.0 to 10.10.10.255
526 and tcp source port set to 16 will be dropped.
527
528 Example #3
529 ^^^^^^^^^^
530
531 .. code-block:: console
532
533    testpmd> flow create 0 ingress pattern vlan vid spec 0x10 vid mask 0x10 / ipv4 src spec 10.10.1.1 src mask 255.255.0.0 dst spec 11.11.11.1 dst mask 255.255.255.0 / end actions drop / end
534
535 In this case key size is 10 bytes thus exact type is selected.
536 Even though each item has partial mask set, masks will be ignored.
537 As a result only flows with VID set to 16 and IPv4 source and destination
538 addresses set to 10.10.1.1 and 11.11.11.1 respectively will be dropped.
539
540 Limitations
541 ~~~~~~~~~~~
542
543 Following limitations need to be taken into account while creating flow rules:
544
545 * For IPv4 exact match type the key size must be up to 12 bytes.
546 * For IPv6 exact match type the key size must be up to 36 bytes.
547 * Following fields cannot be partially masked (all masks are treated as
548   if they were exact):
549
550   * ETH: ethertype
551   * VLAN: PCP, VID
552   * IPv4: protocol
553   * IPv6: next header
554   * TCP/UDP: source port, destination port
555
556 * Only one classifier table can be created thus all rules in the table
557   have to match table format. Table format is set during creation of
558   the first unique flow rule.
559 * Up to 5 fields can be specified per flow rule.
560 * Up to 20 flow rules can be added.
561
562 For additional information about classifier please consult
563 ``doc/musdk_cls_user_guide.txt``.
564
565 .. _mtrapi:
566
567 Traffic metering and policing
568 -----------------------------
569
570 MVPP2 PMD supports DPDK traffic metering and policing that allows the following:
571
572 1. Meter ingress traffic.
573 2. Do policing.
574 3. Gather statistics.
575
576 For an additional description please refer to DPDK :doc:`Traffic Metering and Policing API <../prog_guide/traffic_metering_and_policing>`.
577
578 The policer objects defined by this feature can work with the default policer defined via config file as described in :ref:`QoS Support <extconf>`.
579
580 Limitations
581 ~~~~~~~~~~~
582
583 The following capabilities are not supported:
584
585 - MTR object meter DSCP table update
586 - MTR object policer action update
587 - MTR object enabled statistics
588
589 Usage example
590 ~~~~~~~~~~~~~
591
592 1. Run testpmd user app:
593
594    .. code-block:: console
595
596                 ./dpdk-testpmd --vdev=eth_mvpp2,iface=eth0,iface=eth2 -c 6 -- -i -p 3 -a --txd 1024 --rxd 1024
597
598 2. Create meter profile:
599
600    .. code-block:: console
601
602                 testpmd> add port meter profile 0 0 srtcm_rfc2697 2000 256 256
603
604 3. Create meter:
605
606    .. code-block:: console
607
608                 testpmd> create port meter 0 0 0 yes d d d 0 1 0
609
610 4. Create flow rule witch meter attached:
611
612    .. code-block:: console
613
614                 testpmd> flow create 0 ingress pattern ipv4 src is 10.10.10.1 / end actions meter mtr_id 0 / end
615
616 For a detailed usage description please refer to "Traffic Metering and Policing" section in DPDK :doc:`Testpmd Runtime Functions <../testpmd_app_ug/testpmd_funcs>`.
617
618
619
620 .. _tmapi:
621
622 Traffic Management API
623 ----------------------
624
625 MVPP2 PMD supports generic DPDK Traffic Management API which allows to
626 configure the following features:
627
628 1. Hierarchical scheduling
629 2. Traffic shaping
630 3. Congestion management
631 4. Packet marking
632
633 Internally TM is represented by a hierarchy (tree) of nodes.
634 Node which has a parent is called a leaf whereas node without
635 parent is called a non-leaf (root).
636 MVPP2 PMD supports two level hierarchy where level 0 represents ports and level 1 represents tx queues of a given port.
637
638 .. figure:: img/mvpp2_tm.*
639
640 Nodes hold following types of settings:
641
642 - for egress scheduler configuration: weight
643 - for egress rate limiter: private shaper
644 - bitmask indicating which statistics counters will be read
645
646 Hierarchy is always constructed from the top, i.e first a root node is added
647 then some number of leaf nodes. Number of leaf nodes cannot exceed number
648 of configured tx queues.
649
650 After hierarchy is complete it can be committed.
651
652
653 For an additional description please refer to DPDK :doc:`Traffic Management API <../prog_guide/traffic_management>`.
654
655 Limitations
656 ~~~~~~~~~~~
657
658 The following capabilities are not supported:
659
660 - Traffic manager WRED profile and WRED context
661 - Traffic manager shared shaper update
662 - Traffic manager packet marking
663 - Maximum number of levels in hierarchy is 2
664 - Currently dynamic change of a hierarchy is not supported
665
666 Usage example
667 ~~~~~~~~~~~~~
668
669 For a detailed usage description please refer to "Traffic Management" section in DPDK :doc:`Testpmd Runtime Functions <../testpmd_app_ug/testpmd_funcs>`.
670
671 1. Run testpmd as follows:
672
673    .. code-block:: console
674
675                 ./dpdk-testpmd --vdev=net_mrvl,iface=eth0,iface=eth2,cfg=./qos_config -c 7 -- \
676                 -i -p 3 --disable-hw-vlan-strip --rxq 3 --txq 3 --txd 1024 --rxd 1024
677
678 2. Stop all ports:
679
680    .. code-block:: console
681
682                 testpmd> port stop all
683
684 3. Add shaper profile:
685
686    .. code-block:: console
687
688                 testpmd> add port tm node shaper profile 0 0 900000 70000 0
689
690    Parameters have following meaning::
691
692                 0       - Id of a port.
693                 0       - Id of a new shaper profile.
694                 900000  - Shaper rate in bytes/s.
695                 70000   - Bucket size in bytes.
696                 0       - Packet length adjustment - ignored.
697
698 4. Add non-leaf node for port 0:
699
700    .. code-block:: console
701
702                 testpmd> add port tm nonleaf node 0 3 -1 0 0 0 0 0 1 3 0
703
704    Parameters have following meaning::
705
706                  0  - Id of a port
707                  3  - Id of a new node.
708                 -1  - Indicate that root does not have a parent.
709                  0  - Priority of the node.
710                  0  - Weight of the node.
711                  0  - Id of a level. Since this is a root 0 is passed.
712                  0  - Id of the shaper profile.
713                  0  - Number of SP priorities.
714                  3  - Enable statistics for both number of transmitted packets and bytes.
715                  0  - Number of shared shapers.
716
717 5. Add leaf node for tx queue 0:
718
719    .. code-block:: console
720
721                 testpmd> add port tm leaf node 0 0 3 0 30 1 -1 0 0 1 0
722
723    Parameters have following meaning::
724
725                  0  - Id of a port.
726                  0  - Id of a new node.
727                  3  - Id of the parent node.
728                  0  - Priority of a node.
729                  30 - WRR weight.
730                  1  - Id of a level. Since this is a leaf node 1 is passed.
731                 -1  - Id of a shaper. -1 indicates that shaper is not attached.
732                  0  - Congestion management is not supported.
733                  0  - Congestion management is not supported.
734                  1  - Enable statistics counter for number of transmitted packets.
735                  0  - Number of shared shapers.
736
737 6. Add leaf node for tx queue 1:
738
739    .. code-block:: console
740
741         testpmd> add port tm leaf node 0 1 3 0 60 1 -1 0 0 1 0
742
743    Parameters have following meaning::
744
745                  0  - Id of a port.
746                  1  - Id of a new node.
747                  3  - Id of the parent node.
748                  0  - Priority of a node.
749                  60 - WRR weight.
750                  1  - Id of a level. Since this is a leaf node 1 is passed.
751                 -1  - Id of a shaper. -1 indicates that shaper is not attached.
752                  0  - Congestion management is not supported.
753                  0  - Congestion management is not supported.
754                  1  - Enable statistics counter for number of transmitted packets.
755                  0  - Number of shared shapers.
756
757 7. Add leaf node for tx queue 2:
758
759    .. code-block:: console
760
761                 testpmd> add port tm leaf node 0 2 3 0 99 1 -1 0 0 1 0
762
763    Parameters have following meaning::
764
765                  0  - Id of a port.
766                  2  - Id of a new node.
767                  3  - Id of the parent node.
768                  0  - Priority of a node.
769                  99 - WRR weight.
770                  1  - Id of a level. Since this is a leaf node 1 is passed.
771                 -1  - Id of a shaper. -1 indicates that shaper is not attached.
772                  0  - Congestion management is not supported.
773                  0  - Congestion management is not supported.
774                  1  - Enable statistics counter for number of transmitted packets.
775                  0  - Number of shared shapers.
776
777 8. Commit hierarchy:
778
779    .. code-block:: console
780
781                 testpmd> port tm hierarchy commit 0 no
782
783   Parameters have following meaning::
784
785                 0  - Id of a port.
786                 no - Do not flush TM hierarchy if commit fails.
787
788 9. Start all ports
789
790    .. code-block:: console
791
792                 testpmd> port start all
793
794
795
796 10. Enable forwarding
797
798    .. code-block:: console
799
800                 testpmd> start