Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging f5_usecase into main #236

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11,507 changes: 11,507 additions & 0 deletions e2e/artefacts/linux_networking_1_6/linux_networking_1_6.context.json

Large diffs are not rendered by default.

2,261 changes: 2,261 additions & 0 deletions e2e/artefacts/linux_networking_1_6/linux_networking_1_6.p4info.txt

Large diffs are not rendered by default.

Binary file not shown.
35,823 changes: 35,823 additions & 0 deletions e2e/artefacts/linux_networking_1_6/linux_networking_1_6.s

Large diffs are not rendered by default.

4,142 changes: 4,142 additions & 0 deletions e2e/artefacts/linux_networking_1_6/linux_networking_1_6.tdi.json

Large diffs are not rendered by default.

13,855 changes: 13,855 additions & 0 deletions e2e/artefacts/linux_networking_1_8/linux_networking_1_8.context.json

Large diffs are not rendered by default.

2,790 changes: 2,790 additions & 0 deletions e2e/artefacts/linux_networking_1_8/linux_networking_1_8.p4info.txt

Large diffs are not rendered by default.

Binary file not shown.
53,057 changes: 53,057 additions & 0 deletions e2e/artefacts/linux_networking_1_8/linux_networking_1_8.s

Large diffs are not rendered by default.

5,020 changes: 5,020 additions & 0 deletions e2e/artefacts/linux_networking_1_8/linux_networking_1_8.tdi.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion p4sdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

.PHONY: all fmt check-fmt vet build ipuplugin test update-mod ipuplugin-amd64 ipuplugin-arm64
APP_NAME = ipu-p4-sdk
P4_NAME = rh_mvp
saynb marked this conversation as resolved.
Show resolved Hide resolved
P4_DIR = p4-rh_mvp
saynb marked this conversation as resolved.
Show resolved Hide resolved
VERSION ?= 0.0.0
IMAGE_NAME = intel-$(APP_NAME)
ifneq (, $(IMAGE_REGISTRY))
Expand All @@ -21,12 +23,14 @@ endif
ifdef HTTPS_PROXY
DOCKERARGS += --build-arg https_proxy=$(HTTPS_PROXY)
endif
DOCKERARGS += --build-arg P4_NAME=$(P4_NAME)

all: image

image:
# Copy p4 files from parent dir first
cp -r ../e2e/artefacts/p4-rh_mvp $(CURDIR)/p4
mkdir -p $(CURDIR)/p4
cp -r ../e2e/artefacts/$(P4_DIR)/* $(CURDIR)/p4
# $(IMGTOOL) build -t $(IMAGE_TAG_VERSION) -f $(DOCKERFILE) $(CURDIR) $(DOCKERARGS)
$(IMGTOOL) build -t $(IMAGE_TAG_VERSION) -t $(IMAGE_TAG_LATEST) -f $(DOCKERFILE) $(CURDIR) $(DOCKERARGS)
rm -rf p4
Expand Down
4 changes: 3 additions & 1 deletion p4sdk/images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ FROM registry.access.redhat.com/ubi9/ubi:9.3-1610

ENV HTTP_PROXY $http_proxy
ENV HTTPS_PROXY $https_proxy
ARG P4_NAME
ENV P4_NAME $P4_NAME

COPY . /src
WORKDIR /src
RUN mkdir -pv /opt/ && tar -zxvf p4.tar.gz -C /opt/ && rm -f p4.tar.gz

COPY p4 /opt/p4/rh_mvp
COPY p4 /opt/p4/${P4_NAME}
COPY images/entrypoint.sh /
COPY images/es2k_skip_p4.conf.template /

Expand Down
9 changes: 6 additions & 3 deletions p4sdk/images/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func_set_br_pipe(){
# Wait for 30s
sleep 30
# Set the Forwarding pipeline
$P4CP_INSTALL/bin/p4rt-ctl set-pipe br0 /opt/p4/rh_mvp/rh_mvp.pb.bin /opt/p4/rh_mvp/rh_mvp.p4info.txt
$P4CP_INSTALL/bin/p4rt-ctl set-pipe br0 "/opt/p4/$P4_NAME/$P4_NAME.pb.bin" "/opt/p4/$P4_NAME/$P4_NAME.p4info.txt"
}


Expand All @@ -38,14 +38,17 @@ IOMMU_GROUP=$(awk '{print $5}' $CPF_INFO_FILE)
CPF_BDF=$(awk '{print $2}' $CPF_INFO_FILE)
export IOMMU_GROUP
export CPF_BDF
# Note that P4_NAME is also envsubst along with above
# which comes from the Dockerfile

mkdir -p $CONF_DIR
envsubst < $CONF_FILE.template > $CONF_DIR/$CONF_FILE

touch /opt/p4/rh_mvp/tofino.bin

touch "/opt/p4/$P4_NAME/tofino.bin"
$P4CP_INSTALL/bin/tdi_pipeline_builder \
--p4c_conf_file=/usr/share/stratum/es2k/es2k_skip_p4.conf \
--tdi_pipeline_config_binary_file=/opt/p4/rh_mvp/rh_mvp.pb.bin
--tdi_pipeline_config_binary_file="/opt/p4/$P4_NAME/$P4_NAME.pb.bin"

# Set hugepages
mkdir -p /dev/hugepages
Expand Down
10 changes: 5 additions & 5 deletions p4sdk/images/es2k_skip_p4.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
"eal-args": "--lcores=1-2 -a $CPF_BDF,vport=[0-1] -- -i --rxq=1 --txq=1 --hairpinq=1 --hairpin-mode=0x0",
"p4_programs": [
{
"program-name": "rh_mvp",
"tdi-config": "/opt/p4/rh_mvp/rh_mvp.tdi.json",
"program-name": "$P4_NAME",
"tdi-config": "/opt/p4/$P4_NAME/$P4_NAME.tdi.json",
"p4_pipelines": [
{
"p4_pipeline_name": "main",
"context": "/opt/p4/rh_mvp/rh_mvp.context.json",
"config": "/opt/p4/rh_mvp/tofino.bin",
"context": "/opt/p4/$P4_NAME/$P4_NAME.context.json",
"config": "/opt/p4/$P4_NAME/tofino.bin",
"pipe_scope": [
0,
1,
2,
3
],
"path": "/opt/p4/rh_mvp"
"path": "/opt/p4/$P4_NAME"
}
]
}
Expand Down
Loading