DPDK EAL参数

本文档详细列举了DPDK在Linux环境下运行的所有EAL参数,包括核心相关选项、设备相关选项、多处理相关选项、内存相关选项和调试选项。如:-c<coremask>用于设置运行的CPU核心掩码,-a<[domain:]bus:devid.func>用于指定要探测的PCI设备,-n<number_of_channels>设定使用的内存通道数量等。这些参数对于DPDK应用的配置和优化至关重要。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

This document contains a list of all EAL parameters. These parameters can be used by any DPDK application running on Linux.

  • 1、Common EAL parameters

    The following EAL parameters are common to all platforms supported by DPDK.
    • 1.1、Lcore-related options

      1.1.1、-c <core mask>
      Set the hexadecimal bitmask of the cores to run on.
      1.1.2、-l <core list>
      List of cores to run on
      The argument format is [-c2][,c3[-c4],…] where c1, c2, etc are core indexes between 0 and 128.
      1.1.3、–lcores <core map>
      Map lcore set to physical cpu set

      The argument format is:

      <lcores[@cpus]>[<,lcores[@cpus]>…]
      Lcore and CPU lists are grouped by ( and ) Within the group. The - character is used as a range separator and , is used as a single number separator. The grouping () can be omitted for single element group. The @ can be omitted if cpus and lcores have the same value.

      1.1.4、–main-lcore <core ID>
      Core ID that is used as main.
      1.1.5、-s <service core mask>
      Hexadecimal bitmask of cores to be used as service cores.

    • 1.2、Device-related options

      1.2.1、-b, --block <[domain:]bus:devid.func>
      Skip probing a PCI device to prevent EAL from using it. Multiple -b options are allowed.
      Block list cannot be used with the allow list -a option.
      1.2.2、-a, --allow <[domain:]bus:devid.func>
      Add a PCI device in to the list of devices to probe.
      Allow list cannot be used with the block list -b option.
      1.2.3、 –vdev <device arguments>
      Add a virtual device using the format:

      <driver><id>[,key=val, ...]
      

      For example:

      --vdev 'net_pcap0,rx_pcap=input.pcap,tx_pcap=output.pcap'
      

      1.2.4、-d <path to shared object or directory>
      Load external drivers. An argument can be a single shared object file, or a directory containing multiple driver shared objects. Multiple -d options are allowed.
      1.2.5、–no-pci
      –no-pci

    • 1.3、Multiprocessing-related options

      1.3.1、–proc-type <primary|secondary|auto>
      Set the type of the current process
      1.3.2、–base-virtaddr


      Attempt to use a different starting address for all memory maps of the primary DPDK process.
      This can be helpful if secondary processes cannot start due to conflicts in address map.

    • 1.4、Memory-related options

      1.4.1、-n <number of channels>

      Set the number of memory channels to use.

      1.4.2、-r <number of ranks>

      Set the number of memory ranks (auto-detected by default).

      1.4.2、-m <megabytes>

      Amount of memory to preallocate at startup.

      1.4.3、–in-memory

      Do not create any shared data structures and run entirely in memory. Implies --no-shconf and (if applicable) --huge-unlink.

      1.4.4、–iova-mode <pa|va>

      Force IOVA mode to a specific value.

      1.4.5、–huge-worker-stack[=size]
      Allocate worker stack memory from hugepage memory. Stack size defaults to system pthread stack size unless the optional size (in kbytes) is specified.

    • 1.5、Debugging options

    • 1.6、Other options

  • 2、Linux-specific EAL parameters

  • 2.1、Device-related options

  • 2.2、Multiprocessing-related options

  • 2.3、Memory-related options

    2.3.1、–legacy-mem
    Use legacy DPDK memory allocation mode.
    2.3.2、–socket-mem <amounts of memory per socket>
    Preallocate specified amounts of memory per socket. The parameter is a comma-separated list of values. For example:
    --socket-mem 1024,2048
    
    This will allocate 1 gigabyte of memory on socket 0, and 2048 megabytes of memory on socket 1.
  • 2.4、Other options

DPDK (Data Plane Development Kit) 是一个高性能的网络应用开发框架,它专注于加速数据平面操作,如网络转发。`testpmd` 是 DPDK 的一个实用工具,用于测试和演示 DPDK 驱动的各种功能,特别是网卡的加速。 `EAL` 是 DPDK 架构中的一个重要部分,代表 `Early Abstraction Layer`,它是 DPDK 进程的初始化阶段。在运行 `dpdk-testpmd` 命令时,EAL 命令用于配置 DPDK 环境,包括硬件选择、内存分配、日志设置等。 一些常见的 `dpdk-testpmd EAL` 命令参数示例: 1. `-n` 或 `--nb-cores`: 指定使用多少个CPU核心来处理数据包,例如 `-n4` 表示使用4个核心。 2. `-c` 或 `--socket-mem`: 设置每个CPU核心的内存分配,如 `-c1024,2048` 分配1GB和2GB内存给每个核心。 3. `-l` 或 `--log-level`: 设置日志级别,如 `-lerror` 只显示错误信息。 4. `-i` 或 `--adapter`: 选择要使用的网卡,如 `-iigbxe` 选择Intel iGbE网卡。 5. `-P` 或 `--proc-type`: 设定进程类型,如 `auto` 自动检测,`huge` 使用大页内存。 完整的 `dpdk-testpmd EAL` 命令可能如下所示: ```bash sudo dpdk-testpmd -- -n <cores> --socket-mem <socket_memory> -l <log_level> --adapter <nic> --proc-type <proc_type> ``` 要了解更多关于 `dpdk-testpmd` EAL的命令选项及其作用,请查阅DPDK官方文档或在线教程,因为这些参数和行为可能会随DPDK版本更新而变化。你对哪个特定参数感兴趣?或者想要了解如何配置哪种类型的网络设备?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值