Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Carmelo Cascone | 356ab8b | 2019-09-25 01:02:53 -0700 | [diff] [blame] | 17 | package org.onosproject.pipelines.fabric.impl.behaviour; |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 18 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 19 | import com.google.common.collect.ImmutableMap; |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 20 | import org.onosproject.net.PortNumber; |
Yi Tseng | df3eec5 | 2018-02-15 14:56:02 -0800 | [diff] [blame] | 21 | import org.onosproject.net.flow.DefaultTrafficTreatment; |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 22 | import org.onosproject.net.flow.TrafficTreatment; |
| 23 | import org.onosproject.net.flow.instructions.Instruction; |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 24 | import org.onosproject.net.flow.instructions.Instructions.OutputInstruction; |
| 25 | import org.onosproject.net.flow.instructions.L2ModificationInstruction; |
| 26 | import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModEtherInstruction; |
Yi Tseng | 1b154bd | 2017-11-20 17:48:19 -0800 | [diff] [blame] | 27 | import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModMplsLabelInstruction; |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 28 | import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanIdInstruction; |
| 29 | import org.onosproject.net.pi.model.PiActionId; |
| 30 | import org.onosproject.net.pi.model.PiPipelineInterpreter.PiInterpreterException; |
Yi Tseng | 47eac89 | 2018-07-11 02:17:04 +0800 | [diff] [blame] | 31 | import org.onosproject.net.pi.model.PiTableId; |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 32 | import org.onosproject.net.pi.runtime.PiAction; |
| 33 | import org.onosproject.net.pi.runtime.PiActionParam; |
Carmelo Cascone | b1f5cfd | 2020-12-04 16:54:24 -0800 | [diff] [blame] | 34 | import org.onosproject.pipelines.fabric.FabricConstants; |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 35 | |
Daniele Moro | f51d0c1 | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 36 | import java.util.List; |
| 37 | import java.util.stream.Collectors; |
| 38 | |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 39 | import static java.lang.String.format; |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 40 | import static org.onosproject.net.flow.instructions.Instruction.Type.OUTPUT; |
pierventre | cfd08de | 2020-12-15 17:34:54 +0100 | [diff] [blame] | 41 | import static org.onosproject.net.flow.instructions.L2ModificationInstruction.L2SubType.*; |
Carmelo Cascone | 356ab8b | 2019-09-25 01:02:53 -0700 | [diff] [blame] | 42 | import static org.onosproject.pipelines.fabric.impl.behaviour.FabricUtils.instruction; |
| 43 | import static org.onosproject.pipelines.fabric.impl.behaviour.FabricUtils.l2Instruction; |
| 44 | import static org.onosproject.pipelines.fabric.impl.behaviour.FabricUtils.l2Instructions; |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 45 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 46 | /** |
| 47 | * Treatment translation logic. |
| 48 | */ |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 49 | final class FabricTreatmentInterpreter { |
Yi Tseng | 20f9e7b | 2018-05-24 23:27:39 +0800 | [diff] [blame] | 50 | |
Daniele Moro | f51d0c1 | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 51 | private final FabricCapabilities capabilities; |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 52 | private static final ImmutableMap<PiTableId, PiActionId> NOP_ACTIONS = |
| 53 | ImmutableMap.<PiTableId, PiActionId>builder() |
| 54 | .put(FabricConstants.FABRIC_INGRESS_FILTERING_INGRESS_PORT_VLAN, |
| 55 | FabricConstants.FABRIC_INGRESS_FILTERING_PERMIT) |
| 56 | .put(FabricConstants.FABRIC_INGRESS_FORWARDING_ROUTING_V4, |
| 57 | FabricConstants.FABRIC_INGRESS_FORWARDING_NOP_ROUTING_V4) |
| 58 | .put(FabricConstants.FABRIC_INGRESS_ACL_ACL, |
| 59 | FabricConstants.FABRIC_INGRESS_ACL_NOP_ACL) |
| 60 | .put(FabricConstants.FABRIC_EGRESS_EGRESS_NEXT_EGRESS_VLAN, |
| 61 | FabricConstants.FABRIC_EGRESS_EGRESS_NEXT_POP_VLAN) |
| 62 | .build(); |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 63 | |
Daniele Moro | f51d0c1 | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 64 | |
| 65 | FabricTreatmentInterpreter(FabricCapabilities capabilities) { |
| 66 | this.capabilities = capabilities; |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 67 | } |
| 68 | |
Yi Tseng | 47eac89 | 2018-07-11 02:17:04 +0800 | [diff] [blame] | 69 | static PiAction mapFilteringTreatment(TrafficTreatment treatment, PiTableId tableId) |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 70 | throws PiInterpreterException { |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 71 | |
| 72 | if (!tableId.equals(FabricConstants.FABRIC_INGRESS_FILTERING_INGRESS_PORT_VLAN)) { |
| 73 | // Mapping for other tables of the filtering block must be handled |
| 74 | // in the pipeliner. |
| 75 | tableException(tableId); |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 76 | } |
| 77 | |
Daniele Moro | f51d0c1 | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 78 | // VLAN_POP action is equivalent to the permit action (VLANs pop is done anyway) |
| 79 | if (isNoAction(treatment) || isFilteringPopAction(treatment)) { |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 80 | // Permit action if table is ingress_port_vlan; |
| 81 | return nop(tableId); |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 82 | } |
| 83 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 84 | final ModVlanIdInstruction setVlanInst = (ModVlanIdInstruction) l2InstructionOrFail( |
| 85 | treatment, VLAN_ID, tableId); |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 86 | return PiAction.builder() |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 87 | .withId(FabricConstants.FABRIC_INGRESS_FILTERING_PERMIT_WITH_INTERNAL_VLAN) |
| 88 | .withParameter(new PiActionParam( |
| 89 | FabricConstants.VLAN_ID, setVlanInst.vlanId().toShort())) |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 90 | .build(); |
| 91 | } |
| 92 | |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 93 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 94 | static PiAction mapForwardingTreatment(TrafficTreatment treatment, PiTableId tableId) |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 95 | throws PiInterpreterException { |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 96 | if (isNoAction(treatment)) { |
| 97 | return nop(tableId); |
Yi Tseng | df3eec5 | 2018-02-15 14:56:02 -0800 | [diff] [blame] | 98 | } |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 99 | treatmentException( |
| 100 | tableId, treatment, |
| 101 | "supports mapping only for empty/no-action treatments"); |
| 102 | return null; |
| 103 | } |
| 104 | |
Daniele Moro | f51d0c1 | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 105 | PiAction mapNextTreatment(TrafficTreatment treatment, PiTableId tableId) |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 106 | throws PiInterpreterException { |
| 107 | if (tableId == FabricConstants.FABRIC_INGRESS_NEXT_NEXT_VLAN) { |
| 108 | return mapNextVlanTreatment(treatment, tableId); |
| 109 | } else if (tableId == FabricConstants.FABRIC_INGRESS_NEXT_HASHED) { |
| 110 | return mapNextHashedOrSimpleTreatment(treatment, tableId, false); |
| 111 | } else if (tableId == FabricConstants.FABRIC_INGRESS_NEXT_SIMPLE) { |
| 112 | return mapNextHashedOrSimpleTreatment(treatment, tableId, true); |
Carmelo Cascone | 45cc086 | 2018-11-26 11:50:41 -0800 | [diff] [blame] | 113 | } else if (tableId == FabricConstants.FABRIC_INGRESS_NEXT_XCONNECT) { |
| 114 | return mapNextXconnect(treatment, tableId); |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 115 | } |
| 116 | throw new PiInterpreterException(format( |
| 117 | "Treatment mapping not supported for table '%s'", tableId)); |
| 118 | } |
| 119 | |
Daniele Moro | f51d0c1 | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 120 | private PiAction mapNextVlanTreatment(TrafficTreatment treatment, PiTableId tableId) |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 121 | throws PiInterpreterException { |
Daniele Moro | f51d0c1 | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 122 | final List<ModVlanIdInstruction> modVlanIdInst = l2InstructionsOrFail(treatment, VLAN_ID, tableId) |
| 123 | .stream().map(i -> (ModVlanIdInstruction) i).collect(Collectors.toList()); |
| 124 | if (modVlanIdInst.size() == 1) { |
| 125 | return PiAction.builder().withId(FabricConstants.FABRIC_INGRESS_NEXT_SET_VLAN) |
| 126 | .withParameter(new PiActionParam( |
| 127 | FabricConstants.VLAN_ID, |
| 128 | modVlanIdInst.get(0).vlanId().toShort())) |
| 129 | .build(); |
| 130 | } |
| 131 | if (modVlanIdInst.size() == 2 && capabilities.supportDoubleVlanTerm()) { |
| 132 | return PiAction.builder() |
| 133 | .withId(FabricConstants.FABRIC_INGRESS_NEXT_SET_DOUBLE_VLAN) |
| 134 | .withParameter(new PiActionParam( |
| 135 | FabricConstants.INNER_VLAN_ID, |
| 136 | modVlanIdInst.get(0).vlanId().toShort())) |
| 137 | .withParameter(new PiActionParam( |
| 138 | FabricConstants.OUTER_VLAN_ID, |
| 139 | modVlanIdInst.get(1).vlanId().toShort())) |
| 140 | .build(); |
| 141 | } |
| 142 | throw new PiInterpreterException("Too many VLAN instructions"); |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | private static PiAction mapNextHashedOrSimpleTreatment( |
| 146 | TrafficTreatment treatment, PiTableId tableId, boolean simple) |
| 147 | throws PiInterpreterException { |
| 148 | // Provide mapping for output_hashed, routing_hashed, and |
| 149 | // mpls_routing_hashed. multicast_hashed can only be invoked with |
| 150 | // PiAction, hence no mapping. outPort required for all actions. Presence |
| 151 | // of other instructions will determine which action to map to. |
| 152 | final PortNumber outPort = ((OutputInstruction) instructionOrFail( |
| 153 | treatment, OUTPUT, tableId)).port(); |
| 154 | final ModEtherInstruction ethDst = (ModEtherInstruction) l2Instruction( |
| 155 | treatment, ETH_DST); |
| 156 | final ModEtherInstruction ethSrc = (ModEtherInstruction) l2Instruction( |
| 157 | treatment, ETH_SRC); |
| 158 | final Instruction mplsPush = l2Instruction( |
| 159 | treatment, MPLS_PUSH); |
| 160 | final ModMplsLabelInstruction mplsLabel = (ModMplsLabelInstruction) l2Instruction( |
| 161 | treatment, MPLS_LABEL); |
| 162 | |
| 163 | final PiAction.Builder actionBuilder = PiAction.builder() |
| 164 | .withParameter(new PiActionParam(FabricConstants.PORT_NUM, outPort.toLong())); |
| 165 | |
| 166 | if (ethDst != null && ethSrc != null) { |
| 167 | actionBuilder.withParameter(new PiActionParam( |
| 168 | FabricConstants.SMAC, ethSrc.mac().toBytes())); |
| 169 | actionBuilder.withParameter(new PiActionParam( |
| 170 | FabricConstants.DMAC, ethDst.mac().toBytes())); |
| 171 | if (mplsLabel != null) { |
| 172 | // mpls_routing_hashed |
| 173 | return actionBuilder |
| 174 | .withParameter(new PiActionParam(FabricConstants.LABEL, mplsLabel.label().toInt())) |
| 175 | .withId(simple ? FabricConstants.FABRIC_INGRESS_NEXT_MPLS_ROUTING_SIMPLE |
| 176 | : FabricConstants.FABRIC_INGRESS_NEXT_MPLS_ROUTING_HASHED) |
| 177 | .build(); |
| 178 | } else { |
| 179 | // routing_hashed |
| 180 | return actionBuilder |
| 181 | .withId(simple ? FabricConstants.FABRIC_INGRESS_NEXT_ROUTING_SIMPLE |
| 182 | : FabricConstants.FABRIC_INGRESS_NEXT_ROUTING_HASHED) |
| 183 | .build(); |
| 184 | } |
| 185 | } else { |
| 186 | // output_hashed |
| 187 | return actionBuilder |
| 188 | .withId(simple ? FabricConstants.FABRIC_INGRESS_NEXT_OUTPUT_SIMPLE |
| 189 | : FabricConstants.FABRIC_INGRESS_NEXT_OUTPUT_HASHED) |
| 190 | .build(); |
| 191 | } |
| 192 | } |
| 193 | |
Carmelo Cascone | 45cc086 | 2018-11-26 11:50:41 -0800 | [diff] [blame] | 194 | private static PiAction mapNextXconnect( |
| 195 | TrafficTreatment treatment, PiTableId tableId) |
| 196 | throws PiInterpreterException { |
| 197 | final PortNumber outPort = ((OutputInstruction) instructionOrFail( |
| 198 | treatment, OUTPUT, tableId)).port(); |
| 199 | return PiAction.builder() |
| 200 | .withId(FabricConstants.FABRIC_INGRESS_NEXT_OUTPUT_XCONNECT) |
| 201 | .withParameter(new PiActionParam( |
| 202 | FabricConstants.PORT_NUM, outPort.toLong())) |
| 203 | .build(); |
| 204 | } |
| 205 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 206 | static PiAction mapAclTreatment(TrafficTreatment treatment, PiTableId tableId) |
| 207 | throws PiInterpreterException { |
| 208 | if (isNoAction(treatment)) { |
| 209 | return nop(tableId); |
| 210 | } |
Daniele Moro | 01ca2ab | 2019-06-25 11:48:48 -0700 | [diff] [blame] | 211 | treatmentException( |
| 212 | tableId, treatment, |
| 213 | "unsupported treatment"); |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 214 | |
Daniele Moro | 01ca2ab | 2019-06-25 11:48:48 -0700 | [diff] [blame] | 215 | // This function will never return null |
| 216 | return null; |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 217 | } |
| 218 | |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 219 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 220 | static PiAction mapEgressNextTreatment( |
| 221 | TrafficTreatment treatment, PiTableId tableId) |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 222 | throws PiInterpreterException { |
pierventre | cfd08de | 2020-12-15 17:34:54 +0100 | [diff] [blame] | 223 | L2ModificationInstruction pushVlan = l2Instruction(treatment, VLAN_PUSH); |
| 224 | if (pushVlan != null) { |
| 225 | return PiAction.builder() |
| 226 | .withId(FabricConstants.FABRIC_EGRESS_EGRESS_NEXT_PUSH_VLAN) |
| 227 | .build(); |
| 228 | } |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 229 | l2InstructionOrFail(treatment, VLAN_POP, tableId); |
| 230 | return PiAction.builder() |
| 231 | .withId(FabricConstants.FABRIC_EGRESS_EGRESS_NEXT_POP_VLAN) |
| 232 | .build(); |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 233 | |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 234 | } |
Yi Tseng | 20f9e7b | 2018-05-24 23:27:39 +0800 | [diff] [blame] | 235 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 236 | private static PiAction nop(PiTableId tableId) throws PiInterpreterException { |
| 237 | if (!NOP_ACTIONS.containsKey(tableId)) { |
| 238 | throw new PiInterpreterException(format("table '%s' doe not specify a nop action", tableId)); |
| 239 | } |
| 240 | return PiAction.builder().withId(NOP_ACTIONS.get(tableId)).build(); |
| 241 | } |
| 242 | |
| 243 | private static boolean isNoAction(TrafficTreatment treatment) { |
pierventre | 9ff7caa | 2021-01-08 17:35:47 +0100 | [diff] [blame^] | 244 | // Empty treatment OR |
| 245 | // No instructions OR |
| 246 | // Empty treatment AND writeMetadata |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 247 | return treatment.equals(DefaultTrafficTreatment.emptyTreatment()) || |
pierventre | 9ff7caa | 2021-01-08 17:35:47 +0100 | [diff] [blame^] | 248 | treatment.allInstructions().isEmpty() || |
| 249 | (treatment.allInstructions().size() == 1 && treatment.writeMetadata() != null); |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 250 | } |
| 251 | |
Daniele Moro | f51d0c1 | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 252 | private static boolean isFilteringPopAction(TrafficTreatment treatment) { |
| 253 | return l2Instruction(treatment, VLAN_POP) != null; |
| 254 | } |
| 255 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 256 | private static Instruction l2InstructionOrFail( |
| 257 | TrafficTreatment treatment, |
| 258 | L2ModificationInstruction.L2SubType subType, PiTableId tableId) |
| 259 | throws PiInterpreterException { |
| 260 | final Instruction inst = l2Instruction(treatment, subType); |
| 261 | if (inst == null) { |
| 262 | treatmentException(tableId, treatment, format("missing %s instruction", subType)); |
| 263 | } |
| 264 | return inst; |
| 265 | } |
| 266 | |
Daniele Moro | f51d0c1 | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 267 | private static List<L2ModificationInstruction> l2InstructionsOrFail( |
| 268 | TrafficTreatment treatment, |
| 269 | L2ModificationInstruction.L2SubType subType, PiTableId tableId) |
| 270 | throws PiInterpreterException { |
| 271 | final List<L2ModificationInstruction> inst = l2Instructions(treatment, subType); |
| 272 | if (inst == null || inst.isEmpty()) { |
| 273 | treatmentException(tableId, treatment, format("missing %s instruction", subType)); |
| 274 | } |
| 275 | return inst; |
| 276 | } |
| 277 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 278 | private static Instruction instructionOrFail( |
| 279 | TrafficTreatment treatment, Instruction.Type type, PiTableId tableId) |
| 280 | throws PiInterpreterException { |
| 281 | final Instruction inst = instruction(treatment, type); |
| 282 | if (inst == null) { |
| 283 | treatmentException(tableId, treatment, format("missing %s instruction", type)); |
| 284 | } |
| 285 | return inst; |
| 286 | } |
| 287 | |
| 288 | private static void tableException(PiTableId tableId) |
| 289 | throws PiInterpreterException { |
| 290 | throw new PiInterpreterException(format("Table '%s' not supported", tableId)); |
| 291 | } |
| 292 | |
| 293 | private static void treatmentException( |
| 294 | PiTableId tableId, TrafficTreatment treatment, String explanation) |
| 295 | throws PiInterpreterException { |
| 296 | throw new PiInterpreterException(format( |
| 297 | "Invalid treatment for table '%s', %s: %s", tableId, explanation, treatment)); |
Yi Tseng | 20f9e7b | 2018-05-24 23:27:39 +0800 | [diff] [blame] | 298 | } |
Yi Tseng | fa4a1c7 | 2017-11-03 10:22:38 -0700 | [diff] [blame] | 299 | } |