Committed by
Yuta Higuchi
- Supports multi-table feature in the improved batch process in the flow rule subsystem.
- Fix a bug of unsafe type conversion in OpenFlowGroupProvider. Change-Id: I9a62f81b66d350b84296192f770dc8987aa0967b
Showing
2 changed files
with
12 additions
and
8 deletions
... | @@ -222,7 +222,11 @@ public class OpenFlowRuleProvider extends AbstractProvider implements FlowRulePr | ... | @@ -222,7 +222,11 @@ public class OpenFlowRuleProvider extends AbstractProvider implements FlowRulePr |
222 | fbe.operator(), fbe); | 222 | fbe.operator(), fbe); |
223 | continue; | 223 | continue; |
224 | } | 224 | } |
225 | + if (fbe.target().type() == FlowRule.Type.DEFAULT) { | ||
225 | sw.sendMsg(mod); | 226 | sw.sendMsg(mod); |
227 | + } else { | ||
228 | + sw.sendMsg(mod, getTableType(fbe.target().type())); | ||
229 | + } | ||
226 | } | 230 | } |
227 | OFBarrierRequest.Builder builder = sw.factory() | 231 | OFBarrierRequest.Builder builder = sw.factory() |
228 | .buildBarrierRequest() | 232 | .buildBarrierRequest() | ... | ... |
... | @@ -87,11 +87,11 @@ public class OpenFlowGroupProvider extends AbstractProvider implements GroupProv | ... | @@ -87,11 +87,11 @@ public class OpenFlowGroupProvider extends AbstractProvider implements GroupProv |
87 | private static final AtomicLong XID_COUNTER = new AtomicLong(1); | 87 | private static final AtomicLong XID_COUNTER = new AtomicLong(1); |
88 | private final Map<Dpid, GroupStatsCollector> collectors = Maps.newHashMap(); | 88 | private final Map<Dpid, GroupStatsCollector> collectors = Maps.newHashMap(); |
89 | private final Map<Long, OFStatsReply> groupStats = Maps.newConcurrentMap(); | 89 | private final Map<Long, OFStatsReply> groupStats = Maps.newConcurrentMap(); |
90 | - private final Map<Integer, GroupOperation> pendingGroupOperations = | 90 | + private final Map<GroupId, GroupOperation> pendingGroupOperations = |
91 | Maps.newConcurrentMap(); | 91 | Maps.newConcurrentMap(); |
92 | 92 | ||
93 | /* Map<Group ID, Transaction ID> */ | 93 | /* Map<Group ID, Transaction ID> */ |
94 | - private final Map<Integer, Long> pendingXidMaps = Maps.newConcurrentMap(); | 94 | + private final Map<GroupId, Long> pendingXidMaps = Maps.newConcurrentMap(); |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * Creates a OpenFlow group provider. | 97 | * Creates a OpenFlow group provider. |
... | @@ -157,9 +157,9 @@ public class OpenFlowGroupProvider extends AbstractProvider implements GroupProv | ... | @@ -157,9 +157,9 @@ public class OpenFlowGroupProvider extends AbstractProvider implements GroupProv |
157 | log.error("Unsupported Group operation"); | 157 | log.error("Unsupported Group operation"); |
158 | } | 158 | } |
159 | sw.sendMsg(groupMod); | 159 | sw.sendMsg(groupMod); |
160 | - pendingGroupOperations.put(groupMod.getGroup().getGroupNumber(), | 160 | + GroupId groudId = new DefaultGroupId(groupMod.getGroup().getGroupNumber()); |
161 | - groupOperation); | 161 | + pendingGroupOperations.put(groudId, groupOperation); |
162 | - pendingXidMaps.put(groupMod.getGroup().getGroupNumber(), groupModXid); | 162 | + pendingXidMaps.put(groudId, groupModXid); |
163 | } | 163 | } |
164 | } | 164 | } |
165 | 165 | ||
... | @@ -282,14 +282,14 @@ public class OpenFlowGroupProvider extends AbstractProvider implements GroupProv | ... | @@ -282,14 +282,14 @@ public class OpenFlowGroupProvider extends AbstractProvider implements GroupProv |
282 | case ERROR: | 282 | case ERROR: |
283 | OFErrorMsg errorMsg = (OFErrorMsg) msg; | 283 | OFErrorMsg errorMsg = (OFErrorMsg) msg; |
284 | if (errorMsg.getErrType() == OFErrorType.GROUP_MOD_FAILED) { | 284 | if (errorMsg.getErrType() == OFErrorType.GROUP_MOD_FAILED) { |
285 | - int pendingGroupId = -1; | 285 | + GroupId pendingGroupId = null; |
286 | - for (Map.Entry<Integer, Long> entry: pendingXidMaps.entrySet()) { | 286 | + for (Map.Entry<GroupId, Long> entry: pendingXidMaps.entrySet()) { |
287 | if (entry.getValue() == errorMsg.getXid()) { | 287 | if (entry.getValue() == errorMsg.getXid()) { |
288 | pendingGroupId = entry.getKey(); | 288 | pendingGroupId = entry.getKey(); |
289 | break; | 289 | break; |
290 | } | 290 | } |
291 | } | 291 | } |
292 | - if (pendingGroupId == -1) { | 292 | + if (pendingGroupId == null) { |
293 | log.warn("Error for unknown group operation: {}", | 293 | log.warn("Error for unknown group operation: {}", |
294 | errorMsg.getXid()); | 294 | errorMsg.getXid()); |
295 | } else { | 295 | } else { | ... | ... |
-
Please register or login to post a comment