diff --git a/Others/dpdk/README.md b/Others/dpdk/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1c56a8e07590ef58b6f269c8e3ba76dbb956e0a4 --- /dev/null +++ b/Others/dpdk/README.md @@ -0,0 +1,68 @@ +# Quick reference + +- The official Data Plane Development Kit (DPDK) docker image. + +- Maintained by: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative). + +- Where to get help: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative), [openEuler](https://gitee.com/openeuler/community). + +# Data Plane Development Kit (DPDK) | openEuler +Current DPDK docker images are built on the [openEuler](https://repo.openeuler.org/). This repository is free to use and exempted from per-user rate limits. + +Data Plane Development Kit (DPDK) is a Linux Foundation project that consists of libraries to accelerate packet +processing workloads running on a wide variety of CPU architectures. + +Learn more about DPDK on [DPDK Website](hhttps://core.dpdk.org/doc/)⁠. + +# Supported tags and respective Dockerfile links +The tag of each `dpdk` docker image is consist of the version of `dpdk` and the version of basic image. The details are as follows + +| Tag | Currently | Architectures | +|----------|-------------|------------------| +|[25.03-oe2403sp1](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/dpdk/25.03/24.03-lts-sp1/Dockerfile)| DPDK 25.03 on openEuler 24.03-LTS-SP1 | amd64, arm64 | + +# Usage +In this usage, users can select the corresponding `{Tag}` based on their requirements. + +- Pull the `openeuler/dpdk` image from docker + + ```bash + docker pull openeuler/dpdk:{Tag} + ``` + +- Temporary set up hugePages(resets after reboot) + + ``` + echo 64 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages + mkdir -p /dev/hugepages + mount -t hugetlbfs nodev /dev/hugepages + ``` + This will enable 64 hugepages of 2MB each and mount them to `/dev/hugepages`. + +- Running a DPDK Container with HugePages + ``` + docker run -it --rm \ + --cap-add=IPC_LOCK \ + --privileged \ + -v /dev/hugepages:/dev/hugepages \ + -v /sys/bus/pci:/sys/bus/pci \ + -v /sys/devices:/sys/devices \ + -v /sys/kernel/mm/hugepages:/sys/kernel/mm/hugepages \ + -v /lib/modules:/lib/modules \ + --network host \ + openeuler/dpdk:{Tag} bash + ``` + * `--privileged`: Grants access to device bindings (e.g., VFIO) and hugepages + * `--network host`: Enable DPDK to access the actual physical NIC on the host + +- Run DPDK sample application + Once inside the container: + ``` + cd /dpdk/examples/helloworld + make + ./build/helloworld -l 0 -n 2 + ``` + This compiles and runs the DPDK `helloworld` example, binding it to logical core 0 and using 2 memory channels. + +# Question and answering +If you have any questions or want to use some special features, please submit an issue or a pull request on [openeuler-docker-images](https://gitee.com/openeuler/openeuler-docker-images). \ No newline at end of file diff --git a/Others/dpdk/doc/image-info.yml b/Others/dpdk/doc/image-info.yml new file mode 100644 index 0000000000000000000000000000000000000000..2a2b16ff7f47accd5a9b6af1e4f417eccecfd79d --- /dev/null +++ b/Others/dpdk/doc/image-info.yml @@ -0,0 +1,65 @@ +name: dpdk +category: others +description: DPDK(Data Plane Development Kit)是一个由Intel发起、广泛用于数据包处理的高性能软件开发框架,专为用户态高速网络包处理场景设计。 +environment: | + 本应用在Docker环境中运行,安装Docker执行如下命令 + ``` + yum install -y docker + ``` +tags: | + dpdk镜像的Tag由其版本信息和基础镜像版本信息组成,详细内容如下 + + | Tag | Currently | Architectures | + |----------|-------------|------------------| + |[25.03-oe2403sp1](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/dpdk/25.03/24.03-lts-sp1/Dockerfile)| DPDK 25.03 on openEuler 24.03-LTS-SP1 | amd64, arm64 | + +download: | + 拉取镜像到本地 + ``` + docker pull openeuler/dpdk:{Tag} + ``` + +usage: | + - 临时设置hugePages(重启后失效) + ``` + echo 64 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages + mkdir -p /dev/hugepages + mount -t hugetlbfs nodev /dev/hugepages + ``` + 这将启用64个2MB的HugePages,并将其挂载到 `/dev/hugepages`. + + - 运行DPDK容器 + ``` + docker run -it --rm \ + --cap-add=IPC_LOCK \ + --privileged \ + -v /dev/hugepages:/dev/hugepages \ + -v /sys/bus/pci:/sys/bus/pci \ + -v /sys/devices:/sys/devices \ + -v /sys/kernel/mm/hugepages:/sys/kernel/mm/hugepages \ + -v /lib/modules:/lib/modules \ + --network host \ + openeuler/dpdk:{Tag} bash + ``` + * `--privileged`: 授予访问设备绑定(如 VFIO和HugePages的权限 + * `--network host`: 允许DPDK访问宿主机上的实际物理网卡 + + - 运行示例程序helloworld + Once inside the container: + ``` + cd /dpdk/examples/helloworld + make + ./build/helloworld -l 0 -n 2 + ``` + 该命令会编译并运行DPDK的`helloworld`示例程序,绑定到逻辑核心0,并使用2个内存通道。 + + +license: BSD-3-Clause +similar_packages: + - netmap: 高性能的网络I/O框架,旨在简化内核与用户空间之间的网络包传输,并提供接近线速(line-rate)的网络性能。 +dependency: + - numactl-devel + - pcre + - libelf/elfutils + - libbsd + - libpcap \ No newline at end of file diff --git a/Others/dpdk/doc/picture/logo.png b/Others/dpdk/doc/picture/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..4d1b4930b5a9cedced5d6b5fa13d2a2c2a84f236 Binary files /dev/null and b/Others/dpdk/doc/picture/logo.png differ