Skip to content
Snippets Groups Projects
Commit 2300e677 authored by Ryan Izard's avatar Ryan Izard
Browse files

Added a patch to support HP ProCurve switches and others that do not support...

Added a patch to support HP ProCurve switches and others that do not support the OFPT_BARRIER_REQUEST message. Updated SFP unit test to include the SEND_FLOW_REM flag in the test flows (forgot from last commit).
parent 5e994da8
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,8 @@ import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; ...@@ -43,6 +43,8 @@ import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode;
import org.projectfloodlight.openflow.protocol.OFFlowRemoved; import org.projectfloodlight.openflow.protocol.OFFlowRemoved;
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; import org.projectfloodlight.openflow.protocol.OFGetConfigReply;
import org.projectfloodlight.openflow.protocol.OFGetConfigRequest; import org.projectfloodlight.openflow.protocol.OFGetConfigRequest;
import org.projectfloodlight.openflow.protocol.OFGroupDelete;
import org.projectfloodlight.openflow.protocol.OFGroupType;
import org.projectfloodlight.openflow.protocol.OFMessage; import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFNiciraControllerRole; import org.projectfloodlight.openflow.protocol.OFNiciraControllerRole;
import org.projectfloodlight.openflow.protocol.OFNiciraControllerRoleReply; import org.projectfloodlight.openflow.protocol.OFNiciraControllerRoleReply;
...@@ -64,6 +66,7 @@ import org.projectfloodlight.openflow.protocol.errormsg.OFBadRequestErrorMsg; ...@@ -64,6 +66,7 @@ import org.projectfloodlight.openflow.protocol.errormsg.OFBadRequestErrorMsg;
import org.projectfloodlight.openflow.protocol.errormsg.OFFlowModFailedErrorMsg; import org.projectfloodlight.openflow.protocol.errormsg.OFFlowModFailedErrorMsg;
import org.projectfloodlight.openflow.types.DatapathId; import org.projectfloodlight.openflow.types.DatapathId;
import org.projectfloodlight.openflow.types.OFAuxId; import org.projectfloodlight.openflow.types.OFAuxId;
import org.projectfloodlight.openflow.types.OFGroup;
import org.projectfloodlight.openflow.types.OFPort; import org.projectfloodlight.openflow.types.OFPort;
import org.projectfloodlight.openflow.types.TableId; import org.projectfloodlight.openflow.types.TableId;
import org.projectfloodlight.openflow.types.U64; import org.projectfloodlight.openflow.types.U64;
...@@ -440,11 +443,33 @@ public class OFSwitchHandshakeHandler implements IOFConnectionListener { ...@@ -440,11 +443,33 @@ public class OFSwitchHandshakeHandler implements IOFConnectionListener {
OFFlowDelete deleteFlows = this.factory.buildFlowDelete() OFFlowDelete deleteFlows = this.factory.buildFlowDelete()
.build(); .build();
this.sw.write(deleteFlows); this.sw.write(deleteFlows);
} else { /* All other OFVersions support multiple tables. */ } else { /* All other OFVersions support multiple tables and groups. */
OFFlowDelete deleteFlows = this.factory.buildFlowDelete() OFFlowDelete deleteFlows = this.factory.buildFlowDelete()
.setTableId(TableId.ALL) .setTableId(TableId.ALL)
.build(); .build();
this.sw.write(deleteFlows); this.sw.write(deleteFlows);
/*
* Clear all groups.
* We have to do this for all types manually as of Loxi 0.9.0.
*/
OFGroupDelete delgroup = this.sw.getOFFactory().buildGroupDelete()
.setGroup(OFGroup.ALL)
.setGroupType(OFGroupType.ALL)
.build();
this.sw.write(delgroup);
delgroup.createBuilder()
.setGroupType(OFGroupType.FF)
.build();
this.sw.write(delgroup);
delgroup.createBuilder()
.setGroupType(OFGroupType.INDIRECT)
.build();
this.sw.write(delgroup);
delgroup.createBuilder()
.setGroupType(OFGroupType.SELECT)
.build();
this.sw.write(delgroup);
} }
/* /*
...@@ -845,15 +870,28 @@ public class OFSwitchHandshakeHandler implements IOFConnectionListener { ...@@ -845,15 +870,28 @@ public class OFSwitchHandshakeHandler implements IOFConnectionListener {
@Override @Override
void processOFError(OFErrorMsg m) { void processOFError(OFErrorMsg m) {
logErrorDisconnect(m); /*
} * HP ProCurve switches do not support
* the ofpt_barrier_request message.
*
* Look for an error from a bad ofpt_barrier_request,
* log a warning, but proceed.
*/
if (m.getErrType() == OFErrorType.BAD_REQUEST &&
((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
} else {
logErrorDisconnect(m);
}
}
@Override @Override
void enterState() { void enterState() {
sendHandshakeSetConfig(); sendHandshakeSetConfig();
} }
} }
/** /**
* We are waiting for a OFDescriptionStat message from the switch. * We are waiting for a OFDescriptionStat message from the switch.
* Once we receive any stat message we try to parse it. If it's not * Once we receive any stat message we try to parse it. If it's not
......
...@@ -19,4 +19,5 @@ org.sdnplatform.sync.internal.SyncManager.authScheme=CHALLENGE_RESPONSE ...@@ -19,4 +19,5 @@ org.sdnplatform.sync.internal.SyncManager.authScheme=CHALLENGE_RESPONSE
org.sdnplatform.sync.internal.SyncManager.keyStorePath=/etc/floodlight/auth_credentials.jceks org.sdnplatform.sync.internal.SyncManager.keyStorePath=/etc/floodlight/auth_credentials.jceks
org.sdnplatform.sync.internal.SyncManager.dbPath=/var/lib/floodlight/ org.sdnplatform.sync.internal.SyncManager.dbPath=/var/lib/floodlight/
org.sdnplatform.sync.internal.SyncManager.port=6642 org.sdnplatform.sync.internal.SyncManager.port=6642
net.floodlightcontroller.core.internal.FloodlightProvider.openflowPort=6653
net.floodlightcontroller.core.internal.FloodlightProvider.role=ACTIVE net.floodlightcontroller.core.internal.FloodlightProvider.role=ACTIVE
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<logger name="net.floodlightcontroller.packet" level="INFO"></logger> <logger name="net.floodlightcontroller.packet" level="INFO"></logger>
<logger name="net.floodlightcontroller.forwarding" level="INFO"></logger> <logger name="net.floodlightcontroller.forwarding" level="INFO"></logger>
<logger name="net.floodlightcontroller.routing" level="INFO"></logger> <logger name="net.floodlightcontroller.routing" level="INFO"></logger>
<logger name="net.floodlightcontroller.core" level="INFO"></logger> <logger name="net.floodlightcontroller.core.internal" level="INFO"></logger>
<logger level="DEBUG" name="net.floodlightcontroller.firewall"></logger> <logger level="DEBUG" name="net.floodlightcontroller.firewall"></logger>
<logger level="INFO" name="net.floodlightcontroller.staticflowentry"></logger> <logger level="INFO" name="net.floodlightcontroller.staticflowentry"></logger>
</configuration> </configuration>
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