mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-18 19:01:06 +02:00
[ONOS-7311] and [ONOS-7197] Update ONOS to support most recent version of BMv2 and PI
Change-Id: Ie69cfe1946f3c9241dc7f59a64bd40005a063931
This commit is contained in:
parent
61881df1ee
commit
8bcd5863ff
@ -1,5 +1,5 @@
|
|||||||
GRPC_VER = '1.3.0'
|
GRPC_VER = '1.3.0'
|
||||||
PROTOBUF_VER = '3.0.2'
|
PROTOBUF_VER = '3.2.0'
|
||||||
|
|
||||||
COMPILE_DEPS = [
|
COMPILE_DEPS = [
|
||||||
'//lib:CORE_DEPS',
|
'//lib:CORE_DEPS',
|
||||||
|
@ -25,7 +25,6 @@ import org.junit.Test;
|
|||||||
import org.onlab.util.ImmutableByteSequence;
|
import org.onlab.util.ImmutableByteSequence;
|
||||||
import org.onosproject.grpc.ctl.GrpcControllerImpl;
|
import org.onosproject.grpc.ctl.GrpcControllerImpl;
|
||||||
import org.onosproject.net.DeviceId;
|
import org.onosproject.net.DeviceId;
|
||||||
import org.onosproject.net.pi.model.PiActionGroupType;
|
|
||||||
import org.onosproject.net.pi.model.PiActionId;
|
import org.onosproject.net.pi.model.PiActionId;
|
||||||
import org.onosproject.net.pi.model.PiActionParamId;
|
import org.onosproject.net.pi.model.PiActionParamId;
|
||||||
import org.onosproject.net.pi.model.PiActionProfileId;
|
import org.onosproject.net.pi.model.PiActionProfileId;
|
||||||
@ -64,7 +63,6 @@ import static org.onlab.util.ImmutableByteSequence.ofZeros;
|
|||||||
import static org.onosproject.net.pi.model.PiPacketOperationType.PACKET_OUT;
|
import static org.onosproject.net.pi.model.PiPacketOperationType.PACKET_OUT;
|
||||||
import static org.onosproject.net.pi.model.PiPipeconf.ExtensionType.BMV2_JSON;
|
import static org.onosproject.net.pi.model.PiPipeconf.ExtensionType.BMV2_JSON;
|
||||||
import static org.slf4j.LoggerFactory.getLogger;
|
import static org.slf4j.LoggerFactory.getLogger;
|
||||||
import static p4.P4RuntimeOuterClass.ActionProfileGroup.Type.SELECT;
|
|
||||||
import static p4.P4RuntimeOuterClass.Update.Type.INSERT;
|
import static p4.P4RuntimeOuterClass.Update.Type.INSERT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -170,7 +168,6 @@ public class P4RuntimeTest {
|
|||||||
P4RuntimeOuterClass.ActionProfileGroup groupMsg = P4RuntimeOuterClass.ActionProfileGroup.newBuilder()
|
P4RuntimeOuterClass.ActionProfileGroup groupMsg = P4RuntimeOuterClass.ActionProfileGroup.newBuilder()
|
||||||
.setActionProfileId(actionProfileId)
|
.setActionProfileId(actionProfileId)
|
||||||
.setGroupId(1)
|
.setGroupId(1)
|
||||||
.setType(SELECT)
|
|
||||||
.addMembers(P4RuntimeOuterClass.ActionProfileGroup.Member.newBuilder()
|
.addMembers(P4RuntimeOuterClass.ActionProfileGroup.Member.newBuilder()
|
||||||
.setMemberId(1)
|
.setMemberId(1)
|
||||||
.setWeight(1)
|
.setWeight(1)
|
||||||
@ -269,7 +266,6 @@ public class P4RuntimeTest {
|
|||||||
members.add(member);
|
members.add(member);
|
||||||
}
|
}
|
||||||
PiActionGroup actionGroup = PiActionGroup.builder()
|
PiActionGroup actionGroup = PiActionGroup.builder()
|
||||||
.withType(PiActionGroupType.SELECT)
|
|
||||||
.withActionProfileId(actionProfileId)
|
.withActionProfileId(actionProfileId)
|
||||||
.withId(groupId)
|
.withId(groupId)
|
||||||
.addMembers(members)
|
.addMembers(members)
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2017-present Open Networking Foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.onosproject.net.pi.model;
|
|
||||||
|
|
||||||
import com.google.common.annotations.Beta;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Type of action group in a protocol-independent pipeline.
|
|
||||||
*/
|
|
||||||
@Beta
|
|
||||||
public enum PiActionGroupType {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs load-balancing among different members of the group.
|
|
||||||
*/
|
|
||||||
SELECT
|
|
||||||
}
|
|
@ -21,7 +21,6 @@ import com.google.common.base.MoreObjects;
|
|||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import org.onosproject.net.pi.model.PiActionGroupType;
|
|
||||||
import org.onosproject.net.pi.model.PiActionProfileId;
|
import org.onosproject.net.pi.model.PiActionProfileId;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -37,15 +36,12 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||||||
public final class PiActionGroup implements PiEntity {
|
public final class PiActionGroup implements PiEntity {
|
||||||
|
|
||||||
private final PiActionGroupId id;
|
private final PiActionGroupId id;
|
||||||
private final PiActionGroupType type;
|
|
||||||
private final ImmutableSet<PiActionGroupMember> members;
|
private final ImmutableSet<PiActionGroupMember> members;
|
||||||
private final PiActionProfileId piActionProfileId;
|
private final PiActionProfileId piActionProfileId;
|
||||||
|
|
||||||
private PiActionGroup(PiActionGroupId id, PiActionGroupType type,
|
private PiActionGroup(PiActionGroupId id, ImmutableSet<PiActionGroupMember> members,
|
||||||
ImmutableSet<PiActionGroupMember> members,
|
|
||||||
PiActionProfileId piActionProfileId) {
|
PiActionProfileId piActionProfileId) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.type = type;
|
|
||||||
this.members = members;
|
this.members = members;
|
||||||
this.piActionProfileId = piActionProfileId;
|
this.piActionProfileId = piActionProfileId;
|
||||||
}
|
}
|
||||||
@ -59,15 +55,6 @@ public final class PiActionGroup implements PiEntity {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the type of this action group.
|
|
||||||
*
|
|
||||||
* @return action group type
|
|
||||||
*/
|
|
||||||
public PiActionGroupType type() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the members of this action group.
|
* Returns the members of this action group.
|
||||||
*
|
*
|
||||||
@ -96,21 +83,19 @@ public final class PiActionGroup implements PiEntity {
|
|||||||
}
|
}
|
||||||
PiActionGroup that = (PiActionGroup) o;
|
PiActionGroup that = (PiActionGroup) o;
|
||||||
return Objects.equal(id, that.id) &&
|
return Objects.equal(id, that.id) &&
|
||||||
Objects.equal(type, that.type) &&
|
|
||||||
Objects.equal(members, that.members) &&
|
Objects.equal(members, that.members) &&
|
||||||
Objects.equal(piActionProfileId, that.piActionProfileId);
|
Objects.equal(piActionProfileId, that.piActionProfileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(id, type, members);
|
return Objects.hashCode(id, members);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return MoreObjects.toStringHelper(this)
|
return MoreObjects.toStringHelper(this)
|
||||||
.add("groupId", id)
|
.add("groupId", id)
|
||||||
.add("type", type)
|
|
||||||
.add("members", members)
|
.add("members", members)
|
||||||
.add("piActionProfileId", piActionProfileId)
|
.add("piActionProfileId", piActionProfileId)
|
||||||
.toString();
|
.toString();
|
||||||
@ -136,7 +121,6 @@ public final class PiActionGroup implements PiEntity {
|
|||||||
public static final class Builder {
|
public static final class Builder {
|
||||||
|
|
||||||
private PiActionGroupId id;
|
private PiActionGroupId id;
|
||||||
private PiActionGroupType type;
|
|
||||||
private Map<PiActionGroupMemberId, PiActionGroupMember> members = Maps.newHashMap();
|
private Map<PiActionGroupMemberId, PiActionGroupMember> members = Maps.newHashMap();
|
||||||
private PiActionProfileId piActionProfileId;
|
private PiActionProfileId piActionProfileId;
|
||||||
|
|
||||||
@ -155,17 +139,6 @@ public final class PiActionGroup implements PiEntity {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the type of this action group.
|
|
||||||
*
|
|
||||||
* @param type action group type
|
|
||||||
* @return this
|
|
||||||
*/
|
|
||||||
public Builder withType(PiActionGroupType type) {
|
|
||||||
this.type = type;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds one member to this action group.
|
* Adds one member to this action group.
|
||||||
*
|
*
|
||||||
@ -206,11 +179,9 @@ public final class PiActionGroup implements PiEntity {
|
|||||||
*/
|
*/
|
||||||
public PiActionGroup build() {
|
public PiActionGroup build() {
|
||||||
checkNotNull(id);
|
checkNotNull(id);
|
||||||
checkNotNull(type);
|
|
||||||
checkArgument(!members.isEmpty(), "Members cannot be empty");
|
checkArgument(!members.isEmpty(), "Members cannot be empty");
|
||||||
checkNotNull(piActionProfileId);
|
checkNotNull(piActionProfileId);
|
||||||
return new PiActionGroup(id, type,
|
return new PiActionGroup(id, ImmutableSet.copyOf(members.values()),
|
||||||
ImmutableSet.copyOf(members.values()),
|
|
||||||
piActionProfileId);
|
piActionProfileId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,8 +57,7 @@ public final class PiActionGroupMember {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the weight associated to this member. Meaningful if the action group of this member is of type {@link
|
* Returns the weight associated to this member.
|
||||||
* org.onosproject.net.pi.model.PiActionGroupType#SELECT}.
|
|
||||||
*
|
*
|
||||||
* @return weight
|
* @return weight
|
||||||
*/
|
*/
|
||||||
@ -139,8 +138,7 @@ public final class PiActionGroupMember {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the weight of this member. Meaningful only if the action group is of type {@link
|
* Sets the weight of this member.
|
||||||
* org.onosproject.net.pi.model.PiActionGroupType#SELECT}.
|
|
||||||
* <p>
|
* <p>
|
||||||
* Default value is 0.
|
* Default value is 0.
|
||||||
*
|
*
|
||||||
|
@ -20,7 +20,6 @@ import com.google.common.collect.Lists;
|
|||||||
import com.google.common.testing.EqualsTester;
|
import com.google.common.testing.EqualsTester;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.onosproject.net.pi.model.PiActionGroupType;
|
|
||||||
import org.onosproject.net.pi.model.PiActionId;
|
import org.onosproject.net.pi.model.PiActionId;
|
||||||
import org.onosproject.net.pi.model.PiActionParamId;
|
import org.onosproject.net.pi.model.PiActionParamId;
|
||||||
|
|
||||||
@ -54,14 +53,12 @@ public class PiActionGroupTest {
|
|||||||
private PiActionGroup piActionGroup1 = PiActionGroup.builder()
|
private PiActionGroup piActionGroup1 = PiActionGroup.builder()
|
||||||
.addMember(piActionGroupMember)
|
.addMember(piActionGroupMember)
|
||||||
.withId(piActionGroupId)
|
.withId(piActionGroupId)
|
||||||
.withType(PiActionGroupType.SELECT)
|
|
||||||
.withActionProfileId(ACTION_PROF_ID)
|
.withActionProfileId(ACTION_PROF_ID)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
private PiActionGroup sameAsPiActionGroup1 = PiActionGroup.builder()
|
private PiActionGroup sameAsPiActionGroup1 = PiActionGroup.builder()
|
||||||
.addMember(piActionGroupMember)
|
.addMember(piActionGroupMember)
|
||||||
.withId(piActionGroupId)
|
.withId(piActionGroupId)
|
||||||
.withType(PiActionGroupType.SELECT)
|
|
||||||
.withActionProfileId(ACTION_PROF_ID)
|
.withActionProfileId(ACTION_PROF_ID)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@ -69,7 +66,6 @@ public class PiActionGroupTest {
|
|||||||
private PiActionGroup piActionGroup2 = PiActionGroup.builder()
|
private PiActionGroup piActionGroup2 = PiActionGroup.builder()
|
||||||
.addMember(piActionGroupMember)
|
.addMember(piActionGroupMember)
|
||||||
.withId(piActionGroupId2)
|
.withId(piActionGroupId2)
|
||||||
.withType(PiActionGroupType.SELECT)
|
|
||||||
.withActionProfileId(ACTION_PROF_ID)
|
.withActionProfileId(ACTION_PROF_ID)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@ -105,7 +101,6 @@ public class PiActionGroupTest {
|
|||||||
piActionGroupMembers.add(piActionGroupMember);
|
piActionGroupMembers.add(piActionGroupMember);
|
||||||
assertThat(piActionGroup1, is(notNullValue()));
|
assertThat(piActionGroup1, is(notNullValue()));
|
||||||
assertThat(piActionGroup1.id(), is(piActionGroupId));
|
assertThat(piActionGroup1.id(), is(piActionGroupId));
|
||||||
assertThat(piActionGroup1.type(), is(PiActionGroupType.SELECT));
|
|
||||||
assertThat("Incorrect members value",
|
assertThat("Incorrect members value",
|
||||||
CollectionUtils.isEqualCollection(piActionGroup1.members(), piActionGroupMembers));
|
CollectionUtils.isEqualCollection(piActionGroup1.members(), piActionGroupMembers));
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ package org.onosproject.net.pi.impl;
|
|||||||
import org.onosproject.net.Device;
|
import org.onosproject.net.Device;
|
||||||
import org.onosproject.net.group.Group;
|
import org.onosproject.net.group.Group;
|
||||||
import org.onosproject.net.group.GroupBucket;
|
import org.onosproject.net.group.GroupBucket;
|
||||||
import org.onosproject.net.pi.model.PiActionGroupType;
|
|
||||||
import org.onosproject.net.pi.model.PiPipeconf;
|
import org.onosproject.net.pi.model.PiPipeconf;
|
||||||
import org.onosproject.net.pi.model.PiPipelineInterpreter;
|
import org.onosproject.net.pi.model.PiPipelineInterpreter;
|
||||||
import org.onosproject.net.pi.runtime.PiAction;
|
import org.onosproject.net.pi.runtime.PiAction;
|
||||||
@ -63,14 +62,6 @@ final class PiGroupTranslatorImpl {
|
|||||||
final PiActionGroup.Builder piActionGroupBuilder = PiActionGroup.builder()
|
final PiActionGroup.Builder piActionGroupBuilder = PiActionGroup.builder()
|
||||||
.withId(PiActionGroupId.of(group.id().id()));
|
.withId(PiActionGroupId.of(group.id().id()));
|
||||||
|
|
||||||
switch (group.type()) {
|
|
||||||
case SELECT:
|
|
||||||
piActionGroupBuilder.withType(PiActionGroupType.SELECT);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new PiTranslationException(format("Group type %s not supported", group.type()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(group.appCookie() instanceof PiGroupKey)) {
|
if (!(group.appCookie() instanceof PiGroupKey)) {
|
||||||
throw new PiTranslationException("Group app cookie is not PI (class should be PiGroupKey)");
|
throw new PiTranslationException("Group app cookie is not PI (class should be PiGroupKey)");
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,6 @@ import org.onosproject.net.group.Group;
|
|||||||
import org.onosproject.net.group.GroupBucket;
|
import org.onosproject.net.group.GroupBucket;
|
||||||
import org.onosproject.net.group.GroupBuckets;
|
import org.onosproject.net.group.GroupBuckets;
|
||||||
import org.onosproject.net.group.GroupDescription;
|
import org.onosproject.net.group.GroupDescription;
|
||||||
import org.onosproject.net.pi.model.PiActionGroupType;
|
|
||||||
import org.onosproject.net.pi.model.PiPipeconf;
|
import org.onosproject.net.pi.model.PiPipeconf;
|
||||||
import org.onosproject.net.pi.runtime.PiAction;
|
import org.onosproject.net.pi.runtime.PiAction;
|
||||||
import org.onosproject.net.pi.runtime.PiActionGroup;
|
import org.onosproject.net.pi.runtime.PiActionGroup;
|
||||||
@ -245,8 +244,6 @@ public class PiTranslatorServiceTest {
|
|||||||
|
|
||||||
assertThat("Group ID must be equal",
|
assertThat("Group ID must be equal",
|
||||||
piGroup1.id().id(), is(equalTo(GROUP_ID.id())));
|
piGroup1.id().id(), is(equalTo(GROUP_ID.id())));
|
||||||
assertThat("Group type must be SELECT",
|
|
||||||
piGroup1.type(), is(equalTo(PiActionGroupType.SELECT)));
|
|
||||||
assertThat("Action profile ID must be equal",
|
assertThat("Action profile ID must be equal",
|
||||||
piGroup1.actionProfileId(), is(equalTo(ACT_PRF_WCMP_SELECTOR_ID)));
|
piGroup1.actionProfileId(), is(equalTo(ACT_PRF_WCMP_SELECTOR_ID)));
|
||||||
|
|
||||||
|
@ -203,7 +203,6 @@ import org.onosproject.net.meter.MeterId;
|
|||||||
import org.onosproject.net.packet.DefaultOutboundPacket;
|
import org.onosproject.net.packet.DefaultOutboundPacket;
|
||||||
import org.onosproject.net.packet.DefaultPacketRequest;
|
import org.onosproject.net.packet.DefaultPacketRequest;
|
||||||
import org.onosproject.net.packet.PacketPriority;
|
import org.onosproject.net.packet.PacketPriority;
|
||||||
import org.onosproject.net.pi.model.PiActionGroupType;
|
|
||||||
import org.onosproject.net.pi.model.PiActionId;
|
import org.onosproject.net.pi.model.PiActionId;
|
||||||
import org.onosproject.net.pi.model.PiActionParamId;
|
import org.onosproject.net.pi.model.PiActionParamId;
|
||||||
import org.onosproject.net.pi.model.PiActionProfileId;
|
import org.onosproject.net.pi.model.PiActionProfileId;
|
||||||
@ -619,7 +618,6 @@ public final class KryoNamespaces {
|
|||||||
.register(DomainConstraint.class)
|
.register(DomainConstraint.class)
|
||||||
.register(
|
.register(
|
||||||
// PI model
|
// PI model
|
||||||
PiActionGroupType.class,
|
|
||||||
PiActionId.class,
|
PiActionId.class,
|
||||||
PiActionParamId.class,
|
PiActionParamId.class,
|
||||||
PiActionProfileId.class,
|
PiActionProfileId.class,
|
||||||
|
11
lib/BUCK
11
lib/BUCK
@ -1,4 +1,4 @@
|
|||||||
# ***** This file was auto-generated at Tue, 12 Dec 2017 18:49:34 GMT. Do not edit this file manually. *****
|
# ***** This file was auto-generated at Tue, 12 Dec 2017 22:03:12 GMT. Do not edit this file manually. *****
|
||||||
# ***** Use onos-lib-gen *****
|
# ***** Use onos-lib-gen *****
|
||||||
|
|
||||||
pass_thru_pom(
|
pass_thru_pom(
|
||||||
@ -1400,15 +1400,6 @@ remote_jar (
|
|||||||
visibility = [ 'PUBLIC' ],
|
visibility = [ 'PUBLIC' ],
|
||||||
)
|
)
|
||||||
|
|
||||||
remote_jar (
|
|
||||||
name = 'protobuf-java-3.0.2',
|
|
||||||
out = 'protobuf-java-3.0.2.jar',
|
|
||||||
url = 'mvn:com.google.protobuf:protobuf-java:jar:3.0.2',
|
|
||||||
sha1 = 'ee55e8e697d10b6643d77bb1f686bac3b9ba8579',
|
|
||||||
maven_coords = 'com.google.protobuf:protobuf-java:3.0.2',
|
|
||||||
visibility = [ 'PUBLIC' ],
|
|
||||||
)
|
|
||||||
|
|
||||||
remote_jar (
|
remote_jar (
|
||||||
name = 'protobuf-java-3.2.0',
|
name = 'protobuf-java-3.2.0',
|
||||||
out = 'protobuf-java-3.2.0.jar',
|
out = 'protobuf-java-3.2.0.jar',
|
||||||
|
@ -255,7 +255,6 @@
|
|||||||
"grpc-netty-1.3.0": "mvn:io.grpc:grpc-netty:1.3.0",
|
"grpc-netty-1.3.0": "mvn:io.grpc:grpc-netty:1.3.0",
|
||||||
"grpc-auth-1.3.0": "mvn:io.grpc:grpc-auth:1.3.0",
|
"grpc-auth-1.3.0": "mvn:io.grpc:grpc-auth:1.3.0",
|
||||||
"protobuf-java-3.3.0": "mvn:com.google.protobuf:protobuf-java:3.3.0",
|
"protobuf-java-3.3.0": "mvn:com.google.protobuf:protobuf-java:3.3.0",
|
||||||
"protobuf-java-3.0.2": "mvn:com.google.protobuf:protobuf-java:3.0.2",
|
|
||||||
"protobuf-java-3.2.0": "mvn:com.google.protobuf:protobuf-java:3.2.0",
|
"protobuf-java-3.2.0": "mvn:com.google.protobuf:protobuf-java:3.2.0",
|
||||||
"grpc-testing-1.3.0": "mvn:io.grpc:grpc-testing:1.3.0",
|
"grpc-testing-1.3.0": "mvn:io.grpc:grpc-testing:1.3.0",
|
||||||
"grpc-testing-proto-1.3.0": "mvn:io.grpc:grpc-testing-proto:1.3.0",
|
"grpc-testing-proto-1.3.0": "mvn:io.grpc:grpc-testing-proto:1.3.0",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
PROTOBUF_VER = '3.0.2'
|
PROTOBUF_VER = '3.2.0'
|
||||||
GRPC_VER = '1.3.0'
|
GRPC_VER = '1.3.0'
|
||||||
|
|
||||||
BUNDLES = [
|
BUNDLES = [
|
||||||
@ -13,7 +13,7 @@ BUNDLES = [
|
|||||||
'//lib:grpc-netty-1.3.0',
|
'//lib:grpc-netty-1.3.0',
|
||||||
'//lib:grpc-auth-1.3.0',
|
'//lib:grpc-auth-1.3.0',
|
||||||
'//lib:google-instrumentation-0.3.0',
|
'//lib:google-instrumentation-0.3.0',
|
||||||
'//lib:protobuf-java-3.0.2',
|
'//lib:protobuf-java-3.2.0',
|
||||||
# Lazily adding all netty-related packages.
|
# Lazily adding all netty-related packages.
|
||||||
# Some of them might not be necessary.
|
# Some of them might not be necessary.
|
||||||
'//lib:netty',
|
'//lib:netty',
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
PROTOBUF_VER = '3.0.2'
|
PROTOBUF_VER = '3.2.0'
|
||||||
GRPC_VER = '1.3.0'
|
GRPC_VER = '1.3.0'
|
||||||
|
|
||||||
COMPILE_DEPS = [
|
COMPILE_DEPS = [
|
||||||
|
@ -2,7 +2,7 @@ include_defs(
|
|||||||
'//bucklets/grpc.bucklet'
|
'//bucklets/grpc.bucklet'
|
||||||
)
|
)
|
||||||
|
|
||||||
PROTOBUF_VER = '3.0.2'
|
PROTOBUF_VER = '3.2.0'
|
||||||
GRPC_VER = '1.3.0'
|
GRPC_VER = '1.3.0'
|
||||||
|
|
||||||
COMPILE_DEPS = [
|
COMPILE_DEPS = [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
GRPC_VER = '1.3.0'
|
GRPC_VER = '1.3.0'
|
||||||
PROTOBUF_VER = '3.0.2'
|
PROTOBUF_VER = '3.2.0'
|
||||||
|
|
||||||
COMPILE_DEPS = [
|
COMPILE_DEPS = [
|
||||||
'//lib:CORE_DEPS',
|
'//lib:CORE_DEPS',
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
package org.onosproject.p4runtime.ctl;
|
package org.onosproject.p4runtime.ctl;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import org.onosproject.net.pi.model.PiActionGroupType;
|
|
||||||
import org.onosproject.net.pi.model.PiActionProfileId;
|
import org.onosproject.net.pi.model.PiActionProfileId;
|
||||||
import org.onosproject.net.pi.model.PiPipeconf;
|
import org.onosproject.net.pi.model.PiPipeconf;
|
||||||
import org.onosproject.net.pi.runtime.PiActionGroup;
|
import org.onosproject.net.pi.runtime.PiActionGroup;
|
||||||
@ -65,14 +64,6 @@ public final class ActionProfileGroupEncoder {
|
|||||||
.setGroupId(piActionGroup.id().id())
|
.setGroupId(piActionGroup.id().id())
|
||||||
.setActionProfileId(actionProfileId);
|
.setActionProfileId(actionProfileId);
|
||||||
|
|
||||||
switch (piActionGroup.type()) {
|
|
||||||
case SELECT:
|
|
||||||
actionProfileGroupBuilder.setType(ActionProfileGroup.Type.SELECT);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new EncodeException(format("PI action group type %s not supported", piActionGroup.type()));
|
|
||||||
}
|
|
||||||
|
|
||||||
piActionGroup.members().forEach(m -> {
|
piActionGroup.members().forEach(m -> {
|
||||||
// TODO: currently we don't set "watch" field of member
|
// TODO: currently we don't set "watch" field of member
|
||||||
Member member = Member.newBuilder()
|
Member member = Member.newBuilder()
|
||||||
@ -115,17 +106,6 @@ public final class ActionProfileGroupEncoder {
|
|||||||
.withActionProfileId(piActionProfileId)
|
.withActionProfileId(piActionProfileId)
|
||||||
.withId(PiActionGroupId.of(actionProfileGroup.getGroupId()));
|
.withId(PiActionGroupId.of(actionProfileGroup.getGroupId()));
|
||||||
|
|
||||||
switch (actionProfileGroup.getType()) {
|
|
||||||
case UNSPECIFIED:
|
|
||||||
// FIXME: PI returns unspecified for select groups. Remove this case when PI bug will be fixed.
|
|
||||||
case SELECT:
|
|
||||||
piActionGroupBuilder.withType(PiActionGroupType.SELECT);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new EncodeException(format("Action profile type %s is not supported",
|
|
||||||
actionProfileGroup.getType()));
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<Integer, Integer> memberWeights = Maps.newHashMap();
|
Map<Integer, Integer> memberWeights = Maps.newHashMap();
|
||||||
actionProfileGroup.getMembersList().forEach(member -> {
|
actionProfileGroup.getMembersList().forEach(member -> {
|
||||||
int weight = member.getWeight();
|
int weight = member.getWeight();
|
||||||
|
@ -328,16 +328,16 @@ public final class P4RuntimeClientImpl implements P4RuntimeClient {
|
|||||||
|
|
||||||
ForwardingPipelineConfig pipelineConfig = ForwardingPipelineConfig
|
ForwardingPipelineConfig pipelineConfig = ForwardingPipelineConfig
|
||||||
.newBuilder()
|
.newBuilder()
|
||||||
.setDeviceId(p4DeviceId)
|
|
||||||
.setP4Info(p4Info)
|
.setP4Info(p4Info)
|
||||||
.setP4DeviceConfig(p4DeviceConfigMsg.toByteString())
|
.setP4DeviceConfig(p4DeviceConfigMsg.toByteString())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
SetForwardingPipelineConfigRequest request = SetForwardingPipelineConfigRequest
|
SetForwardingPipelineConfigRequest request = SetForwardingPipelineConfigRequest
|
||||||
.newBuilder()
|
.newBuilder()
|
||||||
|
.setDeviceId(p4DeviceId)
|
||||||
.setElectionId(p4RuntimeElectionId)
|
.setElectionId(p4RuntimeElectionId)
|
||||||
.setAction(VERIFY_AND_COMMIT)
|
.setAction(VERIFY_AND_COMMIT)
|
||||||
.addConfigs(pipelineConfig)
|
.setConfig(pipelineConfig)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -64,7 +64,6 @@ import static org.easymock.EasyMock.niceMock;
|
|||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.onosproject.net.pi.model.PiActionGroupType.SELECT;
|
|
||||||
import static org.onosproject.net.pi.model.PiPipeconf.ExtensionType.P4_INFO_TEXT;
|
import static org.onosproject.net.pi.model.PiPipeconf.ExtensionType.P4_INFO_TEXT;
|
||||||
import static org.onosproject.p4runtime.api.P4RuntimeClient.WriteOperationType.INSERT;
|
import static org.onosproject.p4runtime.api.P4RuntimeClient.WriteOperationType.INSERT;
|
||||||
import static p4.P4RuntimeOuterClass.Action;
|
import static p4.P4RuntimeOuterClass.Action;
|
||||||
@ -95,7 +94,6 @@ public class P4RuntimeGroupTest {
|
|||||||
.withId(GROUP_ID)
|
.withId(GROUP_ID)
|
||||||
.addMembers(GROUP_MEMBERS)
|
.addMembers(GROUP_MEMBERS)
|
||||||
.withActionProfileId(ACT_PROF_ID)
|
.withActionProfileId(ACT_PROF_ID)
|
||||||
.withType(SELECT)
|
|
||||||
.build();
|
.build();
|
||||||
private static final DeviceId DEVICE_ID = DeviceId.deviceId("device:p4runtime:1");
|
private static final DeviceId DEVICE_ID = DeviceId.deviceId("device:p4runtime:1");
|
||||||
private static final int P4_DEVICE_ID = 1;
|
private static final int P4_DEVICE_ID = 1;
|
||||||
@ -223,7 +221,6 @@ public class P4RuntimeGroupTest {
|
|||||||
public void testReadGroups() throws Exception {
|
public void testReadGroups() throws Exception {
|
||||||
ActionProfileGroup.Builder group = ActionProfileGroup.newBuilder()
|
ActionProfileGroup.Builder group = ActionProfileGroup.newBuilder()
|
||||||
.setGroupId(GROUP_ID.id())
|
.setGroupId(GROUP_ID.id())
|
||||||
.setType(ActionProfileGroup.Type.SELECT)
|
|
||||||
.setActionProfileId(P4_INFO_ACT_PROF_ID);
|
.setActionProfileId(P4_INFO_ACT_PROF_ID);
|
||||||
|
|
||||||
List<ActionProfileMember> members = Lists.newArrayList();
|
List<ActionProfileMember> members = Lists.newArrayList();
|
||||||
@ -277,7 +274,6 @@ public class P4RuntimeGroupTest {
|
|||||||
PiActionGroup piActionGroup = groups.iterator().next();
|
PiActionGroup piActionGroup = groups.iterator().next();
|
||||||
assertEquals(ACT_PROF_ID, piActionGroup.actionProfileId());
|
assertEquals(ACT_PROF_ID, piActionGroup.actionProfileId());
|
||||||
assertEquals(GROUP_ID, piActionGroup.id());
|
assertEquals(GROUP_ID, piActionGroup.id());
|
||||||
assertEquals(SELECT, piActionGroup.type());
|
|
||||||
assertEquals(3, piActionGroup.members().size());
|
assertEquals(3, piActionGroup.members().size());
|
||||||
assertTrue(GROUP_MEMBERS.containsAll(piActionGroup.members()));
|
assertTrue(GROUP_MEMBERS.containsAll(piActionGroup.members()));
|
||||||
assertTrue(piActionGroup.members().containsAll(GROUP_MEMBERS));
|
assertTrue(piActionGroup.members().containsAll(GROUP_MEMBERS));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
PROTOBUF_VER = '3.0.2'
|
PROTOBUF_VER = '3.2.0'
|
||||||
|
|
||||||
COMPILE_DEPS = [
|
COMPILE_DEPS = [
|
||||||
'//lib:CORE_DEPS',
|
'//lib:CORE_DEPS',
|
||||||
|
@ -2,10 +2,10 @@ include_defs(
|
|||||||
'//bucklets/grpc.bucklet'
|
'//bucklets/grpc.bucklet'
|
||||||
)
|
)
|
||||||
|
|
||||||
PROTOBUF_VER = '3.0.2'
|
PROTOBUF_VER = '3.2.0'
|
||||||
GRPC_VER = '1.3.0'
|
GRPC_VER = '1.3.0'
|
||||||
|
|
||||||
PI_COMMIT = 'a8814a8ac40838a9df83fe47a17a025b69026fcf'
|
PI_COMMIT = '13d611a9c655938676ebcde2bd5653b461f46ca7'
|
||||||
PI_BASEURL = 'https://github.com/p4lang/PI.git'
|
PI_BASEURL = 'https://github.com/p4lang/PI.git'
|
||||||
|
|
||||||
# Wondering which .proto files to build? Check p4runtime's Makefile:
|
# Wondering which .proto files to build? Check p4runtime's Makefile:
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
<description>ONOS P4Runtime Proto</description>
|
<description>ONOS P4Runtime Proto</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<protobuf.version>3.0.2</protobuf.version>
|
<protobuf.version>3.2.0</protobuf.version>
|
||||||
<piCommit>a8814a8ac40838a9df83fe47a17a025b69026fcf</piCommit>
|
<piCommit>a8814a8ac40838a9df83fe47a17a025b69026fcf</piCommit>
|
||||||
<piBaseUrl>https://github.com/p4lang/PI.git</piBaseUrl>
|
<piBaseUrl>https://github.com/p4lang/PI.git</piBaseUrl>
|
||||||
</properties>
|
</properties>
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
BUILD_DIR=~/p4tools
|
BUILD_DIR=~/p4tools
|
||||||
BMV2_COMMIT="44ac9c21636b00fed660ae8590889d85b5d4df4c"
|
BMV2_COMMIT="d930fa2818d8ed71f3bf36eaf3f3687d9b68184f"
|
||||||
PI_COMMIT="a8814a8ac40838a9df83fe47a17a025b69026fcf"
|
PI_COMMIT="13d611a9c655938676ebcde2bd5653b461f46ca7"
|
||||||
P4C_COMMIT="040b931fbfcb7912e3a14cd05df950fbdd49b038"
|
P4C_COMMIT="040b931fbfcb7912e3a14cd05df950fbdd49b038"
|
||||||
PROTOBUF_COMMIT="tags/v3.0.2"
|
PROTOBUF_COMMIT="tags/v3.2.0"
|
||||||
GRPC_COMMIT="tags/v1.3.0"
|
GRPC_COMMIT="tags/v1.3.0"
|
||||||
|
|
||||||
NUM_CORES=`grep -c ^processor /proc/cpuinfo`
|
NUM_CORES=`grep -c ^processor /proc/cpuinfo`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user