Skip to content
Snippets Groups Projects
Commit 4b99d3c4 authored by abat's avatar abat
Browse files

Merge into master from pull request #62:

device manager attachment points on broadcast domains (https://github.com/floodlight/floodlight/pull/62)
parents f2694fea 2570a568
No related branches found
No related tags found
No related merge requests found
...@@ -979,9 +979,15 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -979,9 +979,15 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
// An exception is thrown if the attachmentPoint is blocked. // An exception is thrown if the attachmentPoint is blocked.
if (newAttachmentPoint) { if (newAttachmentPoint) {
attachmentPoint = getNewAttachmentPoint(nd, switchPort); attachmentPoint = getNewAttachmentPoint(nd, switchPort);
nd.addAttachmentPoint(attachmentPoint); if (attachmentPoint == null) {
evHistAttachmtPt(nd, attachmentPoint.getSwitchPort(), newAttachmentPoint = false;
EvAction.ADDED, "New AP from pkt-in"); } else {
nd.addAttachmentPoint(attachmentPoint);
evHistAttachmtPt(nd,
attachmentPoint.getSwitchPort(),
EvAction.ADDED,
"New AP from pkt-in");
}
} }
if (clearAttachmentPoints) { if (clearAttachmentPoints) {
...@@ -1079,6 +1085,16 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1079,6 +1085,16 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
} }
} }
if (curAttachmentPoint != null) {
Long curDPID = curAttachmentPoint.getSwitchPort().getSw().getId();
Short curPort = curAttachmentPoint.getSwitchPort().getPort();
boolean sameBD =
topology.isInSameBroadcastDomain(swPort.getSw().getId(),
swPort.getPort(),
curDPID, curPort);
if (sameBD) return null;
}
// Do we have an old attachment point? // Do we have an old attachment point?
DeviceAttachmentPoint attachmentPoint = DeviceAttachmentPoint attachmentPoint =
device.getOldAttachmentPoint(swPort); device.getOldAttachmentPoint(swPort);
...@@ -1116,11 +1132,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1116,11 +1132,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
// If two ports are in the same port-channel, we don't treat it // If two ports are in the same port-channel, we don't treat it
// as conflict, but will forward based on the last seen switch-port // as conflict, but will forward based on the last seen switch-port
if (!devMgrMaps.inSamePortChannel(swPort, if (!devMgrMaps.inSamePortChannel(swPort,
curAttachmentPoint.getSwitchPort()) && curAttachmentPoint.getSwitchPort())) {
!topology.isInSameBroadcastDomain(swPort.getSw().getId(),
swPort.getPort(),
curAttachmentPoint.getSwitchPort().getSw().getId(),
curAttachmentPoint.getSwitchPort().getPort())) {
curAttachmentPoint.setConflict(currentDate); curAttachmentPoint.setConflict(currentDate);
if (curAttachmentPoint.isFlapping()) { if (curAttachmentPoint.isFlapping()) {
curAttachmentPoint.setBlocked(true); curAttachmentPoint.setBlocked(true);
......
...@@ -223,9 +223,6 @@ public abstract class ForwardingBase implements IOFMessageListener, IDeviceManag ...@@ -223,9 +223,6 @@ public abstract class ForwardingBase implements IOFMessageListener, IDeviceManag
log.debug("pushRoute flowmod sw={} inPort={} outPort={}", log.debug("pushRoute flowmod sw={} inPort={} outPort={}",
new Object[] { sw, fm.getMatch().getInputPort(), new Object[] { sw, fm.getMatch().getInputPort(),
((OFActionOutput)fm.getActions().get(0)).getPort() }); ((OFActionOutput)fm.getActions().get(0)).getPort() });
log.info("Flow mod sent: Wildcard={} match={}",
Integer.toHexString(fm.getMatch().getWildcards()),
fm.getMatch().toString());
sw.write(fm, cntx); sw.write(fm, cntx);
if (doFlush) { if (doFlush) {
sw.flush(); sw.flush();
......
...@@ -544,6 +544,11 @@ public class DeviceManagerImplTest extends FloodlightTestCase { ...@@ -544,6 +544,11 @@ public class DeviceManagerImplTest extends FloodlightTestCase {
.andReturn(false).atLeastOnce(); .andReturn(false).atLeastOnce();
expect(mockTopology.isBroadcastDomainPort(1L, (short)2)) expect(mockTopology.isBroadcastDomainPort(1L, (short)2))
.andReturn(false).atLeastOnce(); .andReturn(false).atLeastOnce();
expect(mockTopology.isInSameBroadcastDomain((long)1, (short)1,
(long)1, (short)2)).andReturn(false).anyTimes();
expect(mockTopology.isInSameBroadcastDomain((long)1, (short)2,
(long)1, (short)1)).andReturn(false).anyTimes();
deviceManager.setTopology(mockTopology); deviceManager.setTopology(mockTopology);
// Start recording the replay on the mocks // Start recording the replay on the mocks
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment