xref: /dpdk/doc/guides/testpmd_app_ug/testpmd_funcs.rst (revision c22f2fee1677afa05f78513c89480839d9e1dcfb)
1..  BSD LICENSE
2    Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
3    All rights reserved.
4
5    Redistribution and use in source and binary forms, with or without
6    modification, are permitted provided that the following conditions
7    are met:
8
9    * Redistributions of source code must retain the above copyright
10    notice, this list of conditions and the following disclaimer.
11    * Redistributions in binary form must reproduce the above copyright
12    notice, this list of conditions and the following disclaimer in
13    the documentation and/or other materials provided with the
14    distribution.
15    * Neither the name of Intel Corporation nor the names of its
16    contributors may be used to endorse or promote products derived
17    from this software without specific prior written permission.
18
19    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31Testpmd Runtime Functions
32=========================
33
34Where the testpmd application is started in interactive mode, (-i|--interactive),
35it displays a prompt that can be used to start and stop forwarding,
36configure the application, display statistics, set the Flow Director and other tasks.
37
38.. code-block:: console
39
40    testpmd>
41
42The testpmd prompt has some, limited, readline support.
43Common bash command- line functions such as Ctrl+a and Ctrl+e to go to the start and end of the prompt line are supported
44as well as access to the command history via the up-arrow.
45
46There is also support for tab completion.
47If you type a partial command and hit <TAB> you get a list of the available completions:
48
49.. code-block:: console
50
51    testpmd> show port <TAB>
52
53        info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap X
54        info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap all
55        stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap X
56        stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap all
57        ...
58
59Help Functions
60--------------
61
62The testpmd has on-line help for the functions that are available at runtime.
63These are divided into sections and can be accessed using help, help section or help all:
64
65.. code-block:: console
66
67    testpmd> help
68
69        Help is available for the following sections:
70        help control    : Start and stop forwarding.
71        help display    : Displaying port, stats and config information.
72        help config     : Configuration information.
73        help ports      : Configuring ports.
74        help registers  : Reading and setting port registers.
75        help filters    : Filters configuration help.
76        help all        : All of the above sections.
77
78Control Functions
79-----------------
80
81start
82~~~~~
83
84Start packet forwarding with current configuration:
85
86start
87
88start tx_first
89~~~~~~~~~~~~~~
90
91Start packet forwarding with current configuration after sending one burst of packets:
92
93start tx_first
94
95stop
96~~~~
97
98Stop packet forwarding, and display accumulated statistics:
99
100stop
101
102quit
103~~~~
104
105Quit to prompt:
106
107quit
108
109Display Functions
110-----------------
111
112The functions in the following sections are used to display information about the
113testpmd configuration or the NIC status.
114
115show port
116~~~~~~~~~
117
118Display information for a given port or all ports:
119
120show port (info|stats|fdir|stat_qmap) (port_id|all)
121
122The available information categories are:
123
124info    : General port information such as MAC address.
125
126stats   : RX/TX statistics.
127
128fdir    : Flow Director information and statistics.
129
130stat_qmap : Queue statistics mapping.
131
132For example:
133
134.. code-block:: console
135
136    testpmd> show port info 0
137
138    ********************* Infos for port 0 *********************
139
140    MAC address: XX:XX:XX:XX:XX:XX
141    Link status: up
142    Link speed: 10000 Mbps
143    Link duplex: full-duplex
144    Promiscuous mode: enabled
145    Allmulticast mode: disabled
146    Maximum number of MAC addresses: 127
147    VLAN offload:
148        strip on
149        filter on
150        qinq(extend) off
151
152show port rss reta
153~~~~~~~~~~~~~~~~~~
154
155Display the rss redirection table entry indicated by masks on port X:
156
157show port (port_id) rss reta (size) (mask0, mask1...)
158
159size is used to indicate the hardware supported reta size
160
161show port rss-hash
162~~~~~~~~~~~~~~~~~~
163
164Display the RSS hash functions and RSS hash key of a port:
165
166show port (port_id) rss-hash [key]
167
168clear port
169~~~~~~~~~~
170
171Clear the port statistics for a given port or for all ports:
172
173clear port (info|stats|fdir|stat_qmap) (port_id|all)
174
175For example:
176
177.. code-block:: console
178
179    testpmd> clear port stats all
180
181show config
182~~~~~~~~~~~
183
184Displays the configuration of the application.
185The configuration comes from the command-line, the runtime or the application defaults:
186
187show config (rxtx|cores|fwd)
188
189The available information categories are:
190
191rxtx  : RX/TX configuration items.
192
193cores : List of forwarding cores.
194
195fwd   : Packet forwarding configuration.
196
197For example:
198
199.. code-block:: console
200
201    testpmd> show config rxtx
202
203    io packet forwarding - CRC stripping disabled - packets/burst=16
204    nb forwarding cores=2 - nb forwarding ports=1
205    RX queues=1 - RX desc=128 - RX free threshold=0
206    RX threshold registers: pthresh=8 hthresh=8 wthresh=4
207    TX queues=1 - TX desc=512 - TX free threshold=0
208    TX threshold registers: pthresh=36 hthresh=0 wthresh=0
209    TX RS bit threshold=0 - TXQ flags=0x0
210
211read rxd
212~~~~~~~~
213
214Display an RX descriptor for a port RX queue:
215
216read rxd (port_id) (queue_id) (rxd_id)
217
218For example:
219
220.. code-block:: console
221
222    testpmd> read rxd 0 0 4
223        0x0000000B - 0x001D0180 / 0x0000000B - 0x001D0180
224
225read txd
226~~~~~~~~
227
228Display a TX descriptor for a port TX queue:
229
230read txd (port_id) (queue_id) (txd_id)
231
232For example:
233
234.. code-block:: console
235
236    testpmd> read txd 0 0 4
237        0x00000001 - 0x24C3C440 / 0x000F0000 - 0x2330003C
238
239Configuration Functions
240-----------------------
241
242The testpmd application can be configured from the runtime as well as from the command-line.
243
244This section details the available configuration functions that are available.
245
246.. note::
247
248    Configuration changes only become active when forwarding is started/restarted.
249
250set default
251~~~~~~~~~~~
252
253Reset forwarding to the default configuration:
254
255set default
256
257set verbose
258~~~~~~~~~~~
259
260Set the debug verbosity level:
261
262set verbose (level)
263
264Currently the only available levels are 0 (silent except for error) and 1 (fully verbose).
265
266set nbport
267~~~~~~~~~~
268
269Set the number of ports used by the application:
270
271set nbport (num)
272
273This is equivalent to the --nb-ports command-line option.
274
275set nbcore
276~~~~~~~~~~
277
278Set the number of cores used by the application:
279
280set nbcore (num)
281
282This is equivalent to the --nb-cores command-line option.
283
284.. note::
285
286    The number of cores used must not be greater than number of ports used multiplied by the number of queues per port.
287
288set coremask
289~~~~~~~~~~~~
290
291Set the forwarding cores hexadecimal mask:
292
293set coremask (mask)
294
295This is equivalent to the --coremask command-line option.
296
297.. note::
298
299    The master lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
300
301set portmask
302~~~~~~~~~~~~
303
304Set the forwarding ports hexadecimal mask:
305
306set portmask (mask)
307
308This is equivalent to the --portmask command-line option.
309
310set burst
311~~~~~~~~~
312
313Set number of packets per burst:
314
315set burst (num)
316
317This is equivalent to the --burst command-line option.
318
319In mac_retry forwarding mode, the transmit delay time and number of retries can also be set.
320
321set burst tx delay (micrseconds) retry (num)
322
323set txpkts
324~~~~~~~~~~
325
326Set the length of each segment of the TX-ONLY packets:
327
328set txpkts (x[,y]*)
329
330Where x[,y]* represents a CSV list of values, without white space.
331
332set corelist
333~~~~~~~~~~~~
334
335Set the list of forwarding cores:
336
337set corelist (x[,y]*)
338
339For example, to change the forwarding cores:
340
341.. code-block:: console
342
343    testpmd> set corelist 3,1
344    testpmd> show config fwd
345
346    io packet forwarding - ports=2 - cores=2 - streams=2 - NUMA support disabled
347    Logical Core 3 (socket 0) forwards packets on 1 streams:
348    RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
349    Logical Core 1 (socket 0) forwards packets on 1 streams:
350    RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
351
352.. note::
353
354    The cores are used in the same order as specified on the command line.
355
356set portlist
357~~~~~~~~~~~~
358
359Set the list of forwarding ports:
360
361set portlist (x[,y]*)
362
363For example, to change the port forwarding:
364
365.. code-block:: console
366
367    testpmd> set portlist 0,2,1,3
368    testpmd> show config fwd
369
370    io packet forwarding - ports=4 - cores=1 - streams=4
371    Logical Core 3 (socket 0) forwards packets on 4 streams:
372    RX P=0/Q=0 (socket 0) -> TX P=2/Q=0 (socket 0) peer=02:00:00:00:00:01
373    RX P=2/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
374    RX P=1/Q=0 (socket 0) -> TX P=3/Q=0 (socket 0) peer=02:00:00:00:00:03
375    RX P=3/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:02
376
377vlan set strip
378~~~~~~~~~~~~~~
379
380Set the VLAN strip on a port:
381
382vlan set strip (on|off) (port_id)
383
384vlan set stripq
385~~~~~~~~~~~~~~~
386
387Set the VLAN strip for a queue on a port:
388
389vlan set stripq (on|off) (port_id,queue_id)
390
391vlan set filter
392~~~~~~~~~~~~~~~
393
394Set the VLAN filter on a port:
395
396vlan set filter (on|off) (port_id)
397
398vlan set qinq
399~~~~~~~~~~~~~
400
401Set the VLAN QinQ (extended queue in queue) on for a port:
402
403vlan set qinq (on|off) (port_id)
404
405vlan set tpid
406~~~~~~~~~~~~~
407
408Set the outer VLAN TPID for packet filtering on a port:
409
410vlan set tpid (value) (port_id)
411
412.. note::
413
414    TPID value must be a 16-bit number (value <= 65536).
415
416rx_vlan add
417~~~~~~~~~~~
418
419Add a VLAN ID, or all identifiers, to the set of VLAN identifiers filtered by port ID:
420
421rx_vlan add (vlan_id|all) (port_id)
422
423.. note::
424
425    VLAN filter must be set on that port. VLAN ID < 4096.
426    Depending on the NIC used, number of vlan_ids may be limited to the maximum entries
427    in VFTA table. This is important if enabling all vlan_ids.
428
429rx_vlan rm
430~~~~~~~~~~
431
432Remove a VLAN ID, or all identifiers, from the set of VLAN identifiers filtered by port ID:
433
434rx_vlan rm (vlan_id|all) (port_id)
435
436rx_vlan add(for VF)
437~~~~~~~~~~~~~~~~~~~
438
439Add a VLAN ID, to the set of VLAN identifiers filtered for VF(s) for port ID:
440
441rx_vlan add (vlan_id) port (port_id) vf (vf_mask)
442
443rx_vlan rm(for VF)
444~~~~~~~~~~~~~~~~~~
445
446Remove a VLAN ID, from the set of VLAN identifiers filtered for VF(s) for port ID:
447
448rx_vlan rm (vlan_id) port (port_id) vf (vf_mask)
449
450rx_vlan set tpid
451~~~~~~~~~~~~~~~~
452
453Set the outer VLAN TPID for packet filtering on a port:
454
455rx_vlan set tpid (value) (port_id)
456
457tunnel_filter add
458~~~~~~~~~~~~~~~~~
459
460Add a tunnel filter on a port:
461
462tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) (inner_vlan)
463 (tunnel_type) (filter_type) (tenant_id) (queue_id)
464
465tunnel_filter remove
466~~~~~~~~~~~~~~~~~~~~
467
468Remove a tunnel filter on a port:
469
470tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) (inner_vlan)
471 (tunnel_type) (filter_type) (tenant_id) (queue_id)
472
473rx_vxlan_port add
474~~~~~~~~~~~~~~~~~
475
476Add an UDP port for VXLAN packet filter on a port:
477
478rx_vxlan_port add (udp_port) (port_id)
479
480rx_vxlan_port remove
481~~~~~~~~~~~~~~~~~~~~
482
483Remove an UDP port for VXLAN packet filter on a port:
484
485rx_vxlan_port rm (udp_port) (port_id)
486
487tx_vlan set
488~~~~~~~~~~~
489
490Set hardware insertion of VLAN ID in packets sent on a port:
491
492tx_vlan set (vlan_id) (port_id)
493
494tx_vlan set pvid
495~~~~~~~~~~~~~~~~
496
497Set port based hardware insertion of VLAN ID in pacekts sent on a port:
498
499tx_vlan set pvid (port_id) (vlan_id) (on|off)
500
501tx_vlan reset
502~~~~~~~~~~~~~
503
504Disable hardware insertion of a VLAN header in packets sent on a port:
505
506tx_vlan reset (port_id)
507
508csum set
509~~~~~~~~
510
511Select hardware or software calculation of the checksum when
512transmitting a packet using the csum forward engine:
513
514csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)
515
516- ip|udp|tcp|sctp always concern the inner layer.
517
518- outer-ip concerns the outer IP layer in case the packet is recognized
519  as a tunnel packet by the forward engine (vxlan, gre and ipip are
520  supported). See "csum parse-tunnel" command.
521
522.. note::
523
524    Check the NIC Datasheet for hardware limits.
525
526csum parse-tunnel
527~~~~~~~~~~~~~~~~~
528
529Define how tunneled packets should be handled by the csum forward
530engine.
531
532csum parse-tunnel (on|off) (tx_port_id)
533
534If enabled, the csum forward engine will try to recognize supported
535tunnel headers (vxlan, gre, ipip).
536
537If disabled, treat tunnel packets as non-tunneled packets (a inner
538header is handled as a packet payload).
539
540.. note::
541
542   The port argument is the TX port like in the "csum set" command.
543
544Example:
545
546Consider a packet as following:
547"eth_out/ipv4_out/udp_out/vxlan/eth_in/ipv4_in/tcp_in"
548
549- If parse-tunnel is enabled, the ip|udp|tcp|sctp parameters of "csum
550  set" command are about inner headers (here ipv4_in and tcp_in), and the
551  outer-ip parameter is about outer headers (here ipv4_out).
552
553- If parse-tunnel is disabled, the ip|udp|tcp|sctp parameters of "csum
554  set" command are about outer headers, here ipv4_out and udp_out.
555
556csum show
557~~~~~~~~~
558
559Display tx checksum offload configuration:
560
561csum show (port_id)
562
563tso set
564~~~~~~~
565
566Enable TCP Segmentation Offload in csum forward engine:
567
568tso set (segsize) (port_id)
569
570.. note::
571
572   Check the NIC datasheet for hardware limits
573
574tso show
575~~~~~~~~
576
577Display the status of TCP Segmentation Offload:
578
579tso show (port_id)
580
581set fwd
582~~~~~~~
583
584Set the packet forwarding mode:
585
586set fwd (io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho)
587
588The available information categories are:
589
590*   io: forwards packets "as-is" in I/O mode.
591    This is the fastest possible forwarding operation as it does not access packets data.
592    This is the default mode.
593
594*   mac: changes the source and the destination Ethernet addresses of packets before forwarding them.
595
596*   mac_retry: same as "mac" forwarding mode, but includes retries if the destination queue is full.
597
598*   macswap: MAC swap forwarding mode.
599    Swaps the source and the destination Ethernet addresses of packets before forwarding them.
600
601*   flowgen: multi-flow generation mode.
602    Originates a bunch of flows (varying destination IP addresses), and terminate receive traffic.
603
604*   rxonly: receives packets but doesn't transmit them.
605
606*   txonly: generates and transmits packets without receiving any.
607
608*   csum: changes the checksum field with HW or SW methods depending on the offload flags on the packet.
609
610*   icmpecho: receives a burst of packets, lookup for IMCP echo requests and, if any, send back ICMP echo replies.
611
612
613Example:
614
615.. code-block:: console
616
617    testpmd> set fwd rxonly
618
619    Set rxonly packet forwarding mode
620
621mac_addr add
622~~~~~~~~~~~~
623
624Add an alternative MAC address to a port:
625
626mac_addr add (port_id) (XX:XX:XX:XX:XX:XX)
627
628mac_addr remove
629~~~~~~~~~~~~~~~
630
631Remove a MAC address from a port:
632
633mac_addr remove (port_id) (XX:XX:XX:XX:XX:XX)
634
635mac_addr add(for VF)
636~~~~~~~~~~~~~~~~~~~~
637
638Add an alternative MAC address for a VF to a port:
639
640mac_add add port (port_id) vf (vf_id) (XX:XX:XX:XX:XX:XX)
641
642set port-uta
643~~~~~~~~~~~~
644
645Set the unicast hash filter(s) on/off for a port X:
646
647set port (port_id) uta (XX:XX:XX:XX:XX:XX|all) (on|off)
648
649set promisc
650~~~~~~~~~~~
651
652Set the promiscuous mode on for a port or for all ports.
653In promiscuous mode packets are not dropped if they aren't for the specified MAC address:
654
655set promisc (port_id|all) (on|off)
656
657set allmulti
658~~~~~~~~~~~~
659
660Set the allmulti mode for a port or for all ports:
661
662set allmulti (port_id|all) (on|off)
663
664Same as the ifconfig (8) option. Controls how multicast packets are handled.
665
666set flow_ctrl rx
667~~~~~~~~~~~~~~~~
668
669Set the link flow control parameter on a port:
670
671set flow_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \
672(pause_time) (send_xon) (port_id)
673
674Where:
675
676high_water (integer): High threshold value to trigger XOFF.
677
678low_water (integer) : Low threshold value to trigger XON.
679
680pause_time (integer): Pause quota in the Pause frame.
681
682send_xon (0/1) : Send XON frame.
683
684mac_ctrl_frame_fwd : Enable receiving MAC control frames
685
686set pfc_ctrl rx
687~~~~~~~~~~~~~~~
688
689Set the priority flow control parameter on a port:
690
691set pfc_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \ (pause_time) (priority) (port_id)
692
693Where:
694
695priority (0-7): VLAN User Priority.
696
697set stat_qmap
698~~~~~~~~~~~~~
699
700Set statistics mapping (qmapping 0..15) for RX/TX queue on port:
701
702set stat_qmap (tx|rx) (port_id) (queue_id) (qmapping)
703
704For example, to set rx queue 2 on port 0 to mapping 5:
705
706.. code-block:: console
707
708     testpmd>set stat_qmap rx 0 2 5
709
710set port - rx/tx(for VF)
711~~~~~~~~~~~~~~~~~~~~~~~~
712
713Set VF receive/transmit from a port:
714
715set port (port_id) vf (vf_id) (rx|tx) (on|off)
716
717set port - mac address filter (for VF)
718~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
719
720Add/Remove unicast or multicast MAC addr filter for a VF:
721
722set port (port_id) vf (vf_id) (mac_addr)
723 (exact-mac|exact-mac-vlan|hashmac|hashmac-vlan) (on|off)
724
725set port - rx mode(for VF)
726~~~~~~~~~~~~~~~~~~~~~~~~~~
727
728Set the VF receive mode of a port:
729
730set port (port_id) vf (vf_id) rxmode (AUPE|ROPE|BAM|MPE) (on|off)
731
732The available receive modes are:
733
734*  AUPE: accepts untagged VLAN.
735
736*  ROPE: accepts unicast hash.
737
738*  BAM: accepts broadcast packets
739
740*  MPE: accepts all multicast packets
741
742set port - tx_rate (for Queue)
743~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
744
745Set TX rate limitation for queue of a port ID:
746
747set port (port_id) queue (queue_id) rate (rate_value)
748
749set port - tx_rate (for VF)
750~~~~~~~~~~~~~~~~~~~~~~~~~~~
751
752Set TX rate limitation for queues in VF of a port ID:
753
754set port (port_id) vf (vf_id) rate (rate_value) queue_mask (queue_mask)
755
756set port - mirror rule
757~~~~~~~~~~~~~~~~~~~~~~
758
759Set port or vlan type mirror rule for a port.
760
761set port (port_id) mirror-rule (rule_id) (pool-mirror|vlan-mirror) (poolmask|vlanid[,vlanid]*) dst-pool (pool_id) (on|off)
762
763For example to enable mirror traffic with vlan 0,1 to pool 0:
764
765.. code-block:: console
766
767    set port 0 mirror-rule 0 vlan-mirror 0,1 dst-pool 0 on
768
769reset port - mirror rule
770~~~~~~~~~~~~~~~~~~~~~~~~
771
772Reset a mirror rule for a port.
773
774reset port (port_id) mirror-rule (rule_id)
775
776set flush_rx
777~~~~~~~~~~~~
778
779Flush (default) or don't flush RX streams before forwarding.
780Mainly used with PCAP drivers to avoid the default behavior of flushing the first 512 packets on RX streams.
781
782set flush_rx off
783
784set bypass mode
785~~~~~~~~~~~~~~~
786
787Set the bypass mode for the lowest port on bypass enabled NIC.
788
789set bypass mode (normal|bypass|isolate) (port_id)
790
791set bypass event
792~~~~~~~~~~~~~~~~
793
794Set the event required to initiate specified bypass mode for the lowest port on a bypass enabled NIC where:
795
796*   timeout: enable bypass after watchdog timeout.
797
798*   os_on: enable bypass when OS/board is powered on.
799
800*   os_off: enable bypass when OS/board is powered off.
801
802*   power_on: enable bypass when power supply is turned on.
803
804*   power_off: enable bypass when power supply is turned off.
805
806set bypass event (timeout|os_on|os_off|power_on|power_off) mode (normal|bypass|isolate) (port_id)
807
808set bypass timeout
809~~~~~~~~~~~~~~~~~~
810
811Set the bypass watchdog timeout to 'n' seconds where 0 = instant.
812
813set bypass timeout (0|1.5|2|3|4|8|16|32)
814
815show bypass config
816~~~~~~~~~~~~~~~~~~
817
818Show the bypass configuration for a bypass enabled NIC using the lowest port on the NIC.
819
820show bypass config (port_id)
821
822set link up
823~~~~~~~~~~~
824
825Set link up for a port.
826
827set link-up port (port id)
828
829set link down
830~~~~~~~~~~~~~
831
832Set link down for a port.
833
834set link-down port (port id)
835
836Port Functions
837--------------
838
839The following sections show functions for configuring ports.
840
841.. note::
842
843    Port configuration changes only become active when forwarding is started/restarted.
844
845port attach
846~~~~~~~~~~~
847
848Attach a port specified by pci address or virtual device args.
849
850To attach a new pci device, the device should be recognized by kernel first.
851Then it should be moved under DPDK management.
852Finally the port can be attached to testpmd.
853On the other hand, to attach a port created by virtual device, above steps are not needed.
854
855port attach (identifier)
856
857For example, to attach a port whose pci address is 0000:02:00.0.
858
859.. code-block:: console
860
861    testpmd> port attach 0000:02:00.0
862    Attaching a new port...
863    ... snip ...
864    Port 0 is attached. Now total ports is 1
865    Done
866
867For example, to attach a port created by pcap PMD.
868
869.. code-block:: console
870
871    testpmd> port attach eth_pcap0,iface=eth0
872    Attaching a new port...
873    ... snip ...
874    Port 0 is attached. Now total ports is 1
875    Done
876
877In this case, identifier is "eth_pcap0,iface=eth0".
878This identifier format is the same as "--vdev" format of DPDK applications.
879
880port detach
881~~~~~~~~~~~
882
883Detach a specific port.
884
885Before detaching a port, the port should be closed.
886Also to remove a pci device completely from the system, first detach the port from testpmd.
887Then the device should be moved under kernel management.
888Finally the device can be removed using kernel pci hotplug functionality.
889On the other hand, to remove a port created by a virtual device, above steps are not needed.
890
891port detach (port_id)
892
893For example, to detach a port 0.
894
895.. code-block:: console
896
897    testpmd> port detach 0
898    Detaching a port...
899    ... snip ...
900    Done
901
902port start
903~~~~~~~~~~
904
905Start all ports or a specific port:
906
907port start (port_id|all)
908
909port stop
910~~~~~~~~~
911
912Stop all ports or a specific port:
913
914port stop (port_id|all)
915
916port close
917~~~~~~~~~~
918
919Close all ports or a specific port:
920
921port close (port_id|all)
922
923port start/stop queue
924~~~~~~~~~~~~~~~~~~~~~
925
926Start/stop a rx/tx queue on a specific port:
927
928port (port_id) (rxq|txq) (queue_id) (start|stop)
929
930Only take effect when port is started.
931
932port config - speed
933~~~~~~~~~~~~~~~~~~~
934
935Set the speed and duplex mode for all ports or a specific port:
936
937port config (port_id|all) speed (10|100|1000|10000|auto) duplex (half|full|auto)
938
939port config - queues/descriptors
940~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
941
942Set number of queues/descriptors for rxq, txq, rxd and txd:
943
944port config all (rxq|txq|rxd|txd) (value)
945
946This is equivalent to the --rxq, --txq, --rxd and --txd command-line options.
947
948port config - max-pkt-len
949~~~~~~~~~~~~~~~~~~~~~~~~~
950
951Set the maximum packet length:
952
953port config all max-pkt-len (value)
954
955This is equivalent to the --max-pkt-len command-line option.
956
957port config - CRC Strip
958~~~~~~~~~~~~~~~~~~~~~~~
959
960Set hardware CRC stripping on or off for all ports:
961
962port config all crc-strip (on|off)
963
964CRC stripping is off by default.
965
966The on option is equivalent to the --crc-strip command-line option.
967
968port config - RX Checksum
969~~~~~~~~~~~~~~~~~~~~~~~~~
970
971Set hardware RX checksum offload to on or off for all ports:
972
973port config all rx-cksum (on|off)
974
975Checksum offload is off by default.
976
977The on option is equivalent to the --enable-rx-cksum command-line option.
978
979port config - VLAN
980~~~~~~~~~~~~~~~~~~
981
982Set hardware VLAN on or off for all ports:
983
984port config all hw-vlan (on|off)
985
986Hardware VLAN is on by default.
987
988The off option is equivalent to the --disable-hw-vlan command-line option.
989
990port config - VLAN filter
991~~~~~~~~~~~~~~~~~~~~~~~~~
992
993Set hardware VLAN filter on or off for all ports:
994
995port config all hw-vlan-filter (on|off)
996
997Hardware VLAN filter is on by default.
998
999The off option is equivalent to the --disable-hw-vlan-filter command-line option.
1000
1001port config - VLAN strip
1002~~~~~~~~~~~~~~~~~~~~~~~~
1003
1004Set hardware VLAN strip on or off for all ports:
1005
1006port config all hw-vlan-strip (on|off)
1007
1008Hardware VLAN strip is on by default.
1009
1010The off option is equivalent to the --disable-hw-vlan-strip command-line option.
1011
1012port config - VLAN extend
1013~~~~~~~~~~~~~~~~~~~~~~~~~
1014
1015Set hardware VLAN extend on or off for all ports:
1016
1017port config all hw-vlan-extend (on|off)
1018
1019Hardware VLAN extend is off by default.
1020
1021The off option is equivalent to the --disable-hw-vlan-extend command-line option.
1022
1023port config - Drop Packets
1024~~~~~~~~~~~~~~~~~~~~~~~~~~
1025
1026Set packet drop for packets with no descriptors on or off for all ports:
1027
1028port config all drop-en (on|off)
1029
1030Packet dropping for packets with no descriptors is off by default.
1031
1032The on option is equivalent to the --enable-drop-en command-line option.
1033
1034port config - RSS
1035~~~~~~~~~~~~~~~~~
1036
1037Set the RSS (Receive Side Scaling) mode on or off:
1038
1039port config all rss (ip|udp|none)
1040
1041RSS is on by default.
1042
1043The off option is equivalent to the --disable-rss command-line option.
1044
1045port config - RSS Reta
1046~~~~~~~~~~~~~~~~~~~~~~
1047
1048Set the RSS (Receive Side Scaling) redirection table:
1049
1050port config all rss reta (hash,queue)[,(hash,queue)]
1051
1052port config - DCB
1053~~~~~~~~~~~~~~~~~
1054
1055Set the DCB mode for an individual port:
1056
1057port config (port_id) dcb vt (on|off) (traffic_class) pfc (on|off)
1058
1059The traffic class should be 4 or 8.
1060
1061port config - Burst
1062~~~~~~~~~~~~~~~~~~~
1063
1064Set the number of packets per burst:
1065
1066port config all burst (value)
1067
1068This is equivalent to the --burst command-line option.
1069
1070port config - Threshold
1071~~~~~~~~~~~~~~~~~~~~~~~
1072
1073Set thresholds for TX/RX queues:
1074
1075port config all (threshold) (value)
1076
1077Where the threshold type can be:
1078
1079*   txpt: Set the prefetch threshold register of the TX rings, 0 <= value <= 255.
1080
1081*   txht: Set the host threshold register of the TX rings, 0 <= value <= 255.
1082
1083*   txwt: Set the write-back threshold register of the TX rings, 0 <= value <= 255.
1084
1085*   rxpt: Set the prefetch threshold register of the RX rings, 0 <= value <= 255.
1086
1087*   rxht: Set the host threshold register of the RX rings, 0 <= value <= 255.
1088
1089*   rxwt: Set the write-back threshold register of the RX rings, 0 <= value <= 255.
1090
1091*   txfreet: Set the transmit free threshold of the TX rings, 0 <= value <= txd.
1092
1093*   rxfreet: Set the transmit free threshold of the RX rings, 0 <= value <= rxd.
1094
1095*   txrst: Set the transmit RS bit threshold of TX rings, 0 <= value <= txd.
1096    These threshold options are also available from the command-line.
1097
1098Link Bonding Functions
1099----------------------
1100
1101The Link Bonding functions make it possible to dynamically create and
1102manage link bonding devices from within testpmd interactive prompt.
1103
1104create bonded device
1105~~~~~~~~~~~~~~~~~~~~
1106
1107Create a new bonding device:
1108
1109create bonded device (mode) (socket)
1110
1111For example, to create a bonded device in mode 1 on socket 0.
1112
1113.. code-block:: console
1114
1115    testpmd> create bonded 1 0
1116    created new bonded device (port X)
1117
1118add bonding slave
1119~~~~~~~~~~~~~~~~~
1120
1121Adds Ethernet device to a Link Bonding device:
1122
1123add bonding slave (slave id) (port id)
1124
1125For example, to add Ethernet device (port 6) to a Link Bonding device (port 10).
1126
1127.. code-block:: console
1128
1129    testpmd> add bonding slave 6 10
1130
1131
1132remove bonding slave
1133~~~~~~~~~~~~~~~~~~~~
1134
1135Removes an Ethernet slave device from a Link Bonding device:
1136
1137remove bonding slave (slave id) (port id)
1138
1139For example, to remove Ethernet slave device (port 6) to a Link Bonding device (port 10).
1140
1141.. code-block:: console
1142
1143    testpmd> remove bonding slave 6 10
1144
1145set bonding mode
1146~~~~~~~~~~~~~~~~
1147
1148Set the Link Bonding mode of a Link Bonding device:
1149
1150set bonding mode (value) (port id)
1151
1152For example, to set the bonding mode of a Link Bonding device (port 10) to broadcast (mode 3).
1153
1154.. code-block:: console
1155
1156    testpmd> set bonding mode 3 10
1157
1158set bonding primary
1159~~~~~~~~~~~~~~~~~~~
1160
1161Set an Ethernet slave device as the primary device on a Link Bonding device:
1162
1163set bonding primary (slave id) (port id)
1164
1165For example, to set the Ethernet slave device (port 6) as the primary port of a Link Bonding device (port 10).
1166
1167.. code-block:: console
1168
1169    testpmd> set bonding primary 6 10
1170
1171set bonding mac
1172~~~~~~~~~~~~~~~
1173
1174Set the MAC address of a Link Bonding device:
1175
1176set bonding mac (port id) (mac)
1177
1178For example, to set the MAC address of a Link Bonding device (port 10) to 00:00:00:00:00:01
1179
1180.. code-block:: console
1181
1182    testpmd> set bonding mac 10 00:00:00:00:00:01
1183
1184set bonding xmit_balance_policy
1185~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1186
1187Set the transmission policy for a Link Bonding device when it is in Balance XOR mode:
1188
1189set bonding xmit_balance_policy (port_id) (l2|l23|l34)
1190
1191For example, set a Link Bonding device (port 10) to use a balance policy of layer 3+4 (IP addresses & UDP ports )
1192
1193.. code-block:: console
1194
1195    testpmd> set bonding xmit_balance_policy 10 l34
1196
1197
1198set bonding mon_period
1199~~~~~~~~~~~~~~~~~~~~~~
1200
1201Set the link status monitoring polling period in milliseconds for a bonding devicie.
1202
1203This adds support for PMD slave devices which do not support link status interrupts.
1204When the mon_period is set to a value greater than 0 then all PMD's which do not support
1205link status ISR will be queried every polling interval to check if their link status has changed.
1206
1207set bonding mon_period (port_id) (value)
1208
1209For example, to set the link status monitoring polling period of bonded device (port 5) to 150ms
1210
1211.. code-block:: console
1212
1213    testpmd> set bonding mon_period 5 150
1214
1215
1216show bonding config
1217~~~~~~~~~~~~~~~~~~~
1218
1219Show the current configuration of a Link Bonding device:
1220
1221show bonding config (port id)
1222
1223For example,
1224to show the configuration a Link Bonding device (port 9) with 3 slave devices (1, 3, 4)
1225in balance mode with a transmission policy of layer 2+3.
1226
1227.. code-block:: console
1228
1229    testpmd> show bonding config 9
1230        Bonding mode: 2
1231        Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER23
1232        Slaves (3): [1 3 4]
1233        Active Slaves (3): [1 3 4]
1234        Primary: [3]
1235
1236Register Functions
1237------------------
1238
1239The Register functions can be used to read from and write to registers on the network card referenced by a port number.
1240This is mainly useful for debugging purposes.
1241Reference should be made to the appropriate datasheet for the network card for details on the register addresses
1242and fields that can be accessed.
1243
1244read reg
1245~~~~~~~~
1246
1247Display the value of a port register:
1248
1249read reg (port_id) (address)
1250
1251For example, to examine the Flow Director control register (FDIRCTL, 0x0000EE000) on an Intel® 82599 10 GbE Controller:
1252
1253.. code-block:: console
1254
1255    testpmd> read reg 0 0xEE00
1256    port 0 PCI register at offset 0xEE00: 0x4A060029 (1241907241)
1257
1258read regfield
1259~~~~~~~~~~~~~
1260
1261Display a port register bit field:
1262
1263read regfield (port_id) (address) (bit_x) (bit_y)
1264
1265For example, reading the lowest two bits from the register in the example above:
1266
1267.. code-block:: console
1268
1269    testpmd> read regfield 0 0xEE00 0 1
1270    port 0 PCI register at offset 0xEE00: bits[0, 1]=0x1 (1)
1271
1272read regbit
1273~~~~~~~~~~~
1274
1275Display a single port register bit:
1276
1277read regbit (port_id) (address) (bit_x)
1278
1279For example, reading the lowest bit from the register in the example above:
1280
1281.. code-block:: console
1282
1283    testpmd> read regbit 0 0xEE00 0
1284    port 0 PCI register at offset 0xEE00: bit 0=1
1285
1286write reg
1287~~~~~~~~~
1288
1289Set the value of a port register:
1290
1291write reg (port_id) (address) (value)
1292
1293For example, to clear a register:
1294
1295.. code-block:: console
1296
1297    testpmd> write reg 0 0xEE00 0x0
1298    port 0 PCI register at offset 0xEE00: 0x00000000 (0)
1299
1300write regfield
1301~~~~~~~~~~~~~~
1302
1303Set bit field of a port register:
1304
1305write regfield (port_id) (address) (bit_x) (bit_y) (value)
1306
1307For example, writing to the register cleared in the example above:
1308
1309.. code-block:: console
1310
1311    testpmd> write regfield 0 0xEE00 0 1 2
1312    port 0 PCI register at offset 0xEE00: 0x00000002 (2)
1313
1314write regbit
1315~~~~~~~~~~~~
1316
1317Set single bit value of a port register:
1318
1319write regbit (port_id) (address) (bit_x) (value)
1320
1321For example, to set the high bit in the register from the example above:
1322
1323.. code-block:: console
1324
1325    testpmd> write regbit 0 0xEE00 31 1
1326    port 0 PCI register at offset 0xEE00: 0x8000000A (2147483658)
1327
1328Filter Functions
1329----------------
1330
1331This section details the available filter functions that are available.
1332
1333ethertype_filter
1334~~~~~~~~~~~~~~~~~~~~
1335
1336Add or delete a L2 Ethertype filter, which identify packets by their L2 Ethertype mainly assign them to a receive queue.
1337
1338ethertype_filter (port_id) (add|del) (mac_addr|mac_ignr) (mac_address) ethertype (ether_type) (drop|fwd) queue (queue_id)
1339
1340The available information parameters are:
1341
1342*   port_id:  the port which the Ethertype filter assigned on.
1343
1344*   mac_addr: compare destination mac address.
1345
1346*   mac_ignr: ignore destination mac address match.
1347
1348*   mac_address: destination mac address to match.
1349
1350*   ether_type: the EtherType value want to match,
1351    for example 0x0806 for ARP packet. 0x0800 (IPv4) and 0x86DD (IPv6) are invalid.
1352
1353*   queue_id : The receive queue associated with this EtherType filter. It is meaningless when deleting or dropping.
1354
1355Example, to add/remove an ethertype filter rule:
1356
1357.. code-block:: console
1358
1359    testpmd> ethertype_filter 0 add mac_ignr ethertype 0x0806 fwd queue 3
1360    testpmd> ethertype_filter 0 del mac_ignr ethertype 0x0806 fwd queue 3
1361
13622tuple_filter
1363~~~~~~~~~~~~~~~~~
1364
1365Add or delete a 2-tuple filter,
1366which identify packets by specific protocol and destination TCP/UDP port
1367and forwards packets into one of the receive queues.
1368
13692tuple_filter (port_id) (add|del) dst_port (dst_port_value) protocol (protocol_value)
1370mask (mask_value) tcp_flags (tcp_flags_value) priority (prio_value) queue (queue_id)
1371
1372The available information parameters are:
1373
1374*   port_id: the port which the 2-tuple filter assigned on.
1375
1376*   dst_port_value: destination port in L4.
1377
1378*   protocol_value: IP L4 protocol.
1379
1380*   mask_value: participates in the match or not by bit for field above, 1b means participate.
1381
1382*   tcp_flags_value: TCP control bits. The non-zero value is invalid, when the pro_value is not set to 0x06 (TCP).
1383
1384*   prio_value: priority of this filter.
1385
1386*   queue_id: The receive queue associated with this 2-tuple filter.
1387
1388Example, to add/remove an 2tuple filter rule:
1389
1390.. code-block:: console
1391
1392    testpmd> 2tuple_filter 0 add dst_port 32 protocol 0x06 mask 0x03 tcp_flags 0x02 priority 3 queue 3
1393    testpmd> 2tuple_filter 0 del dst_port 32 protocol 0x06 mask 0x03 tcp_flags 0x02 priority 3 queue 3
1394
13955tuple_filter
1396~~~~~~~~~~~~~~~~~
1397
1398Add or delete a 5-tuple filter,
1399which consists of a 5-tuple (protocol, source and destination IP addresses, source and destination TCP/UDP/SCTP port)
1400and routes packets into one of the receive queues.
1401
14025tuple_filter (port_id) (add|del) dst_ip (dst_address) src_ip (src_address) dst_port (dst_port_value) src_port (src_port_value)
1403protocol (protocol_value) mask (mask_value) tcp_flags (tcp_flags_value) priority (prio_value) queue (queue_id)
1404
1405The available information parameters are:
1406
1407*   port_id: the port which the 5-tuple filter assigned on.
1408
1409*   dst_address: destination IP address.
1410
1411*   src_address: source IP address.
1412
1413*   dst_port_value: TCP/UDP destination port.
1414
1415*   src_port_value: TCP/UDP source port.
1416
1417*   protocol_value: L4 protocol.
1418
1419*   mask_value: participates in the match or not by bit for field above, 1b means participate
1420
1421*   tcp_flags_value: TCP control bits. The non-zero value is invalid, when the protocol_value is not set to 0x06 (TCP).
1422
1423*   prio_value: the priority of this filter.
1424
1425*   queue_id: The receive queue associated with this 5-tuple filter.
1426
1427Example, to add/remove an 5tuple filter rule:
1428
1429.. code-block:: console
1430
1431    testpmd> 5tuple_filter 0 add dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port 64 src_port 32 protocol 0x06 mask 0x1F flags 0x0 priority 3 queue 3
1432    testpmd> 5tuple_filter 0 del dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port 64 src_port 32 protocol 0x06 mask 0x1F flags 0x0 priority 3 queue 3
1433
1434syn_filter
1435~~~~~~~~~~~~~~
1436
1437By SYN filter, TCP packets whose *SYN* flag is set can be forwarded to a separate queue.
1438
1439syn_filter (port_id) (add|del) priority (high|low) queue (queue_id)
1440
1441The available information parameters are:
1442
1443*   port_id: the port which the SYN filter assigned on.
1444
1445*   high: this SYN filter has higher priority than other filters.
1446
1447*   low: this SYN filter has lower priority than other filters.
1448
1449*   queue_id: The receive queue associated with this SYN filter
1450
1451Example:
1452
1453.. code-block:: console
1454
1455    testpmd> syn_filter 0 add priority high queue 3
1456
1457flex_filter
1458~~~~~~~~~~~
1459
1460With flex filter, packets can be recognized by any arbitrary pattern within the first 128 bytes of the packet
1461and routes packets into one of the receive queues.
1462
1463flex_filter (port_id) (add|del) len (len_value) bytes (bytes_value)
1464mask (mask_value) priority (prio_value) queue (queue_id)
1465
1466The available information parameters are:
1467
1468*   port_id: the port which the Flex filter is assigned on.
1469
1470*   len_value: filter length in bytes, no greater than 128.
1471
1472*   bytes_value: a string in hexadecimal, means the value the flex filter needs to match.
1473
1474*   mask_value: a string in hexadecimal, bit 1 means corresponding byte participates in the match.
1475
1476*   prio_value: the priority of this filter.
1477
1478*   queue_id: the receive queue associated with this Flex filter.
1479
1480Example:
1481
1482.. code-block:: console
1483
1484   testpmd> flex_filter 0 add len 16 bytes 0x00000000000000000000000008060000
1485        mask 000C priority 3 queue 3
1486
1487   testpmd> flex_filter 0 del len 16 bytes 0x00000000000000000000000008060000
1488        mask 000C priority 3 queue 3
1489
1490flow_director_filter
1491~~~~~~~~~~~~~~~~~~~~
1492
1493The Flow Director works in receive mode to identify specific flows or sets of flows and route them to specific queues.
1494
1495Two types of filtering are supported which are referred to as Perfect Match and Signature filters, the match mode
1496is set by the --pkt-filter-mode command-line parameter:
1497
1498*   Perfect match filters.
1499    The hardware checks a match between the masked fields of the received packets and the programmed filters.
1500
1501*   Signature filters.
1502    The hardware checks a match between a hash-based signature of the masked fields of the received packet.
1503
1504The Flow Director filters can match the different fields for different type of packet: flow type, specific input set
1505per flow type and the flexible payload. The Flow Director can also mask out parts of all of these fields so that filters
1506are only applied to certain fields or parts of the fields.
1507
1508Different NICs may have different capabilities, command show port fdir (port_id) can be used to acquire the information.
1509
1510# Commands to add flow director filters of different flow types.
1511
1512flow_director_filter (port_id) (add|del|update) flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)
1513src (src_ip_address) dst (dst_ip_address) vlan (vlan_value) flexbytes (flexbytes_value)
1514(drop|fwd) queue (queue_id) fd_id (fd_id_value)
1515
1516flow_director_filter (port_id) (add|del|update) flow (ipv4-tcp|ipv4-udp|ipv6-tcp|ipv6-udp)
1517src (src_ip_address) (src_port) dst (dst_ip_address) (dst_port) vlan (vlan_value)
1518flexbytes (flexbytes_value) (drop|fwd) queue (queue_id) fd_id (fd_id_value)
1519
1520flow_director_filter (port_id) (add|del|update) flow (ipv4-sctp|ipv6-sctp)
1521src (src_ip_address) (src_port) dst (dst_ip_address) (dst_port) tag (verification_tag)
1522vlan (vlan_value) flexbytes (flexbytes_value) (drop|fwd) queue (queue_id) fd_id (fd_id_value)
1523
1524For example, to add an ipv4-udp flow type filter:
1525
1526.. code-block:: console
1527
1528    testpmd> flow_director_filter 0 add flow ipv4-udp src 2.2.2.3 32 dst 2.2.2.5 33 vlan 0x1 flexbytes (0x88,0x48) fwd queue 1 fd_id 1
1529
1530For example, add an ipv4-other flow type filter:
1531
1532.. code-block:: console
1533
1534    testpmd> flow_director_filter 0 add flow ipv4-other src 2.2.2.3 dst 2.2.2.5 vlan 0x1 flexbytes (0x88,0x48) fwd queue 1 fd_id 1
1535
1536flush_flow_director
1537~~~~~~~~~~~~~~~~~~~
1538
1539flush all flow director filters on a device:
1540
1541flush_flow_director (port_id)
1542
1543Example, to flush all flow director filter on port 0:
1544
1545.. code-block:: console
1546
1547   testpmd> flush_flow_director 0
1548
1549flow_director_mask
1550~~~~~~~~~~~~~~~~~~
1551
1552set flow director's masks on match input set
1553
1554flow_director_mask (port_id) vlan (vlan_value) src_mask (ipv4_src) (ipv6_src) (src_port) dst_mask (ipv4_dst) (ipv6_dst) (dst_port)
1555
1556Example, to set flow director mask on port 0:
1557
1558.. code-block:: console
1559
1560   testpmd> flow_director_mask 0 vlan 0xefff src_mask 255.255.255.255 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0xFFFF dst_mask 255.255.255.255 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0xFFFF
1561
1562
1563flow_director_flex_mask
1564~~~~~~~~~~~~~~~~~~~~~~~
1565
1566set masks of flow director's flexible payload based on certain flow type:
1567
1568flow_director_flex_mask (port_id) flow (none|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|
1569ipv6-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|all) (mask)
1570
1571Example, to set flow director's flex mask for all flow type on port 0:
1572
1573.. code-block:: console
1574
1575   testpmd> flow_director_flex_mask 0 flow all (0xff,0xff,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
1576
1577
1578flow_director_flex_payload
1579~~~~~~~~~~~~~~~~~~~~~~~~~~
1580
1581Configure flexible payload selection.
1582
1583flow_director_flex_payload (port_id) (raw|l2|l3|l4) (config)
1584
1585For example, to select the first 16 bytes from the offset 4 (bytes) of packet's payload as flexible payload.
1586
1587.. code-block:: console
1588
1589   testpmd> flow_director_flex_payload 0 l4 (4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19)
1590