+\f
+/* Operation batching interface.
+ *
+ * Some datapaths are faster at performing N operations together than the same
+ * N operations individually, hence an interface for batching.
+ */
+
+enum dpif_op_type {
+ DPIF_OP_FLOW_PUT = 1,
+ DPIF_OP_EXECUTE
+};
+
+struct dpif_flow_put {
+ enum dpif_op_type type; /* Always DPIF_OP_FLOW_PUT. */
+
+ /* Input. */
+ enum dpif_flow_put_flags flags; /* DPIF_FP_*. */
+ const struct nlattr *key; /* Flow to put. */
+ size_t key_len; /* Length of 'key' in bytes. */
+ const struct nlattr *actions; /* Actions to perform on flow. */
+ size_t actions_len; /* Length of 'actions' in bytes. */
+
+ /* Output. */
+ struct dpif_flow_stats *stats; /* Optional flow statistics. */
+ int error; /* 0 or positive errno value. */
+};
+
+struct dpif_execute {
+ enum dpif_op_type type; /* Always DPIF_OP_EXECUTE. */
+
+ /* Input. */
+ const struct nlattr *key; /* Partial flow key (only for metadata). */
+ size_t key_len; /* Length of 'key' in bytes. */
+ const struct nlattr *actions; /* Actions to execute on packet. */
+ size_t actions_len; /* Length of 'actions' in bytes. */
+ const struct ofpbuf *packet; /* Packet to execute. */
+
+ /* Output. */
+ int error; /* 0 or positive errno value. */
+};
+
+union dpif_op {
+ enum dpif_op_type type;
+ struct dpif_flow_put flow_put;
+ struct dpif_execute execute;
+};
+
+void dpif_operate(struct dpif *, union dpif_op **ops, size_t n_ops);
+\f
+/* Upcalls. */
+
+enum dpif_upcall_type {
+ DPIF_UC_MISS, /* Miss in flow table. */
+ DPIF_UC_ACTION, /* OVS_ACTION_ATTR_USERSPACE action. */
+ DPIF_N_UC_TYPES
+};
+
+const char *dpif_upcall_type_to_string(enum dpif_upcall_type);
+
+/* A packet passed up from the datapath to userspace.
+ *
+ * If 'key' or 'actions' is nonnull, then it points into data owned by
+ * 'packet', so their memory cannot be freed separately. (This is hardly a
+ * great way to do things but it works out OK for the dpif providers and
+ * clients that exist so far.)
+ */
+struct dpif_upcall {
+ /* All types. */
+ enum dpif_upcall_type type;
+ struct ofpbuf *packet; /* Packet data. */
+ struct nlattr *key; /* Flow key. */
+ size_t key_len; /* Length of 'key' in bytes. */