Skip to content

Commit 50a6560

Browse files
authored
Updates to P4 tools for 2024-Sep-01 (#633)
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
1 parent 9797933 commit 50a6560

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

utils/p4runtime_lib/helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def __init__(self, p4_info_filepath):
2626
p4info = p4info_pb2.P4Info()
2727
# Load the p4info file into a skeleton P4Info object
2828
with open(p4_info_filepath) as p4info_f:
29-
google.protobuf.text_format.Merge(p4info_f.read(), p4info)
29+
google.protobuf.text_format.Merge(p4info_f.read(), p4info,
30+
allow_unknown_field=True)
3031
self.p4info = p4info
3132

3233
def get(self, entity_type, name=None, id=None):

vm-ubuntu-24.04/patches/p4runtime-shell-2023-changes.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
diff --git a/p4runtime_sh/p4runtime.py b/p4runtime_sh/p4runtime.py
2+
index f858f92..85ef344 100644
3+
--- a/p4runtime_sh/p4runtime.py
4+
+++ b/p4runtime_sh/p4runtime.py
5+
@@ -289,7 +289,7 @@ class P4RuntimeClient:
6+
with open(p4info_path, 'r') as f1:
7+
with open(bin_path, 'rb') as f2:
8+
try:
9+
- google.protobuf.text_format.Merge(f1.read(), req.config.p4info)
10+
+ google.protobuf.text_format.Merge(f1.read(), req.config.p4info, allow_unknown_field=True)
11+
except google.protobuf.text_format.ParseError:
12+
logging.error("Error when parsing P4Info")
13+
raise
114
diff --git a/setup.cfg b/setup.cfg
215
index 07c5c31..8a9dad9 100644
316
--- a/setup.cfg

vm-ubuntu-24.04/user-dev-bootstrap.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ change_owner_and_group_of_venv_lib_python3_files() {
1515
set -xe
1616

1717
#Src
18-
BMV2_COMMIT="a8e2947aefe660d11df53ff44854d112d545db38" # 2024-Aug-01
19-
PI_COMMIT="05cb92564af77ae4826565cbde84e3fd4960c6bd" # 2024-Aug-01
20-
P4C_COMMIT="a7d6e351c016843cab60fb62aa233c1279512edd" # 2024-Aug-01
21-
PTF_COMMIT="c554f83685186be4cfa9387eb5d6d700d2bbd7c0" # 2024-Aug-01
18+
BMV2_COMMIT="ec328ab87fe10cea0e061a4d9eb15408fb49729a" # 2024-Sep-01
19+
PI_COMMIT="5eae9c84d7a55f9554775e498b9146f67eac7bd4" # 2024-Sep-01
20+
P4C_COMMIT="3306162acd9e60e06c5574dc28d67df71a78cbad" # 2024-Sep-01
21+
PTF_COMMIT="c554f83685186be4cfa9387eb5d6d700d2bbd7c0" # 2024-Sep-01
2222

2323
# Versions installed by Ubuntu apt
2424
PROTOBUF_PKG_VERSION="3.21.12"

0 commit comments

Comments
 (0)