summaryrefslogtreecommitdiff
path: root/utilities/ovs-openflowd.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-05-18 14:01:13 -0700
committerBen Pfaff <blp@nicira.com>2011-05-18 14:01:13 -0700
commitb2fda3effc787f265b5ad5dfa967ac00627bd075 (patch)
tree5c0017aedd36c0d9088dcd67a79beb8ff69bd4f9 /utilities/ovs-openflowd.c
parent827ab71c97f25b77c94a1158834cdad35df6806f (diff)
parent2e281761473ed67ecae00205f62180e9a21c9ade (diff)
downloadopenvswitch-b2fda3effc787f265b5ad5dfa967ac00627bd075.tar.gz
Merge 'next' into 'master'.
I know already that this breaks the statsfixes that were implemented by the following commits: 827ab71c97f "ofproto: Datapath statistics accounted twice." 6f1435fc8f7 "ofproto: Resubmit statistics improperly account during..." These were already broken in a previous merge. I will work on a fix.
Diffstat (limited to 'utilities/ovs-openflowd.c')
-rw-r--r--utilities/ovs-openflowd.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/utilities/ovs-openflowd.c b/utilities/ovs-openflowd.c
index aab5a2b07..4ca22e0d8 100644
--- a/utilities/ovs-openflowd.c
+++ b/utilities/ovs-openflowd.c
@@ -28,7 +28,6 @@
#include "compiler.h"
#include "daemon.h"
#include "dirs.h"
-#include "dpif.h"
#include "dummy.h"
#include "leak-checker.h"
#include "list.h"
@@ -93,7 +92,6 @@ main(int argc, char *argv[])
struct ofproto *ofproto;
struct ofsettings s;
int error;
- struct dpif *dpif;
struct netflow_options nf_options;
const char *port;
bool exiting;
@@ -116,9 +114,10 @@ main(int argc, char *argv[])
VLOG_INFO("Open vSwitch version %s", VERSION BUILDNR);
VLOG_INFO("OpenFlow protocol version 0x%02x", OFP_VERSION);
- error = dpif_create_and_open(s.dp_name, s.dp_type, &dpif);
+ error = ofproto_create(s.dp_name, s.dp_type, &ofproto);
if (error) {
- VLOG_FATAL("could not create datapath (%s)", strerror(error));
+ VLOG_FATAL("could not initialize OpenFlow switch (%s)",
+ strerror(error));
}
/* Add ports to the datapath if requested by the user. */
@@ -131,7 +130,7 @@ main(int argc, char *argv[])
port, strerror(error));
}
- error = dpif_port_add(dpif, netdev, NULL);
+ error = ofproto_port_add(ofproto, netdev, NULL);
if (error) {
VLOG_FATAL("failed to add %s as a port (%s)",
port, strerror(error));
@@ -140,12 +139,7 @@ main(int argc, char *argv[])
netdev_close(netdev);
}
- /* Start OpenFlow processing. */
- error = ofproto_create(s.dp_name, s.dp_type, NULL, NULL, &ofproto);
- if (error) {
- VLOG_FATAL("could not initialize openflow switch (%s)",
- strerror(error));
- }
+ /* Configure OpenFlow switch. */
if (s.datapath_id) {
ofproto_set_datapath_id(ofproto, s.datapath_id);
}
@@ -175,12 +169,10 @@ main(int argc, char *argv[])
VLOG_FATAL("unrecoverable datapath error (%s)", strerror(error));
}
unixctl_server_run(unixctl);
- dp_run();
netdev_run();
ofproto_wait(ofproto);
unixctl_server_wait(unixctl);
- dp_wait();
netdev_wait();
if (exiting) {
poll_immediate_wake();
@@ -188,7 +180,7 @@ main(int argc, char *argv[])
poll_block();
}
- dpif_close(dpif);
+ ofproto_destroy(ofproto);
return 0;
}
@@ -475,7 +467,7 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
}
/* Local vconns. */
- dp_parse_name(argv[0], &s->dp_name, &s->dp_type);
+ ofproto_parse_name(argv[0], &s->dp_name, &s->dp_type);
/* Figure out controller names. */
s->run_forever = false;