@@ -52,6 +52,8 @@ P4C_DIR=$(readlink -f ${THIS_DIR}/..)
52
52
: " ${ENABLE_EBPF:= ON} "
53
53
# P4TC is enabled by default.
54
54
: " ${ENABLE_P4TC:= ON} "
55
+ # P4TC STF is only enabled when running p4tc tagged PRs.
56
+ : " ${INSTALL_STF_P4TC_DEPENDENCIES:= OFF} "
55
57
# This is the list of back ends that can be enabled.
56
58
# Back ends can be enabled from the command line with "ENABLE_[backend]=TRUE/FALSE"
57
59
ENABLE_BACKENDS=(" TOFINO" " BMV2" " EBPF" " UBPF" " DPDK"
216
218
# ! ------ END EBPF -----------------------------------------------
217
219
218
220
# ! ------ BEGIN P4TC -----------------------------------------------
221
+ function install_stf_p4tc_test_deps() (
222
+ P4C_STF_P4TC_PACKAGES=" libmnl-dev \
223
+ bridge-utils \
224
+ python3-venv \
225
+ qemu qemu-system-x86"
226
+ sudo apt-get install -y --no-install-recommends ${P4C_STF_P4TC_PACKAGES}
227
+ git clone https://github.com/p4tc-dev/iproute2-p4tc-pub -b master-v17-rc8 ${P4C_DIR} /backends/tc/runtime/iproute2-p4tc-pub
228
+ ${P4C_DIR} /backends/tc/runtime/build-iproute2 ${P4C_DIR} /backends/tc/runtime
229
+ git clone --recurse-submodules https://github.com/arighi/virtme-ng.git ${P4C_DIR} /backends/tc/runtime/virtme-ng
230
+ pushd ${P4C_DIR} /backends/tc/runtime/virtme-ng
231
+ git checkout v1.19
232
+ python3 -m venv ${P4C_DIR} /backends/tc/runtime/virtme-ng
233
+ source ${P4C_DIR} /backends/tc/runtime/virtme-ng/bin/activate
234
+ pip install --upgrade pip
235
+ pip install .
236
+ deactivate
237
+ )
238
+
219
239
function build_p4tc() {
220
240
P4TC_DEPS=" libpcap-dev \
221
241
libelf-dev \
@@ -224,16 +244,12 @@ function build_p4tc() {
224
244
net-tools \
225
245
flex \
226
246
libelf-dev \
227
- libmnl-dev \
228
247
pkg-config \
229
248
xtables-addons-source \
230
- bridge-utils \
231
249
python3 \
232
250
python3-pip \
233
- python3-venv \
234
- python3-argcomplete \
235
251
wget \
236
- qemu qemu-system-x86 "
252
+ python3-argcomplete "
237
253
238
254
sudo apt-get install -y --no-install-recommends ${P4TC_DEPS}
239
255
@@ -242,15 +258,12 @@ function build_p4tc() {
242
258
sudo ./llvm.sh 15
243
259
rm llvm.sh
244
260
245
- git clone --recurse-submodules https://github.com/arighi/virtme-ng.git ${P4C_DIR} /backends/tc/runtime/virtme-ng
246
- pushd ${P4C_DIR} /backends/tc/runtime/virtme-ng
247
- git checkout v1.19
248
- python3 -m venv ${P4C_DIR} /backends/tc/runtime/virtme-ng
249
- source ${P4C_DIR} /backends/tc/runtime/virtme-ng/bin/activate
250
- pip install --upgrade pip
251
- pip install .
252
- deactivate
253
- popd
261
+ git clone https://github.com/libbpf/libbpf/ -b v1.5.0 ${P4C_DIR} /backends/tc/runtime/libbpf
262
+ ${P4C_DIR} /backends/tc/runtime/build-libbpf
263
+
264
+ if [[ " ${INSTALL_STF_P4TC_DEPENDENCIES} " == " ON" ]] ; then
265
+ install_stf_p4tc_test_deps
266
+ fi
254
267
}
255
268
if [[ " ${ENABLE_P4TC} " == " ON" ]] ; then
256
269
build_p4tc
0 commit comments