This is a follow up from gerrit https://git.opendaylight.org/gerrit/#/c/19410/.
When assembling different flow rules for different match, it is important
to make their flowIds unique. By not doing that, openflowPlugin will treat
them as one; and that is what gets pushed to OF capable node.
Also removed cases when writeFlow() was being invoked twice for no reason.
Change-Id: I898d777e779e61da3c9f070306915c4c37f65572
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
flowBuilder.setMatch(matchBuilder.build());
flowBuilder.setInstructions(isb.setInstruction(instructions).build());
- String flowId = "ArpResponder_" + ipAddress.getHostAddress();
+ String flowId = "ArpResponder_" + segmentationId + "_" + ipAddress.getHostAddress();
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setBarrier(true);
attachedMac, Constants.TCP_SYN, segmentationId).build());
logger.debug("MatchBuilder contains: {}", flowBuilder.getMatch());
- String flowId = "TCP_Syn_Egress_Default_Drop_" + attachedMac;
+ String flowId = "TCP_Syn_Egress_Default_Drop_" + segmentationId + "_" + attachedMac;
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setStrict(false);
flowBuilder.setMatch(matchBuilder.build());
flowBuilder.setInstructions(isb.setInstruction(instructions).build());
- String flowId = "InboundNAT_" + rewriteAddress.getHostAddress();
+ String flowId = "InboundNAT_" + segmentationId + "_" + rewriteAddress.getHostAddress();
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setBarrier(true);
flowBuilder.setMatch(matchBuilder.build());
flowBuilder.setInstructions(isb.setInstruction(instructions).build());
- String flowId = "InboundNATExclusion_" + excludedCidr;
+ String flowId = "InboundNATExclusion_" + segmentationId + "_" + excludedCidr;
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setBarrier(true);
Constants.TCP_SYN, segmentationId).build());
logger.debug("ingressACLTcpSyn MatchBuilder contains: {}", flowBuilder.getMatch());
- String flowId = "UcastOut_ACL2" + segmentationId + "_" + attachedMac + securityRulePortMin;
+ String flowId = "UcastOut_ACL2_" + segmentationId + "_" + attachedMac + securityRulePortMin;
// Add Flow Attributes
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
attachedMac, Constants.TCP_SYN, segmentationId).build());
logger.debug("MatchBuilder contains: {}", flowBuilder.getMatch());
- String flowId = "PortSec_TCP_Syn_Default_Drop_" + attachedMac;
+ String flowId = "PortSec_TCP_Syn_Default_Drop_" + segmentationId + "_" + attachedMac;
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setStrict(false);
flowBuilder.setMatch(matchBuilder.build());
flowBuilder.setInstructions(isb.setInstruction(instructions).build());
- String flowId = "L3Forwarding_" + ipAddress.getHostAddress();
+ String flowId = "L3Forwarding_" + segmentationId + "_" + ipAddress.getHostAddress();
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setBarrier(true);
MatchUtils.createDstL3IPv4Match(matchBuilder, MatchUtils.iPv4PrefixFromIPv4Address(lbConfig.getVip()));
MatchUtils.addNxRegMatch(matchBuilder, new MatchUtils.RegMatch(REG_FIELD_A, FIRST_PASS_REGA_MATCH_VALUE));
- String flowId = "LOADBALANCER_FORWARD_FLOW1_" + lbConfig.getVip();
+ String flowId = "LOADBALANCER_FORWARD_FLOW1_" + lbConfig.getProviderSegmentationId() + "_" + lbConfig.getVip();
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setMatch(matchBuilder.build());
MatchUtils.addNxRegMatch(matchBuilder, new MatchUtils.RegMatch(REG_FIELD_A, SECOND_PASS_REGA_MATCH_VALUE),
new MatchUtils.RegMatch(REG_FIELD_B, (long)member.getIndex()));
- String flowId = "LOADBALANCER_FORWARD_FLOW2_" + vip + "_" + member.getIP();
+ String flowId = "LOADBALANCER_FORWARD_FLOW2_" + lbConfig.getProviderSegmentationId() + "_" +
+ vip + "_" + member.getIP();
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setMatch(matchBuilder.build());
MatchUtils.createSrcL3IPv4Match(matchBuilder, MatchUtils.iPv4PrefixFromIPv4Address(member.getIP()));
MatchUtils.createSetSrcTcpMatch(matchBuilder, new PortNumber(member.getPort()));
- String flowId = "LOADBALANCER_REVERSE_FLOW_" + vip + "_" + member.getIP();
+ String flowId = "LOADBALANCER_REVERSE_FLOW_" + lbConfig.getProviderSegmentationId() +
+ vip + "_" + member.getIP();
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setMatch(matchBuilder.build());
flowBuilder.setMatch(matchBuilder.build());
flowBuilder.setInstructions(isb.setInstruction(instructions).build());
- String flowId = "OutboundNAT_" + rewriteAddress.getHostAddress();
+ String flowId = "OutboundNAT_" + segmentationId + "_" + rewriteAddress.getHostAddress();
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setBarrier(true);
flowBuilder.setMatch(matchBuilder.build());
flowBuilder.setInstructions(isb.setInstruction(instructions).build());
- String flowId = "OutboundNATExclusion_" + excludedCidr;
+ String flowId = "OutboundNATExclusion_" + segmentationId + "_" + excludedCidr;
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setBarrier(true);
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
flowBuilder.setBarrier(true);
flowBuilder.setTableId(this.getTable());
flowBuilder.setKey(key);
- flowBuilder.setCookie(new FlowCookie(new BigInteger(sourceSegId)));
flowBuilder.setPriority(2048);
flowBuilder.setFlowName(flowId);
flowBuilder.setHardTimeout(0);