【dpdk】Getting Started Guide for Linux DPDK

本文详细介绍了如何在Linux系统中使用DPDK,包括设置hugepages、配置vfio-pci和UIO驱动、管理虚拟函数以及运行示例应用。特别关注了如何预留和管理hugepages,以及使用vfio-pci创建虚拟功能和处理可能出现的故障排查方法。

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

Getting Started Guide for Linux — Data Plane Development Kit 23.11.0 documentation (dpdk.org)

DPDK官网

1.dpdk build with isa-l

ISA-L Compression Poll Mode Driver

2.System Requirements

System Requirements

1.启用iommu

ubuntu
cat /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash, intel_iommu=on"

grub-mkconfig --output=/boot/grub/grub.cfg

3.Running DPDK Applications

The reservation of hugepages can be performed at run time. This is done by echoing the number of hugepages required to a nr_hugepages file in the /sys/kernel/ directory corresponding to a specific page size (in Kilobytes). For a single-node system, the command to use is as follows (assuming that 1024 of 2MB pages are required):

echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

On a NUMA machine, the above command will usually divide the number of hugepages equally across all NUMA nodes (assuming there is enough memory on all NUMA nodes). However, pages can also be reserved explicitly on individual NUMA nodes using a nr_hugepages file in the /sys/devices/ directory:

echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages

The tool dpdk-hugepages.py can be used to manage hugepages.

3.1. dpdk-hugepages Application

The dpdk-hugepages tool is a Data Plane Development Kit (DPDK) utility that helps in reserving hugepages. As well as checking for current settings.

3.1.1. Running the Application

The tool has a number of command line options:

dpdk-hugepages [options]
3.1.2. Options
  • -h, --help

    Display usage information and quit

  • -s, --show

    Print the current huge page configuration

  • -c driver, --clear

    Clear existing huge page reservation

  • -m, --mount

    Mount the huge page filesystem

  • -u, --unmount

    Unmount the huge page filesystem

  • -n NODE, --node=NODE

    Set NUMA node to reserve pages on

  • -p SIZE, --pagesize=SIZE

    • Select hugepage size to use.

      If not specified the default system huge page size is used.

  • -r SIZE, --reserve=SIZE

    • Reserve huge pages.

      Size is in bytes with K, M or G suffix.

  • --setup SIZE

    Short cut to clear, unmount, reserve and mount.

Warning

While any user can run the dpdk-hugepages.py script to view the status of huge pages, modifying the setup requires root privileges.

3.1.3. Examples

To display current huge

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值