import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg2;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg3;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg4;
// group on the node
private Flow createBroadcastFlow(EndpointFwdCtxOrdinals epOrd) {
- FlowId flowId = new FlowId(new StringBuilder().append("broadcast|").append(epOrd.getFdId()).toString());
- MatchBuilder mb = new MatchBuilder().setEthernetMatch(new EthernetMatchBuilder().setEthernetDestination(
- new EthernetDestinationBuilder().setAddress(MULTICAST_MAC).setMask(MULTICAST_MAC).build()).build());
+ FlowId flowId = new FlowId(new StringBuilder().
+ append("broadcast|").
+ append(epOrd.getFdId()).
+ toString());
+ MatchBuilder mb = new MatchBuilder()
+ .setEthernetMatch(new EthernetMatchBuilder()
+ .setEthernetDestination(new EthernetDestinationBuilder().
+ setAddress(MULTICAST_MAC)
+ .setMask(MULTICAST_MAC).build())
+ .build());
addNxRegMatch(mb, RegMatch.of(NxmNxReg5.class, Long.valueOf(epOrd.getFdId())));
FlowBuilder flowb = base().setPriority(Integer.valueOf(140))
}
setNextHop = nxLoadRegAction(NxmNxReg7.class, BigInteger.valueOf(portNum));
- Action tunIdAction = nxLoadTunIdAction(BigInteger.valueOf(srcEpFwdCtxOrds.getTunnelId()), false);
-
- applyActions.add(tunIdAction);
applyActions.add(tundstAction);
// END TUNNEL
.append("|l2|")
.append(ep.getMacAddress().getValue())
.append("|")
- .append(srcEpFwdCtxOrds.getTunnelId())
+ .append(srcEpFwdCtxOrds.getBdId())
.append("|")
.append(nextHop)
.toString());
}
setNextHop = nxLoadRegAction(NxmNxReg7.class, BigInteger.valueOf(portNum));
- Action tunIdAction = nxLoadTunIdAction(BigInteger.valueOf(srcEpFwdCtxOrds.getTunnelId()), false);
-
- applyActions.add(tunIdAction);
applyActions.add(tundstAction);
// END TUNNEL
.append("|l3|")
.append(ikey)
.append("|")
- .append(destEpFwdCtxOrds.getEpgId())
- .append("|")
- .append(destEpFwdCtxOrds.getCgId())
- .append("|")
.append(matcherMac)
.append("|")
.append(destSubnetGatewayMac)
.append("|")
- .append(srcEpFwdCtxOrds.getEpgId())
- .append("|")
- .append(srcEpFwdCtxOrds.getFdId())
+ .append(srcEpFwdCtxOrds.getL3Id())
.append("|")
.append(nextHop)
.toString());
MatchBuilder mb = new MatchBuilder().setEthernetMatch(ethernetMatch(null, matcherMac, etherType))
.setLayer3Match(m);
- addNxRegMatch(mb, RegMatch.of(NxmNxReg0.class, Long.valueOf(srcEpFwdCtxOrds.getEpgId())),
- RegMatch.of(NxmNxReg5.class, Long.valueOf(srcEpFwdCtxOrds.getFdId())),
- RegMatch.of(NxmNxReg6.class, Long.valueOf(destEpFwdCtxOrds.getL3Id())));
+ addNxRegMatch(mb, RegMatch.of(NxmNxReg6.class, Long.valueOf(destEpFwdCtxOrds.getL3Id())));
FlowBuilder flowb = base().setId(flowid)
.setPriority(Integer.valueOf(132))
import static org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.FlowUtils.gotoTableIns;
import static org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.FlowUtils.instructions;
import static org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.FlowUtils.nxLoadRegAction;
+import static org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.FlowUtils.nxLoadTunIdAction;
import java.math.BigInteger;
import java.util.Collections;
for (EgKey peer : peers) {
for (NodeId remoteNodeId : ctx.getEndpointManager().getNodesForGroup(peer)) {
- // Only put tunnels on destination nodes
- if (remoteNodeId.getValue().equals(nodeId.getValue())) {
- continue;
- }
+ // Please do not check for remote v local nodeID, we need local to local tunnels
+ // in the case of chaining - The Great Dr Sunal.
NodeConnectorId tunPort = ctx.getSwitchManager().getTunnelPort(remoteNodeId);
if (tunPort == null) {
LOG.trace("No tunnel port for tunnel in SourceMapper between local:{} and remote:{}",
int fdId = epFwdCtxOrds.getFdId();
int l3Id = epFwdCtxOrds.getL3Id();
int cgId = epFwdCtxOrds.getCgId();
+ int tunnelId = epFwdCtxOrds.getTunnelId();
FlowId flowid = new FlowId(new StringBuilder().append(ofc.getNodeConnectorId().getValue())
.append("|")
Action bdReg = nxLoadRegAction(NxmNxReg4.class, BigInteger.valueOf(bdId));
Action fdReg = nxLoadRegAction(NxmNxReg5.class, BigInteger.valueOf(fdId));
Action vrfReg = nxLoadRegAction(NxmNxReg6.class, BigInteger.valueOf(l3Id));
+ Action tunIdAction = nxLoadTunIdAction(BigInteger.valueOf(tunnelId), false);
+
FlowBuilder flowb = base().setPriority(Integer.valueOf(100))
.setId(flowid)
.setMatch(
.setInPort(ofc.getNodeConnectorId())
.build())
.setInstructions(
- instructions(applyActionIns(segReg, scgReg, bdReg, fdReg, vrfReg),
+ instructions(applyActionIns(segReg, scgReg, bdReg, fdReg, vrfReg,tunIdAction),
gotoTableIns((short) (TABLE_ID + 1))));
flowMap.writeFlow(nodeId, TABLE_ID, flowb.build());
}