Skip to content

Commit

Permalink
Merging f5_usecase into main (#236)
Browse files Browse the repository at this point in the history
* Adding bfrt to tdi changes. Doesn't contain linux networking

Signed-off-by: Sayan Bandyopadhyay <[email protected]>

* Adding changes for linux networking packages 1.6 and 1.8 (#228)

* Adding changes for linux networking packages 1.6 and 1.8

* Artifacts for 1.6 and 1.8 linux networking
* Changes to Dockerfile to enable changing p4 program with only change
in Makefile env variable

Signed-off-by: Sayan Bandyopadhyay <[email protected]>

* Sttatic analysis fails

Signed-off-by: Sayan Bandyopadhyay <[email protected]>

---------

Signed-off-by: Sayan Bandyopadhyay <[email protected]>

---------

Signed-off-by: Sayan Bandyopadhyay <[email protected]>
  • Loading branch information
saynb authored Oct 25, 2024
1 parent d81d578 commit f54bf8d
Show file tree
Hide file tree
Showing 14 changed files with 128,474 additions and 10 deletions.
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
P4_DIR = p4-rh_mvp
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

0 comments on commit f54bf8d

Please sign in to comment.