[ovs-dev] [PATCH 1/5] dpif: Introduce ofproto flow lookup function.

Pravin pshelar at nicira.com
Thu Mar 27 16:44:18 UTC 2014


This patch does not change any functionality.

Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
---
 lib/dpif.c |    5 +++++
 lib/dpif.h |   23 +++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/lib/dpif.c b/lib/dpif.c
index 6649176..dc1e8c0 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -56,6 +56,11 @@ COVERAGE_DEFINE(dpif_execute);
 COVERAGE_DEFINE(dpif_purge);
 COVERAGE_DEFINE(dpif_execute_with_help);
 
+int
+(*fn_ofproto_flow_lookup)(const void *data, struct ofpbuf *packet,
+                     struct flow *flow,
+                     struct flow_wildcards *wc, struct ofpbuf *odp_actions);
+
 static const struct dpif_class *base_dpif_classes[] = {
 #ifdef __linux__
     &dpif_linux_class,
diff --git a/lib/dpif.h b/lib/dpif.h
index e7aca8e..7c6a241 100644
--- a/lib/dpif.h
+++ b/lib/dpif.h
@@ -653,6 +653,29 @@ void dpif_get_netflow_ids(const struct dpif *,
 int dpif_queue_to_priority(const struct dpif *, uint32_t queue_id,
                            uint32_t *priority);
 
+/* Classifier lookup callback.
+ *
+ * ofproto layer can set miss upcall handler for dpif implementation to
+ * use.  dpif-implementation can use this callback to lookup a flow.
+ * This way dipf can avoid asynchronous flow-miss handling and can
+ * handle flow-table-miss in same thread.
+ *
+ * 'data' is handle_miss_data passed to dpif-open call.
+ * 'packet' packet received.
+ * 'flow' flow corresponding to packet.
+ *
+ * On success lookup callback function returns 0 and populate *wc and odp_actions.
+ *
+ * ofproto layer should prepare to accept callback immediately after setting
+ * this pointer.
+ * To keep it simple no locks should be held by dpif-implementation over
+ * this call invocation. */
+
+extern int
+(*fn_ofproto_flow_lookup)(const void *data, struct ofpbuf *packet,
+                          struct flow *flow,
+                          struct flow_wildcards *wc, struct ofpbuf *odp_actions);
+
 #ifdef  __cplusplus
 }
 #endif
-- 
1.7.9.5




More information about the dev mailing list