Skip to content

Commit 9915737

Browse files
[SDFAB-585] Moving p4src/ in p4src/tna (#386)
* Move p4src/ in p4src/tna * Fix Tofino P4C_OUT path for all tests
1 parent 66f0cbe commit 9915737

25 files changed

+18
-16
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright 2020-present Open Networking Foundation
22
# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
3-
p4src/build
3+
p4src/tna/build
44
target
55
*.pyc
66
src/main/resources/p4c-out

Makefile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,36 @@ build: clean $(PROFILES) pipeconf
3535

3636
all: $(PROFILES)
3737

38+
3839
fabric:
39-
@$(DIR)/p4src/build.sh fabric ""
40+
@$(DIR)/p4src/tna/build.sh fabric ""
41+
4042

4143
# Profiles which are not completed yet.
4244
# fabric-simple:
43-
# @$(DIR)/p4src/build.sh fabric-simple "-DWITH_SIMPLE_NEXT"
45+
# @$(DIR)/p4src/tna/build.sh fabric-simple "-DWITH_SIMPLE_NEXT"
4446

4547
# fabric-bng:
46-
# @$(DIR)/p4src/build.sh fabric-bng "-DWITH_BNG -DWITHOUT_XCONNECT"
48+
# @$(DIR)/p4src/tna/build.sh fabric-bng "-DWITH_BNG -DWITHOUT_XCONNECT"
4749

4850
fabric-int:
49-
@$(DIR)/p4src/build.sh fabric-int "-DWITH_INT"
51+
@$(DIR)/p4src/tna/build.sh fabric-int "-DWITH_INT"
5052

5153
fabric-spgw:
52-
@$(DIR)/p4src/build.sh fabric-spgw "-DWITH_SPGW"
54+
@$(DIR)/p4src/tna/build.sh fabric-spgw "-DWITH_SPGW"
5355

5456
fabric-spgw-int:
55-
@$(DIR)/p4src/build.sh fabric-spgw-int "-DWITH_SPGW -DWITH_INT"
57+
@$(DIR)/p4src/tna/build.sh fabric-spgw-int "-DWITH_SPGW -DWITH_INT"
5658

5759
constants:
5860
docker run -v $(DIR):$(DIR) -w $(DIR) --rm --user $(UID) \
5961
--entrypoint ./util/gen-p4-constants.py $(TESTER_DOCKER_IMG) \
6062
-o $(DIR)/src/main/java/org/stratumproject/fabric/tna/behaviour/P4InfoConstants.java \
61-
p4info $(DIR)/p4src/build/fabric-spgw-int/sde_$(SDE_VER_)/p4info.txt
63+
p4info $(DIR)/p4src/tna/build/fabric-spgw-int/sde_$(SDE_VER_)/p4info.txt
6264
docker run -v $(DIR):$(DIR) -w $(DIR) --rm \
6365
--user $(UID) \
6466
$(SDE_P4C_DOCKER_IMG) \
65-
get-hdr-size.py --py-out "$(DIR)/ptf/tests/common/bmd_bytes.py" "$(DIR)/p4src/build"
67+
get-hdr-size.py --py-out "$(DIR)/ptf/tests/common/bmd_bytes.py" "$(DIR)/p4src/tna/build"
6668

6769
_m2_vol:
6870
docker volume create --opt o=uid=$(UID) --opt device=tmpfs --opt type=tmpfs $(MVN_CACHE)
@@ -117,7 +119,7 @@ netcfg:
117119

118120
p4i:
119121
$(info *** Started p4i app at http://localhost:3000)
120-
docker run -d --rm --name p4i -v$(DIR):$(DIR)/p4src/build -w $(DIR)/p4src/build -p 3000:3000/tcp --init --cap-add CAP_SYS_ADMIN --cap-add CAP_NET_ADMIN $(SDE_P4I_DOCKER_IMG) xvfb-run /opt/p4i/p4i
122+
docker run -d --rm --name p4i -v$(DIR):$(DIR)/p4src/tna/build -w $(DIR)/p4src/tna/build -p 3000:3000/tcp --init --cap-add CAP_SYS_ADMIN --cap-add CAP_NET_ADMIN $(SDE_P4I_DOCKER_IMG) xvfb-run /opt/p4i/p4i
121123

122124
p4i-stop:
123125
docker kill p4i
@@ -133,7 +135,7 @@ format:
133135

134136
clean:
135137
-rm -rf src/main/resources/p4c-out
136-
-rm -rf p4src/build
138+
-rm -rf p4src/tna/build
137139
-rm -rf target
138140

139141
deep-clean: clean

p4src/build.sh renamed to p4src/tna/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ MONTARA_CPU_PORT=192 # dual-pipe
1010
# DIR is this file directory.
1111
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1212
P4_SRC_DIR=${DIR}
13-
ROOT_DIR="$( cd "${DIR}/../" && pwd )"
13+
ROOT_DIR="$( cd "${DIR}/../.." && pwd )"
1414

1515
PROFILE=$1
1616
OTHER_PP_FLAGS=$2
@@ -20,7 +20,7 @@ source "${ROOT_DIR}/.env"
2020

2121
# PWD is the directory where this script is called from (should be the root of
2222
# this repo).
23-
P4C_OUT=${ROOT_DIR}/p4src/build/${PROFILE}
23+
P4C_OUT=${ROOT_DIR}/p4src/tna/build/${PROFILE}
2424
# Prevent the creation by docker run to avoid having root owner
2525
mkdir -p "${P4C_OUT}"
2626

0 commit comments

Comments
 (0)