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