X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=doc%2Fguides%2Ftestpmd_app_ug%2Ftestpmd_funcs.rst;h=72667dedb12b59ec42dd65d8a828d3713cee1571;hb=bf085dcba16c350df7ac411ca63af72b880e1188;hp=a45910b81e2a2374df693848758d177c2ff713eb;hpb=836cdce48822f31316849adc00086e17131908d7;p=dpdk.git diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index a45910b81e..72667dedb1 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -24,10 +24,10 @@ If you type a partial command and hit ```` you get a list of the available testpmd> show port - info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap X - info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap all - stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap X - stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap all + info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X + info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all + stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X + stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all ... @@ -159,7 +159,7 @@ show port Display information for a given port or all ports:: - testpmd> show port (info|summary|stats|xstats|fdir|stat_qmap|dcb_tc|cap) (port_id|all) + testpmd> show port (info|summary|stats|xstats|fdir|stat_qmap|dcb_tc) (port_id|all) The available information categories are: @@ -177,8 +177,6 @@ The available information categories are: * ``dcb_tc``: DCB information such as TC mapping. -* ``cap``: Supported offload capabilities. - For example: .. code-block:: console @@ -266,6 +264,13 @@ Display information for a given port's RX/TX descriptor status:: testpmd> show port (port_id) (rxq|txq) (queue_id) desc (desc_id) status +show rxq desc used count +~~~~~~~~~~~~~~~~~~~~~~~~ + +Display the number of receive packet descriptors currently filled by hardware +and ready to be processed by the driver on a given RX queue:: + + testpmd> show port (port_id) rxq (queue_id) desc used count show config ~~~~~~~~~~~ @@ -1998,6 +2003,24 @@ Set fec mode for a specific port:: testpmd> set port (port_id) fec_mode auto|off|rs|baser +Config Sample actions list +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Configure the sample actions list to be used when sampling a packet by +rte_flow_action_sample:: + + set sample_actions {index} {action} [/ {action} [...]] / end + +There are multiple global buffers for ``sample_actions``, this command will set +one internal buffer index by ``{index}``. + +In order to use different sample actions list, ``index`` must be specified +during the flow rule creation:: + + testpmd> flow create 0 ingress pattern eth / ipv4 / end actions + sample ratio 2 index 2 / end + +Otherwise the default index ``0`` is used. Port Functions -------------- @@ -2693,14 +2716,15 @@ add port meter profile (srTCM rfc2967) Add meter profile (srTCM rfc2697) to the ethernet device:: testpmd> add port meter profile srtcm_rfc2697 (port_id) (profile_id) \ - (cir) (cbs) (ebs) + (cir) (cbs) (ebs) (packet_mode) where: * ``profile_id``: ID for the meter profile. -* ``cir``: Committed Information Rate (CIR) (bytes/second). -* ``cbs``: Committed Burst Size (CBS) (bytes). -* ``ebs``: Excess Burst Size (EBS) (bytes). +* ``cir``: Committed Information Rate (CIR) (bytes per second or packets per second). +* ``cbs``: Committed Burst Size (CBS) (bytes or packets). +* ``ebs``: Excess Burst Size (EBS) (bytes or packets). +* ``packet_mode``: Packets mode for meter profile. add port meter profile (trTCM rfc2968) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2708,15 +2732,16 @@ add port meter profile (trTCM rfc2968) Add meter profile (srTCM rfc2698) to the ethernet device:: testpmd> add port meter profile trtcm_rfc2698 (port_id) (profile_id) \ - (cir) (pir) (cbs) (pbs) + (cir) (pir) (cbs) (pbs) (packet_mode) where: * ``profile_id``: ID for the meter profile. -* ``cir``: Committed information rate (bytes/second). -* ``pir``: Peak information rate (bytes/second). -* ``cbs``: Committed burst size (bytes). -* ``pbs``: Peak burst size (bytes). +* ``cir``: Committed information rate (bytes per second or packets per second). +* ``pir``: Peak information rate (bytes per second or packets per second). +* ``cbs``: Committed burst size (bytes or packets). +* ``pbs``: Peak burst size (bytes or packets). +* ``packet_mode``: Packets mode for meter profile. add port meter profile (trTCM rfc4115) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2724,15 +2749,16 @@ add port meter profile (trTCM rfc4115) Add meter profile (trTCM rfc4115) to the ethernet device:: testpmd> add port meter profile trtcm_rfc4115 (port_id) (profile_id) \ - (cir) (eir) (cbs) (ebs) + (cir) (eir) (cbs) (ebs) (packet_mode) where: * ``profile_id``: ID for the meter profile. -* ``cir``: Committed information rate (bytes/second). -* ``eir``: Excess information rate (bytes/second). -* ``cbs``: Committed burst size (bytes). -* ``ebs``: Excess burst size (bytes). +* ``cir``: Committed information rate (bytes per second or packets per second). +* ``eir``: Excess information rate (bytes per second or packets per second). +* ``cbs``: Committed burst size (bytes or packets). +* ``ebs``: Excess burst size (bytes or packets). +* ``packet_mode``: Packets mode for meter profile. delete port meter profile ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -3309,7 +3335,11 @@ following sections. - Dump internal representation information of all flows in hardware:: - flow dump {port_id} {output_file} + flow dump {port_id} all {output_file} + + for one flow:: + + flow dump {port_id} rule {rule_id} {output_file} - List and destroy aged flow rules:: @@ -4836,6 +4866,64 @@ if seid is set):: testpmd> flow create 0 ingress pattern eth / ipv6 / pfcp s_field is 1 seid is 1 / end actions queue index 3 / end +Sample Sampling/Mirroring rules +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sample/Mirroring rules can be set by the following commands + +NIC-RX Sampling rule, the matched ingress packets and sent to the queue 1, +and 50% packets are duplicated and marked with 0x1234 and sent to queue 0. + +:: + + testpmd> set sample_actions 0 mark id 0x1234 / queue index 0 / end + testpmd> flow create 0 ingress group 1 pattern eth / end actions + sample ratio 2 index 0 / queue index 1 / end + +Mirroring rule with port representors (with "transfer" attribute), the matched +ingress packets with encapsulation header are sent to port id 0, and also +mirrored the packets and sent to port id 2. + +:: + + testpmd> set sample_actions 0 port_id id 2 / end + testpmd> flow create 1 ingress transfer pattern eth / end actions + sample ratio 1 index 0 / raw_encap / port_id id 0 / end + +Mirroring rule with port representors (with "transfer" attribute), the matched +ingress packets are sent to port id 2, and also mirrored the packets with +encapsulation header and sent to port id 0. + +:: + + testpmd> set sample_actions 0 raw_encap / port_id id 0 / end + testpmd> flow create 0 ingress transfer pattern eth / end actions + sample ratio 1 index 0 / port_id id 2 / end + +Mirroring rule with port representors (with "transfer" attribute), the matched +ingress packets are sent to port id 2, and also mirrored the packets with +VXLAN encapsulation header and sent to port id 0. + +:: + + testpmd> set vxlan ip-version ipv4 vni 4 udp-src 4 udp-dst 4 ip-src 127.0.0.1 + ip-dst 128.0.0.1 eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22 + testpmd> set sample_actions 0 vxlan_encap / port_id id 0 / end + testpmd> flow create 0 ingress transfer pattern eth / end actions + sample ratio 1 index 0 / port_id id 2 / end + +Mirroring rule with port representors (with "transfer" attribute), the matched +ingress packets are sent to port id 2, and also mirrored the packets with +NVGRE encapsulation header and sent to port id 0. + +:: + + testpmd> set nvgre ip-version ipv4 tni 4 ip-src 127.0.0.1 ip-dst 128.0.0.1 + eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22 + testpmd> set sample_actions 0 nvgre_encap / port_id id 0 / end + testpmd> flow create 0 ingress transfer pattern eth / end actions + sample ratio 1 index 0 / port_id id 2 / end + BPF Functions --------------