+ mdsalManager.addFlow(tx, arpRepArpCheckTbl);
+ }
+
+ private void createArpPuntAndLearnFlow(Uint64 dpId, TypedReadWriteTransaction<Configuration> tx) {
+ LOG.debug("adding arp punt and learn entry in table {}", NwConstants.ARP_LEARN_TABLE_1);
+
+ List<MatchInfo> matches = new ArrayList<>();
+ List<ActionInfo> actions = new ArrayList<>();
+ Uint64 cookie = Uint64.valueOf("88880000", 16).intern();
+
+ matches.add(MatchEthernetType.ARP);
+ actions.add(new ActionPuntToController());
+ if (arpPuntTimeout != 0) {
+ actions.add(new ActionLearn(0, arpPuntTimeout, ARP_LEARN_FLOW_PRIORITY, cookie, 0,
+ NwConstants.ARP_LEARN_TABLE_1, 0, 0,
+ Arrays.asList(
+ new MatchFromValue(NwConstants.ETHTYPE_ARP, NxmOfFieldType.NXM_OF_ETH_TYPE.getType(),
+ NxmOfFieldType.NXM_OF_ETH_TYPE.getFlowModHeaderLenInt()),
+ new MatchFromField(NxmOfFieldType.NXM_OF_ARP_OP.getType(),
+ NxmOfFieldType.NXM_OF_ARP_OP.getType(),
+ NxmOfFieldType.NXM_OF_ARP_OP.getFlowModHeaderLenInt()),
+ new MatchFromField(NxmOfFieldType.NXM_OF_ARP_TPA.getType(),
+ NxmOfFieldType.NXM_OF_ARP_TPA.getType(),
+ NxmOfFieldType.NXM_OF_ARP_TPA.getFlowModHeaderLenInt()),
+ new ActionLearn.MatchFromField(NxmOfFieldType.OXM_OF_METADATA.getType(),
+ MetaDataUtil.METADATA_ELAN_TAG_OFFSET,
+ NxmOfFieldType.OXM_OF_METADATA.getType(), MetaDataUtil.METADATA_ELAN_TAG_OFFSET,
+ ElanConstants.ELAN_TAG_LENGTH),
+ new CopyFromValue(1, NxmOfFieldType.NXM_NX_REG4.getType(), 8))));
+
+ actions.add(new ActionLearn(0, arpPuntTimeout, ARP_LEARN_FLOW_PRIORITY, cookie, 0,
+ NwConstants.ARP_LEARN_TABLE_2, 0, 0,
+ Arrays.asList(
+ new MatchFromValue(NwConstants.ETHTYPE_ARP, NxmOfFieldType.NXM_OF_ETH_TYPE.getType(),
+ NxmOfFieldType.NXM_OF_ETH_TYPE.getFlowModHeaderLenInt()),
+ new MatchFromField(NxmOfFieldType.NXM_OF_ARP_OP.getType(),
+ NxmOfFieldType.NXM_OF_ARP_OP.getType(),
+ NxmOfFieldType.NXM_OF_ARP_OP.getFlowModHeaderLenInt()),
+ new MatchFromField(NxmOfFieldType.NXM_OF_ARP_TPA.getType(),
+ NxmOfFieldType.NXM_OF_ARP_SPA.getType(),
+ NxmOfFieldType.NXM_OF_ARP_TPA.getFlowModHeaderLenInt()),
+ new ActionLearn.MatchFromField(NxmOfFieldType.OXM_OF_METADATA.getType(),
+ MetaDataUtil.METADATA_ELAN_TAG_OFFSET, NxmOfFieldType.OXM_OF_METADATA.getType(),
+ MetaDataUtil.METADATA_ELAN_TAG_OFFSET, MetaDataUtil.METADATA_ELAN_TAG_BITLEN),
+ new CopyFromValue(1, NxmOfFieldType.NXM_NX_REG4.getType(), 8, 8))));
+ }
+
+ List<InstructionInfo> instructions = new ArrayList<>();
+ instructions.add(new InstructionApplyActions(actions));
+ String flowid = String.valueOf(NwConstants.ARP_LEARN_TABLE_1) + NwConstants.FLOWID_SEPARATOR + "arp.punt";
+ FlowEntity flow = MDSALUtil.buildFlowEntity(dpId, NwConstants.ARP_LEARN_TABLE_1, flowid,
+ NwConstants.TABLE_MISS_PRIORITY, "arp punt/learn flow", 0,
+ 0, cookie, matches, instructions);
+ mdsalManager.addFlow(tx, flow);
+ }
+
+ private void addGarpLearnMatchFlow(Uint64 dpId, TypedReadWriteTransaction<Configuration> tx) {
+ List<ActionInfo> actions = new ArrayList<>();
+ List<MatchInfoBase> matches = new ArrayList<>();
+
+ matches.add(MatchEthernetType.ARP);
+ matches.add(new NxMatchRegister(NxmNxReg4.class, GARP_LEARN_MATCH_VALUE, ARP_LEARN_MATCH_MASK));
+
+ actions.add(new ActionRegLoad(NxmNxReg4.class, 0, 31, 0));
+ actions.add(new ActionPuntToController());
+ actions.add(new ActionNxResubmit(NwConstants.ELAN_SMAC_LEARNED_TABLE));
+ actions.add(new ActionNxResubmit(NwConstants.ELAN_SMAC_TABLE));
+
+ List<InstructionInfo> instructions = new ArrayList<>();
+ instructions.add(new InstructionApplyActions(actions));
+ String flowid = String.valueOf(NwConstants.ELAN_BASE_TABLE) + NwConstants.FLOWID_SEPARATOR + "garp.match";
+ FlowEntity garpFlow = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_BASE_TABLE, flowid,
+ NwConstants.DEFAULT_ARP_FLOW_PRIORITY, "GARP learn match flow", 0, 0,
+ ElanConstants.COOKIE_ELAN_BASE_SMAC, matches, instructions);
+ mdsalManager.addFlow(tx, garpFlow);
+ }
+
+ private void addArpLearnMatchFlow(Uint64 dpId, TypedReadWriteTransaction<Configuration> tx) {
+ List<ActionInfo> actions = new ArrayList<>();
+ List<MatchInfoBase> matches = new ArrayList<>();
+
+ matches.add(MatchEthernetType.ARP);
+ matches.add(new NxMatchRegister(NxmNxReg4.class, ARP_LEARN_MATCH_VALUE, ARP_LEARN_MATCH_MASK));
+
+ actions.add(new ActionRegLoad(NxmNxReg4.class, 0, 31, 0));
+ actions.add(new ActionNxResubmit(NwConstants.ELAN_SMAC_LEARNED_TABLE));
+ actions.add(new ActionNxResubmit(NwConstants.ELAN_SMAC_TABLE));