summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2018-09-28 10:54:43 +0200
committerMichal Cmarada <mcmarada@cisco.com>2018-09-28 09:12:43 +0000
commit9b0967210e3e50d0b52475cfc02e636dbfa28421 (patch)
tree48d72d6c706ccbd6a869e511d5af6912419d5dbe /v3po/v3po2vpp/src/main/java
parente57a01e46900614558c869dd21f810fab9877982 (diff)
Fix v3po interface type
VPP introduced new flag for interfaces: portType (see https://gerrit.fd.io/r/#/c/14689/) This caused API changes and introduced new port types: - Normal - BVI - Unknown unicast (not supported by HC2VPP yet - HC2VPP-389) This patch fixes the current implementation for normal and BVI interface. Change-Id: I271aaab9887e3759fa90d9056bafe550c867761d Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterconnectionWriteUtils.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterconnectionWriteUtils.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterconnectionWriteUtils.java
index a0e2d1808..28e4e1013 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterconnectionWriteUtils.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterconnectionWriteUtils.java
@@ -28,11 +28,13 @@ import io.fd.vpp.jvpp.core.dto.SwInterfaceSetL2BridgeReply;
import io.fd.vpp.jvpp.core.dto.SwInterfaceSetL2Xconnect;
import io.fd.vpp.jvpp.core.dto.SwInterfaceSetL2XconnectReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
+import io.fd.vpp.jvpp.core.types.L2PortType;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.l2.config.attributes.Interconnection;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.l2.config.attributes.interconnection.BridgeBased;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.l2.config.attributes.interconnection.XconnectBased;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev180319.sub._interface.l2.state.attributes.L2;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
@@ -103,28 +105,27 @@ final class InterconnectionWriteUtils implements JvppReplyConsumer {
checkArgument(bdId > 0, "Unable to set Interconnection for Interface: %s, bridge domain: %s does not exist",
ifcName, bdName);
- byte bvi = bb.isBridgedVirtualInterface()
- ? (byte) 1
- : (byte) 0;
byte shg = 0;
if (bb.getSplitHorizonGroup() != null) {
shg = bb.getSplitHorizonGroup().byteValue();
}
final CompletionStage<SwInterfaceSetL2BridgeReply> swInterfaceSetL2BridgeReplyCompletionStage = futureJVppCore
- .swInterfaceSetL2Bridge(getL2BridgeRequest(swIfIndex, bdId, shg, bvi, enabled));
+ .swInterfaceSetL2Bridge(getL2BridgeRequest(swIfIndex, bdId, shg, bb.isBridgedVirtualInterface(), enabled));
getReplyForWrite(swInterfaceSetL2BridgeReplyCompletionStage.toCompletableFuture(), id);
LOG.debug("Bridge based interconnection updated successfully for: {}, interconnection: {}", ifcName, bb);
}
private SwInterfaceSetL2Bridge getL2BridgeRequest(final int swIfIndex, final int bdId, final byte shg,
- final byte bvi, final byte enabled) {
+ final Boolean bvi, final byte enabled) {
final SwInterfaceSetL2Bridge swInterfaceSetL2Bridge = new SwInterfaceSetL2Bridge();
swInterfaceSetL2Bridge.rxSwIfIndex = swIfIndex;
swInterfaceSetL2Bridge.bdId = bdId;
swInterfaceSetL2Bridge.shg = shg;
- swInterfaceSetL2Bridge.bvi = bvi;
+
+ // TODO HC2VPP-389: add support for unknown unicast type
+ swInterfaceSetL2Bridge.portType = bvi ? L2PortType.L2_API_PORT_TYPE_BVI : L2PortType.L2_API_PORT_TYPE_NORMAL;
swInterfaceSetL2Bridge.enable = enabled;
return swInterfaceSetL2Bridge;
}