DPDK多进程

DPDK初始化参数列表

rte_eal_init参数列表获取方式:

  • 运行testpmd --help
  • 阅读dpdk源码

如下是testpmd打印的常用参数:

EAL common options:
  -c COREMASK         Hexadecimal bitmask of cores to run on
  -l CORELIST         List of cores to run on
                      The argument format is [-c2][,c3[-c4],...]
                      where c1, c2, etc are core indexes between 0 and 256
  --lcores COREMAP    Map lcore set to physical cpu set
                      The argument format is
                            '[<,lcores[@cpus]>...]'
                      lcores and cpus list are grouped by '(' and ')'
                      Within the group, '-' is used for range separator,
                      ',' is used for single number separator.
                      '( )' can be omitted for single element group,
                      '@' can be omitted if cpus and lcores have the same value
  -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores
  --master-lcore ID   Core ID that is used as master
  --mbuf-pool-ops-name Pool ops name for mbuf to use
  -n CHANNELS         Number of memory channels
  -m MB               Memory to allocate (see also --socket-mem)
  -r RANKS            Force number of memory ranks (don't detect)
  -b, --pci-blacklist Add a PCI device in black list.
                      Prevent EAL from using this PCI device. The argument
                      format is .
  -w, --pci-whitelist Add a PCI device in white list.
                      Only use the specified PCI devices. The argument format
                      is <[domain:]bus:devid.func>. This option can be present
                      several times (once per device).
                      [NOTE: PCI whitelist cannot be used with -b option]
  --vdev              Add a virtual device.
                      The argument format is [,key=val,...]
                      (ex: --vdev=net_pcap0,iface=eth2).
  --iova-mode   Set IOVA mode. 'pa' for IOVA_PA
                      'va' for IOVA_VA
  -d LIB.so|DIR       Add a driver or driver directory
                      (can be used multiple times)
  --vmware-tsc-map    Use VMware TSC map instead of native RDTSC
  --proc-type         Type of this process (primary|secondary|auto)
  --syslog            Set syslog facility
  --log-level=   Set global log level
  --log-level=:
                      Set specific log level
  -v                  Display version information on startup
  -h, --help          This help
  --in-memory   Operate entirely in memory. This will
                      disable secondary process support
  --base-virtaddr     Base virtual address

EAL options for DEBUG use only:
  --huge-unlink       Unlink hugepage files after init
  --no-huge           Use malloc instead of hugetlbfs
  --no-pci            Disable PCI
  --no-hpet           Disable HPET
  --no-shconf         No shared config (mmap'd files)

EAL dynamic options:
  --telemetry         Enable telemetry backend

EAL Linux options:
  --socket-mem        Memory to allocate on sockets (comma separated values)
  --socket-limit      Limit memory allocation on sockets (comma separated values)
  --huge-dir          Directory where hugetlbfs is mounted
  --file-prefix       Prefix for hugepage filenames
  --create-uio-dev    Create /dev/uioX (usually done by hotplug)
  --vfio-intr         Interrupt mode for VFIO (legacy|msi|msix)
  --legacy-mem        Legacy memory mode (no dynamic allocation, contiguous segments)
  --single-file-segments Put all hugepage memory in single files
  --match-allocations Free hugepages exactly as allocated

主从模式

参考:DPDK多进程支持

参数–proc-type

指定一个dpdk进程是主进程还是副进程。

参数–file-prefix

–file-prefix:Prefix for hugepage filenames,默认值是rte。
主进程启动后会在目录/run/dpdk目录下创建一个以–file-prefix参数值命名的目录,这个目录就是prefix。这个目录里面主要就是内存配置信息。
从进程启动后会读取prefix目录,获取内存配置信息。
如果想运行多个主进程,这个参数就必须指定!
主从进程必须用同样的–file-prefix参数,否则会报错。主进程如果写错–file-prefix参数,初始化内存将会失败,错误信息:EAL: FATAL: Cannot init memzone。从进程如果写错–file-prefix参数,版本校验将会失败,错误信息:Primary and secondary process DPDK version mismatch。

你可能感兴趣的:(opensource,数学建模,dpdk)