summaryrefslogtreecommitdiff
path: root/lib/dpif-provider.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-05-06 15:04:29 -0700
committerBen Pfaff <blp@nicira.com>2011-05-11 12:26:07 -0700
commit640e1b20776f40633d33a5c2c2bba3e79eda0b64 (patch)
tree1502412c5fbd9e20c4193122a00ffc50901fd290 /lib/dpif-provider.h
parentfa066f015f716c74315fed1a08912d003dfe3f8c (diff)
downloadopenvswitch-640e1b20776f40633d33a5c2c2bba3e79eda0b64.tar.gz
dpif: Improve abstraction by making 'run' and 'wait' functions per-dpif.
Until now, the dp_run() and dp_wait() functions had to be called at the top level of the program because they applied to every open dpif. By replacing them by functions that take a specific dpif as an argument, we can call them only from ofproto, which is currently the correct layer to deal with dpifs.
Diffstat (limited to 'lib/dpif-provider.h')
-rw-r--r--lib/dpif-provider.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h
index 4d367530e..8670906a5 100644
--- a/lib/dpif-provider.h
+++ b/lib/dpif-provider.h
@@ -69,14 +69,6 @@ struct dpif_class {
* the type assumed if no type is specified when opening a dpif. */
const char *type;
- /* Performs periodic work needed by dpifs of this class, if any is
- * necessary. */
- void (*run)(void);
-
- /* Arranges for poll_block() to wake up if the "run" member function needs
- * to be called. */
- void (*wait)(void);
-
/* Enumerates the names of all known created datapaths, if possible, into
* 'all_dps'. The caller has already initialized 'all_dps' and other dpif
* classes might already have added names to it.
@@ -108,6 +100,13 @@ struct dpif_class {
* the 'close' member function. */
int (*destroy)(struct dpif *dpif);
+ /* Performs periodic work needed by 'dpif', if any is necessary. */
+ void (*run)(struct dpif *dpif);
+
+ /* Arranges for poll_block() to wake up if the "run" member function needs
+ * to be called for 'dpif'. */
+ void (*wait)(struct dpif *dpif);
+
/* Retrieves statistics for 'dpif' into 'stats'. */
int (*get_stats)(const struct dpif *dpif, struct odp_stats *stats);