Bumped P4Runtime to v1.0.0
Change-Id: Ie6419e45980a0394ce1e0439831f4b011a4d7487
diff --git a/core/api/src/main/java/org/onosproject/net/pi/model/PiTableModel.java b/core/api/src/main/java/org/onosproject/net/pi/model/PiTableModel.java
index f7ba1bd..80e41df 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/model/PiTableModel.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/model/PiTableModel.java
@@ -101,15 +101,6 @@
Optional<PiActionModel> constDefaultAction();
/**
- * Returns true if the default action has mutable parameters that can be
- * changed at runtime, false otherwise.
- *
- * @return true if the default action has mutable parameters, false
- * otherwise
- */
- boolean hasDefaultMutableParams();
-
- /**
* Returns true if the table is populated with static entries that cannot be
* modified by the control plane at runtime.
*
diff --git a/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4InfoParser.java b/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4InfoParser.java
index ff49928..16203b1 100644
--- a/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4InfoParser.java
+++ b/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4InfoParser.java
@@ -215,7 +215,6 @@
tableFieldMapBuilder.build(),
tableActionMapBuilder.build(),
actionMap.get(tableMsg.getConstDefaultActionId()),
- tableMsg.getConstDefaultActionHasMutableParams(),
tableMsg.getIsConstTable()));
}
diff --git a/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4TableModel.java b/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4TableModel.java
index 5afad85..2eed1bb 100644
--- a/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4TableModel.java
+++ b/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4TableModel.java
@@ -49,7 +49,6 @@
private final ImmutableMap<PiMatchFieldId, PiMatchFieldModel> matchFields;
private final ImmutableMap<PiActionId, PiActionModel> actions;
private final PiActionModel constDefaultAction;
- private final boolean hasDefaultMutableParams;
private final boolean isConstTable;
P4TableModel(PiTableId id, PiTableType tableType,
@@ -58,7 +57,7 @@
ImmutableMap<PiMeterId, PiMeterModel> meters, boolean supportAging,
ImmutableMap<PiMatchFieldId, PiMatchFieldModel> matchFields,
ImmutableMap<PiActionId, PiActionModel> actions,
- PiActionModel constDefaultAction, boolean hasDefaultMutableParams,
+ PiActionModel constDefaultAction,
boolean isConstTable) {
this.id = id;
this.tableType = tableType;
@@ -70,7 +69,6 @@
this.matchFields = matchFields;
this.actions = actions;
this.constDefaultAction = constDefaultAction;
- this.hasDefaultMutableParams = hasDefaultMutableParams;
this.isConstTable = isConstTable;
}
@@ -125,11 +123,6 @@
}
@Override
- public boolean hasDefaultMutableParams() {
- return hasDefaultMutableParams;
- }
-
- @Override
public boolean isConstantTable() {
return isConstTable;
}
@@ -148,7 +141,7 @@
public int hashCode() {
return Objects.hash(id, tableType, actionProfile, maxSize, counters,
meters, supportAging, matchFields, actions,
- constDefaultAction, hasDefaultMutableParams);
+ constDefaultAction);
}
@Override
@@ -169,7 +162,6 @@
&& Objects.equals(this.supportAging, other.supportAging)
&& Objects.equals(this.matchFields, other.matchFields)
&& Objects.equals(this.actions, other.actions)
- && Objects.equals(this.constDefaultAction, other.constDefaultAction)
- && Objects.equals(this.hasDefaultMutableParams, other.hasDefaultMutableParams);
+ && Objects.equals(this.constDefaultAction, other.constDefaultAction);
}
}
diff --git a/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4PipelineModelTest.java b/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4PipelineModelTest.java
index da10762..00bc067 100644
--- a/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4PipelineModelTest.java
+++ b/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4PipelineModelTest.java
@@ -266,20 +266,17 @@
private static final boolean SUPPORT_AGING_1 = true;
private static final boolean SUPPORT_AGING_2 = false;
- private static final boolean HAS_DEFAULT_MUTABLE_PARAMS_1 = true;
- private static final boolean HAS_DEFAULT_MUTABLE_PARAMS_2 = false;
-
private static final boolean IS_CONST_TABLE_1 = true;
private static final boolean IS_CONST_TABLE_2 = false;
private static final PiTableModel P4_TABLE_MODEL_1 =
new P4TableModel(PI_TABLE_ID_1, PI_TABLE_TYPE_1, P4_ACTION_PROFILE_MODEL_1, MAX_SIZE_1, COUNTERS_1,
METERS_1, SUPPORT_AGING_1, MATCH_FIELDS_1, ACTIONS_1, P4_ACTION_MODEL_DEFAULT_1,
- HAS_DEFAULT_MUTABLE_PARAMS_1, IS_CONST_TABLE_1);
+ IS_CONST_TABLE_1);
private static final PiTableModel P4_TABLE_MODEL_2 =
new P4TableModel(PI_TABLE_ID_2, PI_TABLE_TYPE_2, P4_ACTION_PROFILE_MODEL_2, MAX_SIZE_2, COUNTERS_2,
METERS_2, SUPPORT_AGING_2, MATCH_FIELDS_2, ACTIONS_2, P4_ACTION_MODEL_DEFAULT_2,
- HAS_DEFAULT_MUTABLE_PARAMS_2, IS_CONST_TABLE_2);
+ IS_CONST_TABLE_2);
/* Packet operations */
private static final PiPacketOperationType PI_PACKET_OPERATION_TYPE_1 = PiPacketOperationType.PACKET_IN;
diff --git a/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4TableModelTest.java b/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4TableModelTest.java
index 89b10d0..2172058 100644
--- a/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4TableModelTest.java
+++ b/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4TableModelTest.java
@@ -239,24 +239,21 @@
private static final boolean SUPPORT_AGING_1 = true;
private static final boolean SUPPORT_AGING_2 = false;
- private static final boolean HAS_DEFAULT_MUTABLE_PARAMS_1 = true;
- private static final boolean HAS_DEFAULT_MUTABLE_PARAMS_2 = false;
-
private static final boolean IS_CONST_TABLE_1 = true;
private static final boolean IS_CONST_TABLE_2 = false;
private static final PiTableModel P4_TABLE_MODEL_1 =
new P4TableModel(PI_TABLE_ID_1, PI_TABLE_TYPE_1, P4_ACTION_PROFILE_MODEL_1, MAX_SIZE_1, COUNTERS_1,
METERS_1, SUPPORT_AGING_1, MATCH_FIELDS_1, ACTIONS_1, P4_ACTION_MODEL_DEFAULT_1,
- HAS_DEFAULT_MUTABLE_PARAMS_1, IS_CONST_TABLE_1);
+ IS_CONST_TABLE_1);
private static final PiTableModel SAME_AS_P4_TABLE_MODEL_1 =
new P4TableModel(PI_TABLE_ID_1, PI_TABLE_TYPE_1, P4_ACTION_PROFILE_MODEL_1, MAX_SIZE_1, COUNTERS_1,
METERS_1, SUPPORT_AGING_1, MATCH_FIELDS_1, ACTIONS_1, P4_ACTION_MODEL_DEFAULT_1,
- HAS_DEFAULT_MUTABLE_PARAMS_1, IS_CONST_TABLE_1);
+ IS_CONST_TABLE_1);
private static final PiTableModel P4_TABLE_MODEL_2 =
new P4TableModel(PI_TABLE_ID_2, PI_TABLE_TYPE_2, P4_ACTION_PROFILE_MODEL_2, MAX_SIZE_2, COUNTERS_2,
METERS_2, SUPPORT_AGING_2, MATCH_FIELDS_2, ACTIONS_2, P4_ACTION_MODEL_DEFAULT_2,
- HAS_DEFAULT_MUTABLE_PARAMS_2, IS_CONST_TABLE_2);
+ IS_CONST_TABLE_2);
/**
* Checks that the P4TableModel class is immutable.
diff --git a/tools/build/bazel/p4lang_workspace.bzl b/tools/build/bazel/p4lang_workspace.bzl
index bc054fe..fba260e 100644
--- a/tools/build/bazel/p4lang_workspace.bzl
+++ b/tools/build/bazel/p4lang_workspace.bzl
@@ -1,17 +1,17 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-P4RUNTIME_COMMIT = "a6f81ac53c6b56d75a9603690794196d67c5dc07"
-PI_COMMIT = "539e4624f16aac39f8890a6dfb11c65040e735ad"
+P4RUNTIME_VER = "1.0.0"
+P4RUNTIME_SHA = "667464bd369b40b58dc9552be2c84e190a160b6e77137b735bd86e5b81c6adc0"
-P4RUNTIME_SHA = "28b79868bcfd61058cdd3f77a7a021a1add19154fa6717bf921a64cece32caf3"
+PI_COMMIT = "539e4624f16aac39f8890a6dfb11c65040e735ad"
PI_SHA = "a16024972c15e6d35466996bbb748e4b7bef819c1c93f05a0f2228062736c35a"
def generate_p4lang():
http_archive(
name = "com_github_p4lang_p4runtime",
- urls = ["https://github.com/p4lang/p4runtime/archive/%s.zip" % P4RUNTIME_COMMIT],
+ urls = ["https://github.com/p4lang/p4runtime/archive/v%s.zip" % P4RUNTIME_VER],
sha256 = P4RUNTIME_SHA,
- strip_prefix = "p4runtime-%s/proto" % P4RUNTIME_COMMIT,
+ strip_prefix = "p4runtime-%s/proto" % P4RUNTIME_VER,
build_file = "//tools/build/bazel:p4runtime_BUILD",
)
diff --git a/tools/dev/p4vm/install-p4-tools.sh b/tools/dev/p4vm/install-p4-tools.sh
index 3abbb4a..4516c8e 100755
--- a/tools/dev/p4vm/install-p4-tools.sh
+++ b/tools/dev/p4vm/install-p4-tools.sh
@@ -21,9 +21,9 @@
BUILD_DIR=~/p4tools
# in case BMV2_COMMIT value is updated, the same variable in
# protocols/bmv2/thrift-api/BUCK file should also be updated
-BMV2_COMMIT="ae87b4d4523488ac935133b4aef437796ad1bbd1"
-PI_COMMIT="539e4624f16aac39f8890a6dfb11c65040e735ad"
-P4C_COMMIT="380830f6c26135d1d65e1312e3ba2da628c18145"
+BMV2_COMMIT="7fd3b39519ca892c2e160b8be358d3f487b1b00e"
+PI_COMMIT="a95222eca9b039f6398c048d7e1a1bf7f49b7235"
+P4C_COMMIT="264da2c524c849df0d9ba478cdd1d61b29d64722"
PROTOBUF_COMMIT="tags/v3.2.0"
GRPC_COMMIT="tags/v1.3.2"
LIBYANG_COMMIT="v0.14-r1"
@@ -154,6 +154,9 @@
}
function do_protobuf {
+ if check_lib libprotobuf; then
+ return
+ fi
cd ${BUILD_DIR}
if [ ! -d protobuf ]; then
git clone https://github.com/google/protobuf.git
@@ -177,6 +180,9 @@
}
function do_grpc {
+ if check_lib libgrpc; then
+ return
+ fi
cd ${BUILD_DIR}
if [ ! -d grpc ]; then
git clone https://github.com/grpc/grpc.git
@@ -369,6 +375,15 @@
[ "$1" == "$latest" ]
}
+function check_lib {
+ ldconfig -p | grep $1 &> /dev/null
+ if [ $? == 0 ]; then
+ echo "$1 found!"
+ return 0 # true
+ fi
+ return 1 # false
+}
+
MUST_DO_ALL=false
DID_REQUIREMENTS=false
function check_and_do {
@@ -402,9 +417,13 @@
DID_REQUIREMENTS=true
fi
eval ${func_name}
- echo ${commit_id} > ${commit_file}
- # Build all next projects as they might depend on this one.
- MUST_DO_ALL=true
+ if [[ -d ${BUILD_DIR}/${proj_dir} ]]; then
+ # If project was built, we expect its dir. Otherwise, we assume
+ # build was skipped.
+ echo ${commit_id} > ${commit_file}
+ # Build all next projects as they might depend on this one.
+ MUST_DO_ALL=true
+ fi
# Disable printing to reduce output
set +x
else