### Meson Setup: Build and Install Documentation Source: https://doc.dpdk.org/guides-25.11/prog_guide/build-sdk-meson.html Enable the build and installation of DPDK documentation. Use the `-Denable_docs=true` option during the initial setup. ```bash # build and install docs meson setup -Denable_docs=true fullbuild ``` -------------------------------- ### Meson Setup to Build Specific Examples Source: https://doc.dpdk.org/guides-25.11/_sources/prog_guide/build-sdk-meson.rst.txt Configure the build to include specific examples like l3fwd and l2fwd. ```bash meson setup -Dexamples=l3fwd,l2fwd fwdbuild ``` -------------------------------- ### Meson Setup to Build and Install Documentation Source: https://doc.dpdk.org/guides-25.11/_sources/prog_guide/build-sdk-meson.rst.txt Configure the build to include the generation and installation of documentation. ```bash meson setup -Denable_docs=true fullbuild ``` -------------------------------- ### Meson Setup: Build Specific DPDK Examples Source: https://doc.dpdk.org/guides-25.11/prog_guide/build-sdk-meson.html Customize the build to include only specified DPDK examples. Pass a comma-separated list of example names to the `-Dexamples` option. ```bash # build some examples as part of the normal DPDK build meson setup -Dexamples=l3fwd,l2fwd fwdbuild ``` -------------------------------- ### Setup and Compile DPDK with Examples (LLVM/MinGW) Source: https://doc.dpdk.org/guides-25.11/_sources/windows_gsg/build_dpdk.rst.txt Configure the Meson build system to include the 'helloworld' example and then compile the DPDK project. Assumes DPDK source is in 'C:\Users\me\dpdk'. ```console cd C:\Users\me\dpdk meson setup -Dexamples=helloworld build meson compile -C build ``` -------------------------------- ### Compile and Run DPDK helloworld Example Source: https://doc.dpdk.org/guides-25.11/_sources/freebsd_gsg/install_from_ports.rst.txt Copies, compiles, and runs the DPDK 'helloworld' example application. Ensure 'gmake' and 'pkg-config' are installed. This example assumes 2GB of contigmem and 4 NIC ports bound to nic_uio. ```shell cp -r /usr/local/share/dpdk/examples/helloworld . cd helloworld/ gmake cc -O3 -I/usr/local/include -include rte_config.h -march=corei7 -D__BSD_VISIBLE main.c -o build/helloworld-shared -L/usr/local/lib -lrte_bpf -lrte_pipeline -lrte_table -lrte_port -lrte_fib -lrte_ipsec -lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib -lrte_rcu -lrte_rawdev -lrte_pdump -lrte_member -lrte_lpm -lrte_latencystats -lrte_jobstats -lrte_ip_frag -lrte_gso -lrte_gro -lrte_eventdev -lrte_efd -lrte_distributor -lrte_cryptodev -lrte_compressdev -lrte_cfgfile -lrte_bitratestats -lrte_bbdev -lrte_acl -lrte_timer -lrte_hash -lrte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_ring -lrte_eal -lrte_kvargs ln -sf helloworld-shared build/helloworld sudo ./build/helloworld -l 0-3 ``` ```text EAL: Sysctl reports 8 cpus EAL: Detected 8 lcore(s) EAL: Detected 1 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode 'PA' EAL: Contigmem driver has 2 buffers, each of size 1GB EAL: Mapped memory segment 0 @ 0x1040000000: physaddr:0x180000000, len 1073741824 EAL: Mapped memory segment 1 @ 0x1080000000: physaddr:0x1c0000000, len 1073741824 EAL: PCI device 0000:00:19.0 on NUMA socket 0 EAL: probe driver: 8086:153b net_e1000_em EAL: 0000:00:19.0 not managed by UIO driver, skipping EAL: PCI device 0000:01:00.0 on NUMA socket 0 EAL: probe driver: 8086:1572 net_i40e EAL: PCI device 0000:01:00.1 on NUMA socket 0 EAL: probe driver: 8086:1572 net_i40e EAL: PCI device 0000:01:00.2 on NUMA socket 0 EAL: probe driver: 8086:1572 net_i40e EAL: PCI device 0000:01:00.3 on NUMA socket 0 EAL: probe driver: 8086:1572 net_i40e hello from core 1 hello from core 2 hello from core 3 hello from core 0 ``` -------------------------------- ### Example Meson Setup and Build for ARM64 Target Source: https://doc.dpdk.org/guides-25.11/linux_gsg/cross_build_dpdk_for_arm64.html Example command to set up a Meson build for an ARM64 target using a specific cross file and then compile DPDK. ```bash meson setup aarch64-build-gcc --cross-file config/arm/arm64_armv8_linux_gcc ninja -C aarch64-build-gcc ``` -------------------------------- ### Example Meson Setup and Build for ARM32 Target Source: https://doc.dpdk.org/guides-25.11/linux_gsg/cross_build_dpdk_for_arm64.html Example command to set up a Meson build for an ARM32 target using a specific cross file and then compile DPDK. ```bash meson setup aarch32-build --cross-file config/arm/arm32_armv8_linux_gcc ninja -C aarch32-build ``` -------------------------------- ### Start vhost_blk Example Source: https://doc.dpdk.org/guides-25.11/sample_app_ug/vhost_blk.html Launches the vhost_blk sample application with specified memory allocation. Ensure DPDK is built on the host and guest. ```bash ./dpdk-vhost_blk -m 1024 ``` -------------------------------- ### DPDK Compression Example Setup Source: https://doc.dpdk.org/guides-25.11/_sources/prog_guide/ptr_compress_lib.rst.txt Sets up a ring buffer for compressed pointers and launches sender and receiver threads for a compression example. This demonstrates the basic initialization for a compression/decompression workflow. ```c void compression_example(void) { ring = rte_ring_create_elem( "COMPR_PTRS", sizeof(uint32_t), 1024, rte_socket_id(), RING_F_SP_ENQ | RING_F_SC_DEQ); rte_eal_remote_launch(send_compressed, NULL, CORE_SEND); rte_eal_remote_launch(recv_compressed, NULL, CORE_RECV); for(;;) { } } ``` -------------------------------- ### Start VM with Vdpa Backend Source: https://doc.dpdk.org/guides-25.11/_sources/sample_app_ug/vdpa.rst.txt Example QEMU command to start a VM utilizing a vDPA vhost-user backend, specifying CPU, KVM, memory, and network device configurations. ```console qemu-system-x86_64 -cpu host -enable-kvm \ \ -mem-prealloc \ -chardev socket,id=char0,path= \ -netdev type=vhost-user,id=vdpa,chardev=char0 \ -device virtio-net-pci,netdev=vdpa,mac=00:aa:bb:cc:dd:ee,page-per-vq=on \ ``` -------------------------------- ### Start vhost_blk Example Source: https://doc.dpdk.org/guides-25.11/_sources/sample_app_ug/vhost_blk.rst.txt Launches the vhost_blk sample application with specified memory allocation. Ensure DPDK is compiled on both host and guest. ```console ./dpdk-vhost_blk -m 1024 ``` -------------------------------- ### Start vswitch Example Application Source: https://doc.dpdk.org/guides-25.11/sample_app_ug/vhost.html Launches the DPDK vhost sample application. It configures coremask, NUMA memory, and specifies vhost-user socket details for client mode. ```bash ./dpdk-vhost -l 0-3 --numa-mem 1024 \ -- --socket-file /tmp/sock0 --client \ ... ``` -------------------------------- ### Start Application and Configure Power Policy Source: https://doc.dpdk.org/guides-25.11/_sources/sample_app_ug/vm_power_management.rst.txt Example command to start the VM Power Manager application, configure a power policy, and send it to the host. Requires build directory, VM name, policy type, and a list of virtual CPU cores. ```bash .//examples/dpdk-guest_vm_power_mgr -l 0-3 -- --vm-name=ubuntu --policy=BRANCH_RATIO --vcpu-list=2-4 ``` -------------------------------- ### Runtime Queue Setup Capability Source: https://doc.dpdk.org/guides-25.11/_sources/rel_notes/release_18_05.rst.txt This demonstrates how a device driver can expose runtime queue setup capability via rte_eth_dev_info_get. Rx or Tx queues set up at runtime need explicit starting. ```c struct rte_eth_dev_info dev_info; rte_eth_dev_info_get(port_id, &dev_info); if (dev_info.capabilities & RTE_ETH_DEV_RUNTIME_ QUEUE_SETUP) { /* Runtime queue setup is supported */ } ``` -------------------------------- ### TestPMD Secondary Process Command-line Source: https://doc.dpdk.org/guides-25.11/_sources/testpmd_app_ug/run_app.rst.txt Example command to start a secondary process for TestPMD in a multi-process setup. Ensure to replace 'xxx' with actual device arguments. ```console sudo ./dpdk-testpmd -a xxx --proc-type=auto -l 2-3 -- -i --rxq=4 --txq=4 \ --num-procs=2 --proc-id=1 ``` -------------------------------- ### TestPMD Primary Process Command-line Source: https://doc.dpdk.org/guides-25.11/_sources/testpmd_app_ug/run_app.rst.txt Example command to start the primary process for TestPMD in a multi-process setup. Ensure to replace 'xxx' with actual device arguments. ```console sudo ./dpdk-testpmd -a xxx --proc-type=auto -l 0-1 -- -i --rxq=4 --txq=4 \ --num-procs=2 --proc-id=0 ``` -------------------------------- ### Testpmd Command Line File Execution (No Echo) Source: https://doc.dpdk.org/guides-25.11/_sources/testpmd_app_ug/testpmd_funcs.rst.txt Example of starting testpmd with the '--cmdline-file-noecho' argument to execute commands from a file without displaying them. This is useful for automated setup. ```bash ./dpdk-testpmd ... -- -i --cmdline-file-noecho=/home/ubuntu/flow-create-commands.txt ``` ```console Interactive-mode selected CLI commands to be read from /home/ubuntu/flow-create-commands.txt Configuring Port 0 (socket 0) Port 0: 7C:FE:90:CB:74:CE Configuring Port 1 (socket 0) Port 1: 7C:FE:90:CB:74:CA Checking link statuses... Port 0 Link Up - speed 10000 Mbps - full-duplex Port 1 Link Up - speed 10000 Mbps - full-duplex Done Flow rule #0 created Flow rule #1 created ... ... Flow rule #498 created Flow rule #499 created Finished reading all CLI commands from /home/ubuntu/flow-create-commands.txt testpmd> ``` -------------------------------- ### Running the NTB Sample Application Source: https://doc.dpdk.org/guides-25.11/sample_app_ug/ntb.html This command launches the NTB sample application. Ensure you have enough cores available for each port plus one. Refer to the DPDK Getting Started Guide for EAL options. ```bash .//examples/dpdk-ntb -l 0-3 -n 6 -- -i ``` -------------------------------- ### Run DPDK Command Line Sample Application Source: https://doc.dpdk.org/guides-25.11/_sources/sample_app_ug/cmd_line.rst.txt To run the application in a Linux environment, issue this command. Refer to the DPDK Getting Started Guide for general information on running applications and EAL options. ```console $ .//examples/dpdk-cmdline -l 0-3 ``` -------------------------------- ### Example: Remapping lcore IDs with a starting offset Source: https://doc.dpdk.org/guides-25.11/_sources/linux_gsg/eal_args.include.rst.txt Enables automatic remapping of lcore IDs to a contiguous set starting from a specified value. This example starts remapping from lcore ID 10. ```bash dpdk-test -l 140-144 -R=10 ``` -------------------------------- ### Example: Remapping lcore IDs Source: https://doc.dpdk.org/guides-25.11/_sources/linux_gsg/eal_args.include.rst.txt Enables automatic remapping of lcore IDs to a contiguous set starting from 0. This example starts with physical cores 20-24. ```bash dpdk-test -l 20-24 -R ``` -------------------------------- ### Start Vdpa Example with IFCVF Driver Source: https://doc.dpdk.org/guides-25.11/_sources/sample_app_ug/vdpa.rst.txt Example command to start the vdpa sample application using the IFCVF driver, specifying memory and device arguments, and enabling interactive mode. ```console ./dpdk-vdpa -l 1 --numa-mem 1024,1024 \ -a 0000:06:00.3,vdpa=1 -a 0000:06:00.4,vdpa=1 \ -- --interactive ``` -------------------------------- ### Create and Interact with Command-line Instance Source: https://doc.dpdk.org/guides-25.11/_sources/prog_guide/cmdline.rst.txt Demonstrates creating a command-line instance for processing startup commands from a file and then switching to an interactive prompt. Includes error handling for command-line creation. ```c struct cmdline *cl; int fd = open(startup_file, O_RDONLY); if (fd >= 0) { cl = cmdline_new(ctx, "", fd, STDOUT_FILENO); if (cl == NULL) { /* error handling */ } cmdline_interact(cl); cmdline_quit(cl); close(fd); } cl = cmdline_stdin_new(ctx, "Proxy>> "); if (cl == NULL) { /* error handling */ } cmdline_interact(cl); cmdline_stdin_exit(cl); ``` -------------------------------- ### Start testpmd and Add VLAN Source: https://doc.dpdk.org/guides-25.11/_sources/nics/ice.rst.txt Starts the testpmd application and adds a VLAN tag to a specific port. This is part of the VLAN filter setup. ```console ./app/dpdk-testpmd -l 0-15 -- -i ... testpmd> rx_vlan add 10 0 ``` -------------------------------- ### Start Vdpa Example Command Source: https://doc.dpdk.org/guides-25.11/_sources/sample_app_ug/vdpa.rst.txt Basic command to start the vdpa sample application with EAL options and optional client, interactive, or interface arguments. ```console ./dpdk-vdpa [EAL options] -- [--client] [--interactive|-i] or [--iface SOCKET_PATH] ``` -------------------------------- ### Start vhost_crypto Example Source: https://doc.dpdk.org/guides-25.11/sample_app_ug/vhost_crypto.html Launches the vhost_crypto sample application with specified EAL options and configuration parameters. Ensure crypto devices are available and bound to a DPDK driver or created as virtual devices. ```bash ./dpdk-vhost_crypto [EAL options] -- --config (lcore,cdev-id,queue-id)[,(lcore,cdev-id,queue-id)] --socket-file lcore,PATH [--zero-copy] [--guest-polling] [--asymmetric-crypto] ``` -------------------------------- ### Start testpmd for Flow Director configuration Source: https://doc.dpdk.org/guides-25.11/_sources/nics/hns3.rst.txt Starts the testpmd application with specific core, queue, and port configurations, suitable for Flow Director setup. ```console .//app/dpdk-testpmd -l 0-15 -- -i --rxq=8 --txq=8 \ --nb-cores=8 --nb-ports=1 ``` -------------------------------- ### Example Runtime Configuration Source: https://doc.dpdk.org/guides-25.11/_sources/nics/txgbe.rst.txt Demonstrates how to apply runtime device arguments to the dpdk-testpmd application for configuring the TXGBE driver. ```console dpdk-testpmd -a 01:00.0,auto_neg=1 -- -i ``` -------------------------------- ### testpmd Output Example Source: https://doc.dpdk.org/guides-25.11/nics/mlx5.html This is an example output from the testpmd application when started with MLX5 devices. It shows device probing, MAC address assignment, and link status. ```text [...] EAL: PCI device 0000:05:00.0 on NUMA socket 0 EAL: probe driver: 15b3:1013 librte_net_mlx5 PMD: librte_net_mlx5: PCI information matches, using device "mlx5_0" (VF: false) PMD: librte_net_mlx5: 1 port(s) detected PMD: librte_net_mlx5: port 1 MAC address is e4:1d:2d:e7:0c:fe EAL: PCI device 0000:05:00.1 on NUMA socket 0 EAL: probe driver: 15b3:1013 librte_net_mlx5 PMD: librte_net_mlx5: PCI information matches, using device "mlx5_1" (VF: false) PMD: librte_net_mlx5: 1 port(s) detected PMD: librte_net_mlx5: port 1 MAC address is e4:1d:2d:e7:0c:ff EAL: PCI device 0000:06:00.0 on NUMA socket 0 EAL: probe driver: 15b3:1013 librte_net_mlx5 PMD: librte_net_mlx5: PCI information matches, using device "mlx5_2" (VF: false) PMD: librte_net_mlx5: 1 port(s) detected PMD: librte_net_mlx5: port 1 MAC address is e4:1d:2d:e7:0c:fa EAL: PCI device 0000:06:00.1 on NUMA socket 0 EAL: probe driver: 15b3:1013 librte_net_mlx5 PMD: librte_net_mlx5: PCI information matches, using device "mlx5_3" (VF: false) PMD: librte_net_mlx5: 1 port(s) detected PMD: librte_net_mlx5: port 1 MAC address is e4:1d:2d:e7:0c:fb Interactive-mode selected Configuring Port 0 (socket 0) PMD: librte_net_mlx5: 0x8cba80: TX queues number update: 0 -> 2 PMD: librte_net_mlx5: 0x8cba80: RX queues number update: 0 -> 2 Port 0: E4:1D:2D:E7:0C:FE Configuring Port 1 (socket 0) PMD: librte_net_mlx5: 0x8ccac8: TX queues number update: 0 -> 2 PMD: librte_net_mlx5: 0x8ccac8: RX queues number update: 0 -> 2 Port 1: E4:1D:2D:E7:0C:FF Configuring Port 2 (socket 0) PMD: librte_net_mlx5: 0x8cdb10: TX queues number update: 0 -> 2 PMD: librte_net_mlx5: 0x8cdb10: RX queues number update: 0 -> 2 Port 2: E4:1D:2D:E7:0C:FA Configuring Port 3 (socket 0) PMD: librte_net_mlx5: 0x8ceb58: TX queues number update: 0 -> 2 PMD: librte_net_mlx5: 0x8ceb58: RX queues number update: 0 -> 2 Port 3: E4:1D:2D:E7:0C:FB Checking link statuses... Port 0 Link Up - speed 40000 Mbps - full-duplex Port 1 Link Up - speed 40000 Mbps - full-duplex Port 2 Link Up - speed 10000 Mbps - full-duplex Port 3 Link Up - speed 10000 Mbps - full-duplex Done testpmd> ``` -------------------------------- ### Get Help Text for a Command Source: https://doc.dpdk.org/guides-25.11/_sources/howto/telemetry.rst.txt Send the '/help,' command to get help text and parameter information for a specific command. For example, '/help,/ethdev/xstats'. ```bash --> /help,/ethdev/xstats {"/help": {"/ethdev/xstats": "Returns the extended stats for a port. Parameters: int port_id"}} ``` -------------------------------- ### Initial DPDK Project Setup with Meson Source: https://doc.dpdk.org/guides-25.11/prog_guide/build-sdk-meson.html Use `meson setup` to configure a new DPDK build. Specify the DPDK source directory and the desired build directory. This command initializes the build environment based on meson.build files and system checks. ```bash user@host:/tmp$ meson setup ~user/dpdk dpdk-build ``` -------------------------------- ### Meson Configure to Build Specific Examples Source: https://doc.dpdk.org/guides-25.11/_sources/prog_guide/build-sdk-meson.rst.txt Change build settings after initial configuration to include specific examples. ```bash meson configure -Dexamples=l3fwd,l2fwd ``` -------------------------------- ### Compile Hello World Sample Application Source: https://doc.dpdk.org/guides-25.11/_sources/prog_guide/build_app.rst.txt Navigate to the hello world sample application directory and compile it using make. ```console ~/DPDK$ cd examples/helloworld/ ~/DPDK/examples/helloworld$ make ``` -------------------------------- ### Build All Available DPDK Sample Applications Source: https://doc.dpdk.org/guides-25.11/_sources/linux_gsg/build_dpdk.rst.txt Use `-Dexamples=all` to build all example applications whose dependencies are met on the current system. Meson checks each example and adds buildable ones to the ninja configuration. ```bash meson setup -Dexamples=all build ``` -------------------------------- ### Example: Using testpmd with Fail-safe PMD Source: https://doc.dpdk.org/guides-25.11/_sources/nics/fail_safe.rst.txt This example demonstrates how to start testpmd with a fail-safe PMD, ensuring the sub-device is blocked from normal EAL operations to prevent double probing. ```console testpmd -l 0-2 -n 4 -- -i --vdev net_failsafe0,dev=84:00.0 --blocklist 84:00.0 ``` -------------------------------- ### DPDK helloworld Example Execution Source: https://doc.dpdk.org/guides-25.11/_sources/windows_gsg/run_apps.rst.txt Navigate to the DPDK build examples directory and execute the 'dpdk-helloworld.exe' application with specified cores. This demonstrates a basic DPDK application run. ```console cd C:\Users\me\dpdk\build\examples dpdk-helloworld.exe -l 0-3 hello from core 1 hello from core 3 hello from core 0 hello from core 2 ``` -------------------------------- ### Start VM with vhost-user-blk Source: https://doc.dpdk.org/guides-25.11/sample_app_ug/vhost_blk.html Starts a Qemu virtual machine using vhost-user-blk for a fast data path. Requires Qemu v4.0 or newer. Supports packed ring format if guest kernel is >= 5.0. The reconnect=1 option enables live recovery. ```bash qemu-system-x86_64 -machine accel=kvm \ -m $mem -object memory-backend-file,id=mem,size=$mem,\ mem-path=/dev/hugepages,share=on -numa node,memdev=mem \ -drive file=os.img,if=none,id=disk \ -device ide-hd,drive=disk,bootindex=0 \ -chardev socket,id=char0,reconnect=1,path=/tmp/vhost.socket \ -device vhost-user-blk-pci,packed=on,chardev=char0,num-queues=1 \ ... ``` -------------------------------- ### Meson Setup with Custom Build Directory Source: https://doc.dpdk.org/guides-25.11/_sources/prog_guide/build-sdk-meson.rst.txt Example of setting up a Meson build from a different directory, specifying the DPDK project root and the desired build directory name. ```bash user@host:/tmp$ meson setup ~user/dpdk dpdk-build ``` -------------------------------- ### Setup DPDK and Run TestPMD in VM Source: https://doc.dpdk.org/guides-25.11/_sources/howto/lm_virtio_vhost_user.rst.txt Configure DPDK within the VM and start the testpmd application. This snippet includes commands to set forwarding mode and start traffic. ```console cd /root/dpdk/vm_scripts ./setup_dpdk_in_vm.sh ./run_testpmd_in_vm.sh testpmd> show port info all testpmd> set fwd mac retry testpmd> start tx_first testpmd> show port stats all ``` -------------------------------- ### Start vhost_crypto Example Source: https://doc.dpdk.org/guides-25.11/_sources/sample_app_ug/vhost_crypto.rst.txt Launches the vhost_crypto sample application with specified EAL and application-specific options. Ensure crypto devices are available and bound to a DPDK driver or created via --vdev. ```console ./dpdk-vhost_crypto [EAL options] -- --config (lcore,cdev-id,queue-id)[,(lcore,cdev-id,queue-id)] --socket-file lcore,PATH [--zero-copy] [--guest-polling] [--asymmetric-crypto] ``` -------------------------------- ### Copy and Build Sample Application Outside DPDK Source: https://doc.dpdk.org/guides-25.11/_sources/prog_guide/build_app.rst.txt Duplicate the hello world sample application to a new directory and build it. ```console ~$ cp -r DPDK/examples/helloworld my_rte_app ~$ cd my_rte_app/ ~/my_rte_app$ make ``` -------------------------------- ### Setup Huge Pages for DPDK Source: https://doc.dpdk.org/guides-25.11/_sources/cryptodevs/octeontx.rst.txt Configure appropriate huge pages to run DPDK example applications. This example sets up 4GB of huge pages with a 512MB page size. ```bash dpdk-hugepages.py --setup 4G --pagesize 512M ``` -------------------------------- ### testpmd Application Output Source: https://doc.dpdk.org/guides-25.11/nics/softnic.html Example output from the testpmd application after starting with Soft NIC configuration. ```text Interactive-mode selected Set softnic packet forwarding mode Configuring Port 0 (socket 0) Port 0: 90:E2:BA:37:9D:DC Configuring Port 1 (socket 0) ; SPDX-License-Identifier: BSD-3-Clause ; Copyright(c) 2018 Intel Corporation link LINK dev 0000:02:00.0 pipeline RX period 10 offset_port_id 0 pipeline RX port in bsz 32 link LINK rxq 0 pipeline RX port out bsz 32 swq RXQ0 pipeline RX table match stub pipeline RX port in 0 table 0 pipeline TX period 10 offset_port_id 0 pipeline TX port in bsz 32 swq TXQ0 pipeline TX port out bsz 32 link LINK txq 0 pipeline TX table match stub pipeline TX port in 0 table 0 thread 2 pipeline RX enable thread 2 pipeline TX enable Port 1: 00:00:00:00:00:00 Checking link statuses... Done testpmd> ``` -------------------------------- ### Build DPDK Source: https://doc.dpdk.org/guides-25.11/compressdevs/uadk.html Navigates to the DPDK directory, sets up the build using meson, and installs DPDK. ```bash cd dpdk mkdir build meson setup build (--reconfigure) cd build ninja sudo ninja install ``` -------------------------------- ### Start VM with vhost-user-blk Device Source: https://doc.dpdk.org/guides-25.11/_sources/sample_app_ug/vhost_blk.rst.txt Configures and starts a Qemu VM using the vhost-user-blk device for a fast data path. Requires Qemu v4.0+ and DPDK compiled for host and guest. ```bash qemu-system-x86_64 -machine accel=kvm \ -m $mem -object memory-backend-file,id=mem,size=$mem,\\ mem-path=/dev/hugepages,share=on -numa node,memdev=mem \ -drive file=os.img,if=none,id=disk \ -device ide-hd,drive=disk,bootindex=0 \ -chardev socket,id=char0,reconnect=1,path=/tmp/vhost.socket \ -device vhost-user-blk-pci,packed=on,chardev=char0,num-queues=1 \ ... ``` -------------------------------- ### Setup Huge Pages Source: https://doc.dpdk.org/guides-25.11/cryptodevs/octeontx.html Configure appropriate huge pages for running DPDK example applications. ```bash dpdk-hugepages.py --setup 4G --pagesize 512M ``` -------------------------------- ### Start vhost Sample Application Source: https://doc.dpdk.org/guides-25.11/_sources/sample_app_ug/vhost.rst.txt Launches the dpdk-vhost sample application. This command assumes the application is built and accessible in the current directory. ```console ./dpdk-vhost -l 0-3 --numa-mem 1024 \ -- --socket-file /tmp/sock0 --client \ ... ``` -------------------------------- ### QEDE PMD Device Start and Link Status Source: https://doc.dpdk.org/guides-25.11/_sources/nics/qede.rst.txt Shows the process of starting the QEDE PMD device and checking its link status. This is typically done after queue setup and before data plane operations. ```text [QEDE PMD: (84:00.0:dpdk-port-0)]qede_dev_start:port 0 [QEDE PMD: (84:00.0:dpdk-port-0)]qede_dev_start:link status: down [...] Checking link statuses... Port 0 Link Up - speed 25000 Mbps - full-duplex Port 1 Link Up - speed 25000 Mbps - full-duplex Port 2 Link Up - speed 25000 Mbps - full-duplex Port 3 Link Up - speed 25000 Mbps - full-duplex Done testpmd> ``` -------------------------------- ### Example qemu guest launch command for VF passthrough Source: https://doc.dpdk.org/guides-25.11/nics/thunderx.html Launch a QEMU guest VM, passing a ThunderX NIC VF device using `vfio-pci`. This example demonstrates VM configuration for SR-IOV VF passthrough. ```bash sudo qemu-system-aarch64 -name vm1 \ -machine virt,gic_version=3,accel=kvm,usb=off \ -cpu host -m 4096 \ -smp 4,sockets=1,cores=8,threads=1 \ -nographic -nodefaults \ -kernel \ -append "root=/dev/vda console=ttyAMA0 rw hugepagesz=512M hugepages=3" \ -device vfio-pci,host=0002:01:00.1 \ -drive file=,if=none,id=disk1,format=raw \ -device virtio-blk-device,scsi=off,drive=disk1,bootindex=1 \ -netdev tap,id=net0,ifname=tap0,script=/etc/qemu-ifup_thunder \ -device virtio-net-device,netdev=net0 \ -serial stdio \ -mem-path /dev/hugepages ``` -------------------------------- ### Install cxgbetool Source: https://doc.dpdk.org/guides-25.11/nics/cxgbe.html Navigates to the cxgbetool source directory, compiles, and installs it. ```bash cd /tools/tools/cxgbetool/ make && make install ``` -------------------------------- ### Start testpmd with Fail-safe PMD in allow mode Source: https://doc.dpdk.org/guides-25.11/nics/fail_safe.html This example demonstrates starting testpmd with a fail-safe PMD when the PCI device is in allow mode. The fail-safe PMD is configured with specific sub-devices and a MAC address. ```bash .//app/dpdk-testpmd -l 0-7 \ --vdev 'net_failsafe0,mac=de:ad:be:ef:01:02,dev(84:00.0),dev(net_ring0)' \ -a 81:00.0 -- -i ``` -------------------------------- ### Running the Hello World Application Source: https://doc.dpdk.org/guides-25.11/_sources/sample_app_ug/hello_world.rst.txt This command shows how to run the DPDK Hello World sample application in a Linux environment. Ensure you replace with your actual build directory. ```console $ .//examples/dpdk-helloworld -l 0-3 ``` -------------------------------- ### Get Node Statistics Output Example Source: https://doc.dpdk.org/guides-25.11/_sources/prog_guide/graph_lib.rst.txt An example output format for aggregate node statistics retrieved using rte_graph_cluster_stats_get(). This shows node identifiers, call counts, object counts, and performance metrics. ```text +---------+-----------+-------------+---------------+-----------+---------------+-----------+ |Node |calls |objs |realloc_count |objs/call |objs/sec(10E6) |cycles/call| +---------------------+-------------+---------------+-----------+---------------+-----------+ |node0 |12977424 |3322220544 |5 |256.000 |3047.151872 |20.0000 | |node1 |12977653 |3322279168 |0 |256.000 |3047.210496 |17.0000 | |node2 |12977696 |3322290176 |0 |256.000 |3047.221504 |17.0000 | |node3 |12977734 |3322299904 |0 |256.000 |3047.231232 |17.0000 | |node4 |12977784 |3322312704 |1 |256.000 |3047.243776 |17.0000 | |node5 |12977825 |3322323200 |0 |256.000 |3047.254528 |17.0000 | +---------+-----------+-------------+---------------+-----------+---------------+-----------+ ``` -------------------------------- ### Meson Setup with Fast Path Traces Enabled Source: https://doc.dpdk.org/guides-25.11/_sources/prog_guide/build-sdk-meson.rst.txt Configure the build to enable fast path traces. ```bash meson setup -Denable_trace_fp=true tracebuild ``` -------------------------------- ### Setup a Queue Source: https://doc.dpdk.org/guides-25.11/_sources/testpmd_app_ug/testpmd_funcs.rst.txt Sets up a specific RX or TX queue on a port. This command is effective only when the port is started. ```shell testpmd> port (port_id) (rxq|txq) (queue_id) setup ``` -------------------------------- ### Start VM with pci-assign Device Source: https://doc.dpdk.org/guides-25.11/_sources/nics/intel_vf.rst.txt Launch a QEMU virtual machine and attach a PCI device using the pci-assign option. ```console /usr/local/kvm/bin/qemu-system-x86_64 -m 4096 -smp 4 -boot c -hda lucid.qcow2 -device pci-assign,host=08:10.0 ``` -------------------------------- ### testpmd interactive mode output Source: https://doc.dpdk.org/guides-25.11/_sources/nics/pcap_ring.rst.txt Example output from the testpmd interactive mode after starting packet forwarding with ring devices. ```console ... Interactive-mode selected Configuring Port 0 (socket 0) Configuring Port 1 (socket 0) Checking link statuses... Port 0 Link Up - speed 10000 Mbps - full-duplex Port 1 Link Up - speed 10000 Mbps - full-duplex Done testpmd> start tx_first io packet forwarding - CRC stripping disabled - packets/burst=16 nb forwarding cores=1 - nb forwarding ports=2 RX queues=1 - RX desc=128 - RX free threshold=0 RX threshold registers: pthresh=8 hthresh=8 wthresh=4 TX queues=1 - TX desc=512 - TX free threshold=0 TX threshold registers: pthresh=36 hthresh=0 wthresh=0 TX RS bit threshold=0 - TXQ flags=0x0 testpmd> stop Telling cores to stop... Waiting for lcores to finish... ```