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