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