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