+Usage example
+~~~~~~~~~~~~~
+
+1. Run testpmd user app:
+
+ .. code-block:: console
+
+ ./testpmd --vdev=eth_mvpp2,iface=eth0,iface=eth2 -c 6 -- -i -p 3 -a --txd 1024 --rxd 1024
+
+2. Create meter profile:
+
+ .. code-block:: console
+
+ testpmd> add port meter profile 0 0 srtcm_rfc2697 2000 256 256
+
+3. Create meter:
+
+ .. code-block:: console
+
+ testpmd> create port meter 0 0 0 yes d d d 0 1 0
+
+4. Create flow rule witch meter attached:
+
+ .. code-block:: console
+
+ testpmd> flow create 0 ingress pattern ipv4 src is 10.10.10.1 / end actions meter mtr_id 0 / end
+
+For a detailed usage description please refer to "Traffic Metering and Policing" section in DPDK :doc:`Testpmd Runtime Functions <../testpmd_app_ug/testpmd_funcs>`.
+
+
+
+.. _tmapi:
+
+Traffic Management API
+----------------------
+
+MVPP2 PMD supports generic DPDK Traffic Management API which allows to
+configure the following features:
+
+1. Hierarchical scheduling
+2. Traffic shaping
+3. Congestion management
+4. Packet marking
+
+Internally TM is represented by a hierarchy (tree) of nodes.
+Node which has a parent is called a leaf whereas node without
+parent is called a non-leaf (root).
+MVPP2 PMD supports two level hierarchy where level 0 represents ports and level 1 represents tx queues of a given port.
+
+.. figure:: img/mvpp2_tm.*
+
+Nodes hold following types of settings:
+
+- for egress scheduler configuration: weight
+- for egress rate limiter: private shaper
+- bitmask indicating which statistics counters will be read
+
+Hierarchy is always constructed from the top, i.e first a root node is added
+then some number of leaf nodes. Number of leaf nodes cannot exceed number
+of configured tx queues.
+
+After hierarchy is complete it can be committed.
+
+
+For an additional description please refer to DPDK :doc:`Traffic Management API <../prog_guide/traffic_management>`.
+
+Limitations
+~~~~~~~~~~~
+
+The following capabilities are not supported:
+
+- Traffic manager WRED profile and WRED context
+- Traffic manager shared shaper update
+- Traffic manager packet marking
+- Maximum number of levels in hierarchy is 2
+- Currently dynamic change of a hierarchy is not supported
+
+Usage example
+~~~~~~~~~~~~~
+
+For a detailed usage description please refer to "Traffic Management" section in DPDK :doc:`Testpmd Runtime Functions <../testpmd_app_ug/testpmd_funcs>`.
+
+1. Run testpmd as follows:
+
+ .. code-block:: console
+
+ ./testpmd --vdev=net_mrvl,iface=eth0,iface=eth2,cfg=./qos_config -c 7 -- \
+ -i -p 3 --disable-hw-vlan-strip --rxq 3 --txq 3 --txd 1024 --rxd 1024
+
+2. Stop all ports:
+
+ .. code-block:: console
+
+ testpmd> port stop all
+
+3. Add shaper profile:
+
+ .. code-block:: console
+
+ testpmd> add port tm node shaper profile 0 0 900000 70000 0
+
+ Parameters have following meaning::
+
+ 0 - Id of a port.
+ 0 - Id of a new shaper profile.
+ 900000 - Shaper rate in bytes/s.
+ 70000 - Bucket size in bytes.
+ 0 - Packet length adjustment - ignored.
+
+4. Add non-leaf node for port 0:
+
+ .. code-block:: console
+
+ testpmd> add port tm nonleaf node 0 3 -1 0 0 0 0 0 1 3 0
+
+ Parameters have following meaning::
+
+ 0 - Id of a port
+ 3 - Id of a new node.
+ -1 - Indicate that root does not have a parent.
+ 0 - Priority of the node.
+ 0 - Weight of the node.
+ 0 - Id of a level. Since this is a root 0 is passed.
+ 0 - Id of the shaper profile.
+ 0 - Number of SP priorities.
+ 3 - Enable statistics for both number of transmitted packets and bytes.
+ 0 - Number of shared shapers.
+
+5. Add leaf node for tx queue 0:
+
+ .. code-block:: console
+
+ testpmd> add port tm leaf node 0 0 3 0 30 1 -1 0 0 1 0
+
+ Parameters have following meaning::
+
+ 0 - Id of a port.
+ 0 - Id of a new node.
+ 3 - Id of the parent node.
+ 0 - Priority of a node.
+ 30 - WRR weight.
+ 1 - Id of a level. Since this is a leaf node 1 is passed.
+ -1 - Id of a shaper. -1 indicates that shaper is not attached.
+ 0 - Congestion management is not supported.
+ 0 - Congestion management is not supported.
+ 1 - Enable statistics counter for number of transmitted packets.
+ 0 - Number of shared shapers.
+
+6. Add leaf node for tx queue 1:
+
+ .. code-block:: console
+
+ testpmd> add port tm leaf node 0 1 3 0 60 1 -1 0 0 1 0
+
+ Parameters have following meaning::
+
+ 0 - Id of a port.
+ 1 - Id of a new node.
+ 3 - Id of the parent node.
+ 0 - Priority of a node.
+ 60 - WRR weight.
+ 1 - Id of a level. Since this is a leaf node 1 is passed.
+ -1 - Id of a shaper. -1 indicates that shaper is not attached.
+ 0 - Congestion management is not supported.
+ 0 - Congestion management is not supported.
+ 1 - Enable statistics counter for number of transmitted packets.
+ 0 - Number of shared shapers.
+
+7. Add leaf node for tx queue 2:
+
+ .. code-block:: console
+
+ testpmd> add port tm leaf node 0 2 3 0 99 1 -1 0 0 1 0
+
+ Parameters have following meaning::
+
+ 0 - Id of a port.
+ 2 - Id of a new node.
+ 3 - Id of the parent node.
+ 0 - Priority of a node.
+ 99 - WRR weight.
+ 1 - Id of a level. Since this is a leaf node 1 is passed.
+ -1 - Id of a shaper. -1 indicates that shaper is not attached.
+ 0 - Congestion management is not supported.
+ 0 - Congestion management is not supported.
+ 1 - Enable statistics counter for number of transmitted packets.
+ 0 - Number of shared shapers.
+
+8. Commit hierarchy:
+
+ .. code-block:: console
+
+ testpmd> port tm hierarchy commit 0 no
+
+ Parameters have following meaning::
+
+ 0 - Id of a port.
+ no - Do not flush TM hierarchy if commit fails.
+
+9. Start all ports
+
+ .. code-block:: console
+
+ testpmd> port start all
+
+
+
+10. Enable forwarding
+
+ .. code-block:: console
+
+ testpmd> start