Implemented simple config mechanism to allow different pipelines for the
CPqD software switch.
Default pipeline is 1.0 mode (send-to-controller table miss entry in first
table).
A more complex 1.3 pipeline can be enabled by setting the following in your
onos.properties file:
net.floodlightcontroller.core.FloodlightProvider.cpqdUsePipeline13=true
Change-Id: I0a15bf04ac9c92e1e6241896d12052dd56449d3c
diff --git a/src/main/java/net/onrc/onos/core/drivermanager/DriverManager.java b/src/main/java/net/onrc/onos/core/drivermanager/DriverManager.java
index fe86077..e212655 100644
--- a/src/main/java/net/onrc/onos/core/drivermanager/DriverManager.java
+++ b/src/main/java/net/onrc/onos/core/drivermanager/DriverManager.java
@@ -16,6 +16,10 @@
private static final Logger log = LoggerFactory.getLogger(DriverManager.class);
+ // Whether to use an OF 1.3 configured TTP, or to use an OF 1.0-style
+ // single table with packet-ins.
+ private static boolean cpqdUsePipeline13 = false;
+
/**
* Return an IOFSwitch object based on switch's manufacturer description
* from OFDescStatsReply.
@@ -30,7 +34,7 @@
if (vendor.startsWith("Stanford University, Ericsson Research and CPqD Research")
&&
hw.startsWith("OpenFlow 1.3 Reference Userspace Switch")) {
- return new OFSwitchImplCPqD13(desc);
+ return new OFSwitchImplCPqD13(desc, cpqdUsePipeline13);
}
if (vendor.startsWith("Nicira") &&
@@ -55,4 +59,16 @@
*/
private DriverManager() {
}
+
+ /**
+ * Sets the configuration parameter which determines how the CPqD switch
+ * is set up. If usePipeline13 is true, a 1.3 pipeline will be set up on
+ * the switch. Otherwise, the switch will be set up in a 1.0 style with
+ * a single table where missed packets are sent to the controller.
+ *
+ * @param usePipeline13 whether to use a 1.3 pipeline or not
+ */
+ public static void setConfigForCpqd(boolean usePipeline13) {
+ cpqdUsePipeline13 = usePipeline13;
+ }
}
diff --git a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
index efeaf6e..7bdf041 100644
--- a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
+++ b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
@@ -93,12 +93,15 @@
ConcurrentHashMap<Integer, OFGroup> l2groups;
- public OFSwitchImplCPqD13(OFDescStatsReply desc) {
+ private final boolean usePipeline13;
+
+ public OFSwitchImplCPqD13(OFDescStatsReply desc, boolean usePipeline13) {
super();
driverHandshakeComplete = new AtomicBoolean(false);
l2groups = new ConcurrentHashMap<Integer, OFGroup>();
setSwitchDescription(desc);
+ this.usePipeline13 = usePipeline13;
}
/* (non-Javadoc)
@@ -119,7 +122,12 @@
}
startDriverHandshakeCalled = true;
factory = getFactory();
- // configureSwitch();
+ if (!usePipeline13) {
+ // Send packet-in to controller if a packet misses the first table
+ populateTableMissEntry(0, true, false, false, 0);
+ } //else {
+ // configureSwitch();
+ //}
sendBarrier(true);
}