Committed by
Gerrit Code Review
Demoting boy-cried-wolf log messages.
Change-Id: Idfb9b3178b79ab6b30af285c10a52b9f20dfbfe1
Showing
6 changed files
with
26 additions
and
23 deletions
... | @@ -581,7 +581,6 @@ public class DeviceManager | ... | @@ -581,7 +581,6 @@ public class DeviceManager |
581 | 581 | ||
582 | @Override | 582 | @Override |
583 | public void event(MastershipEvent event) { | 583 | public void event(MastershipEvent event) { |
584 | - | ||
585 | if (event.type() != MastershipEvent.Type.MASTER_CHANGED) { | 584 | if (event.type() != MastershipEvent.Type.MASTER_CHANGED) { |
586 | // Don't care if backup list changed. | 585 | // Don't care if backup list changed. |
587 | return; | 586 | return; |
... | @@ -625,7 +624,7 @@ public class DeviceManager | ... | @@ -625,7 +624,7 @@ public class DeviceManager |
625 | if (store.getDevice(did) != null) { | 624 | if (store.getDevice(did) != null) { |
626 | reassertRole(did, myNextRole); | 625 | reassertRole(did, myNextRole); |
627 | } else { | 626 | } else { |
628 | - log.warn("Device is not yet/no longer in the store: {}", did); | 627 | + log.debug("Device is not yet/no longer in the store: {}", did); |
629 | } | 628 | } |
630 | } | 629 | } |
631 | } | 630 | } | ... | ... |
... | @@ -207,7 +207,7 @@ public class Controller { | ... | @@ -207,7 +207,7 @@ public class Controller { |
207 | Driver driver = driverService | 207 | Driver driver = driverService |
208 | .getDriver(desc.getMfrDesc(), desc.getHwDesc(), desc.getSwDesc()); | 208 | .getDriver(desc.getMfrDesc(), desc.getHwDesc(), desc.getSwDesc()); |
209 | 209 | ||
210 | - if (driver.hasBehaviour(OpenFlowSwitchDriver.class)) { | 210 | + if (driver != null && driver.hasBehaviour(OpenFlowSwitchDriver.class)) { |
211 | OpenFlowSwitchDriver ofSwitchDriver = driver.createBehaviour(new DefaultDriverHandler( | 211 | OpenFlowSwitchDriver ofSwitchDriver = driver.createBehaviour(new DefaultDriverHandler( |
212 | new DefaultDriverData(driver)), OpenFlowSwitchDriver.class); | 212 | new DefaultDriverData(driver)), OpenFlowSwitchDriver.class); |
213 | ofSwitchDriver.init(new Dpid(dpid), desc, ofv); | 213 | ofSwitchDriver.init(new Dpid(dpid), desc, ofv); | ... | ... |
... | @@ -25,6 +25,7 @@ import org.apache.felix.scr.annotations.Modified; | ... | @@ -25,6 +25,7 @@ import org.apache.felix.scr.annotations.Modified; |
25 | import org.apache.felix.scr.annotations.Reference; | 25 | import org.apache.felix.scr.annotations.Reference; |
26 | import org.apache.felix.scr.annotations.ReferenceCardinality; | 26 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
27 | import org.apache.felix.scr.annotations.Service; | 27 | import org.apache.felix.scr.annotations.Service; |
28 | +import org.onosproject.net.driver.DefaultDriverProviderService; | ||
28 | import org.onosproject.net.driver.DriverService; | 29 | import org.onosproject.net.driver.DriverService; |
29 | import org.onosproject.openflow.controller.DefaultOpenFlowPacketContext; | 30 | import org.onosproject.openflow.controller.DefaultOpenFlowPacketContext; |
30 | import org.onosproject.openflow.controller.Dpid; | 31 | import org.onosproject.openflow.controller.Dpid; |
... | @@ -81,6 +82,10 @@ public class OpenFlowControllerImpl implements OpenFlowController { | ... | @@ -81,6 +82,10 @@ public class OpenFlowControllerImpl implements OpenFlowController { |
81 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 82 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
82 | protected DriverService driverService; | 83 | protected DriverService driverService; |
83 | 84 | ||
85 | + // References exists merely for sequencing purpose to assure drivers are loaded | ||
86 | + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
87 | + protected DefaultDriverProviderService defaultDriverProviderService; | ||
88 | + | ||
84 | private final ExecutorService executorMsgs = | 89 | private final ExecutorService executorMsgs = |
85 | Executors.newFixedThreadPool(32, groupedThreads("onos/of", "event-stats-%d")); | 90 | Executors.newFixedThreadPool(32, groupedThreads("onos/of", "event-stats-%d")); |
86 | 91 | ||
... | @@ -507,11 +512,10 @@ public class OpenFlowControllerImpl implements OpenFlowController { | ... | @@ -507,11 +512,10 @@ public class OpenFlowControllerImpl implements OpenFlowController { |
507 | connectedSwitches.remove(dpid); | 512 | connectedSwitches.remove(dpid); |
508 | OpenFlowSwitch sw = activeMasterSwitches.remove(dpid); | 513 | OpenFlowSwitch sw = activeMasterSwitches.remove(dpid); |
509 | if (sw == null) { | 514 | if (sw == null) { |
510 | - log.warn("sw was null for {}", dpid); | 515 | + log.debug("sw was null for {}", dpid); |
511 | sw = activeEqualSwitches.remove(dpid); | 516 | sw = activeEqualSwitches.remove(dpid); |
512 | } | 517 | } |
513 | for (OpenFlowSwitchListener l : ofSwitchListener) { | 518 | for (OpenFlowSwitchListener l : ofSwitchListener) { |
514 | - log.warn("removal for {}", dpid); | ||
515 | l.switchRemoved(dpid); | 519 | l.switchRemoved(dpid); |
516 | } | 520 | } |
517 | } | 521 | } | ... | ... |
... | @@ -92,7 +92,7 @@ class RoleManager implements RoleHandler { | ... | @@ -92,7 +92,7 @@ class RoleManager implements RoleHandler { |
92 | // ensuring that the only two roles sent to 1.0 switches with | 92 | // ensuring that the only two roles sent to 1.0 switches with |
93 | // Nicira role support, are MASTER and SLAVE | 93 | // Nicira role support, are MASTER and SLAVE |
94 | roleToSend = OFNiciraControllerRole.ROLE_OTHER; | 94 | roleToSend = OFNiciraControllerRole.ROLE_OTHER; |
95 | - log.warn("Sending Nx Role.SLAVE to switch {}.", sw); | 95 | + log.debug("Sending Nx Role.SLAVE to switch {}.", sw); |
96 | } | 96 | } |
97 | int xid = sw.getNextTransactionId(); | 97 | int xid = sw.getNextTransactionId(); |
98 | OFExperimenter roleRequest = OFFactories.getFactory(OFVersion.OF_10) | 98 | OFExperimenter roleRequest = OFFactories.getFactory(OFVersion.OF_10) | ... | ... |
... | @@ -266,7 +266,6 @@ public class LLDPLinkProvider extends AbstractProvider implements LinkProvider { | ... | @@ -266,7 +266,6 @@ public class LLDPLinkProvider extends AbstractProvider implements LinkProvider { |
266 | 266 | ||
267 | @Override | 267 | @Override |
268 | public void event(MastershipEvent event) { | 268 | public void event(MastershipEvent event) { |
269 | - | ||
270 | if (MastershipEvent.Type.BACKUPS_CHANGED.equals(event.type())) { | 269 | if (MastershipEvent.Type.BACKUPS_CHANGED.equals(event.type())) { |
271 | // only need new master events | 270 | // only need new master events |
272 | return; | 271 | return; |
... | @@ -275,7 +274,7 @@ public class LLDPLinkProvider extends AbstractProvider implements LinkProvider { | ... | @@ -275,7 +274,7 @@ public class LLDPLinkProvider extends AbstractProvider implements LinkProvider { |
275 | DeviceId deviceId = event.subject(); | 274 | DeviceId deviceId = event.subject(); |
276 | Device device = deviceService.getDevice(deviceId); | 275 | Device device = deviceService.getDevice(deviceId); |
277 | if (device == null) { | 276 | if (device == null) { |
278 | - log.warn("Device {} doesn't exist, or isn't there yet", deviceId); | 277 | + log.debug("Device {} doesn't exist, or isn't there yet", deviceId); |
279 | return; | 278 | return; |
280 | } | 279 | } |
281 | if (rules.isSuppressed(device)) { | 280 | if (rules.isSuppressed(device)) { | ... | ... |
... | @@ -51,6 +51,7 @@ import org.onosproject.openflow.controller.OpenFlowSwitchListener; | ... | @@ -51,6 +51,7 @@ import org.onosproject.openflow.controller.OpenFlowSwitchListener; |
51 | import org.onosproject.openflow.controller.RoleState; | 51 | import org.onosproject.openflow.controller.RoleState; |
52 | import org.onosproject.openflow.controller.ThirdPartyMessage; | 52 | import org.onosproject.openflow.controller.ThirdPartyMessage; |
53 | import org.osgi.service.component.ComponentContext; | 53 | import org.osgi.service.component.ComponentContext; |
54 | +import org.projectfloodlight.openflow.protocol.OFBadRequestCode; | ||
54 | import org.projectfloodlight.openflow.protocol.OFBarrierRequest; | 55 | import org.projectfloodlight.openflow.protocol.OFBarrierRequest; |
55 | import org.projectfloodlight.openflow.protocol.OFErrorMsg; | 56 | import org.projectfloodlight.openflow.protocol.OFErrorMsg; |
56 | import org.projectfloodlight.openflow.protocol.OFErrorType; | 57 | import org.projectfloodlight.openflow.protocol.OFErrorType; |
... | @@ -61,6 +62,7 @@ import org.projectfloodlight.openflow.protocol.OFMessage; | ... | @@ -61,6 +62,7 @@ import org.projectfloodlight.openflow.protocol.OFMessage; |
61 | import org.projectfloodlight.openflow.protocol.OFPortStatus; | 62 | import org.projectfloodlight.openflow.protocol.OFPortStatus; |
62 | import org.projectfloodlight.openflow.protocol.OFStatsReply; | 63 | import org.projectfloodlight.openflow.protocol.OFStatsReply; |
63 | import org.projectfloodlight.openflow.protocol.OFStatsType; | 64 | import org.projectfloodlight.openflow.protocol.OFStatsType; |
65 | +import org.projectfloodlight.openflow.protocol.errormsg.OFBadRequestErrorMsg; | ||
64 | import org.projectfloodlight.openflow.protocol.errormsg.OFFlowModFailedErrorMsg; | 66 | import org.projectfloodlight.openflow.protocol.errormsg.OFFlowModFailedErrorMsg; |
65 | import org.slf4j.Logger; | 67 | import org.slf4j.Logger; |
66 | 68 | ||
... | @@ -327,8 +329,7 @@ public class OpenFlowRuleProvider extends AbstractProvider | ... | @@ -327,8 +329,7 @@ public class OpenFlowRuleProvider extends AbstractProvider |
327 | break; | 329 | break; |
328 | case BARRIER_REPLY: | 330 | case BARRIER_REPLY: |
329 | try { | 331 | try { |
330 | - InternalCacheEntry entry = pendingBatches.getIfPresent(msg | 332 | + InternalCacheEntry entry = pendingBatches.getIfPresent(msg.getXid()); |
331 | - .getXid()); | ||
332 | if (entry != null) { | 333 | if (entry != null) { |
333 | providerService | 334 | providerService |
334 | .batchOperationCompleted(msg.getXid(), | 335 | .batchOperationCompleted(msg.getXid(), |
... | @@ -342,32 +343,32 @@ public class OpenFlowRuleProvider extends AbstractProvider | ... | @@ -342,32 +343,32 @@ public class OpenFlowRuleProvider extends AbstractProvider |
342 | } | 343 | } |
343 | break; | 344 | break; |
344 | case ERROR: | 345 | case ERROR: |
345 | - log.warn("received Error message {} from {}", msg, dpid); | 346 | + // TODO: This needs to get suppressed in a better way. |
347 | + if (msg instanceof OFBadRequestErrorMsg && | ||
348 | + ((OFBadRequestErrorMsg) msg).getCode() == OFBadRequestCode.BAD_TYPE) { | ||
349 | + log.debug("Received error message {} from {}", msg, dpid); | ||
350 | + } else { | ||
351 | + log.warn("Received error message {} from {}", msg, dpid); | ||
352 | + } | ||
346 | 353 | ||
347 | OFErrorMsg error = (OFErrorMsg) msg; | 354 | OFErrorMsg error = (OFErrorMsg) msg; |
348 | if (error.getErrType() == OFErrorType.FLOW_MOD_FAILED) { | 355 | if (error.getErrType() == OFErrorType.FLOW_MOD_FAILED) { |
349 | OFFlowModFailedErrorMsg fmFailed = (OFFlowModFailedErrorMsg) error; | 356 | OFFlowModFailedErrorMsg fmFailed = (OFFlowModFailedErrorMsg) error; |
350 | if (fmFailed.getData().getParsedMessage().isPresent()) { | 357 | if (fmFailed.getData().getParsedMessage().isPresent()) { |
351 | - OFMessage m = fmFailed.getData().getParsedMessage() | 358 | + OFMessage m = fmFailed.getData().getParsedMessage().get(); |
352 | - .get(); | ||
353 | OFFlowMod fm = (OFFlowMod) m; | 359 | OFFlowMod fm = (OFFlowMod) m; |
354 | - InternalCacheEntry entry = pendingBatches | 360 | + InternalCacheEntry entry = |
355 | - .getIfPresent(msg.getXid()); | 361 | + pendingBatches.getIfPresent(msg.getXid()); |
356 | if (entry != null) { | 362 | if (entry != null) { |
357 | - entry.appendFailure(new FlowEntryBuilder(dpid, fm) | 363 | + entry.appendFailure(new FlowEntryBuilder(dpid, fm).build()); |
358 | - .build()); | ||
359 | } else { | 364 | } else { |
360 | - log.error("No matching batch for this error: {}", | 365 | + log.error("No matching batch for this error: {}", error); |
361 | - error); | ||
362 | } | 366 | } |
363 | } else { | 367 | } else { |
364 | - // FIXME: Potentially add flowtracking to avoid this | 368 | + // FIXME: Potentially add flowtracking to avoid this message. |
365 | - // message. | ||
366 | log.error("Flow installation failed but switch didn't" | 369 | log.error("Flow installation failed but switch didn't" |
367 | + " tell us which one."); | 370 | + " tell us which one."); |
368 | } | 371 | } |
369 | - } else { | ||
370 | - log.warn("Received error {}", error); | ||
371 | } | 372 | } |
372 | 373 | ||
373 | default: | 374 | default: | ... | ... |
-
Please register or login to post a comment