Skip to content
Ming Zhao edited this page Mar 29, 2021 · 1 revision

This is a volunteer supported project that demonstrates how to use bazel to build dpdk, so it can be tightly into your existing code base. The benefits include but are not limited to:

  • DPDK source code is treated equally as other code, streamlines your bug fix, review, CI/CD process.
  • Leverage bazel's advanced C++ toolchain management, like switch between gcc/clang easily, or levaging sanitized build

To incoporate this project into an existing bazel workspace

cd project_root
mkdir third_party && cd third_party

# Note the following two steps only need one
# clone this repo
git clone https://github.com/bazelment/dpdk.git
# Or use submodule 
git submodule add https://github.com/bazelment/dpdk.git

# Checkout the corresponding bazel branch
cd dpdk && git checkout bazel-16.04

Then you can just treat all the existing targets inside //third_party/dpdk like the rest of workspace. For example:

bazel build third_party/dpdk/examples/...

Quick Start with an existing workspace

https://github.com/bazelment/dpdk_examples contains an example workspace that takes care of all the steps.

git clone https://github.com/bazelment/dpdk_examples.git && cd dpdk_examples                                                                                                                                      
git submodule update --init                                                                                                                                                                                       
bazel build third_party/dpdk/...