components/openvswitch/patches/03-dpif-provider.patch
author Jesse Butler <jesse.butler@oracle.com>
Mon, 17 Oct 2016 16:13:44 -0700
changeset 7118 42f3be2cf0ae
parent 5730 cca4aa297e68
child 7412 49c812f3de0b
permissions -rw-r--r--
24667343 create-base-image leaves behind Dockerfile 24667392 create-base-image should build in a temp directory

This patch includes support for the Solaris dpif provider.

This patch has not been proposed upstream because we are not yet
proposing Solaris specific requirements upstream.

diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h
index 389e84e..5f2d50a 100644
--- a/lib/dpif-provider.h
+++ b/lib/dpif-provider.h
@@ -439,6 +439,7 @@ struct dpif_class {
 };
 
 extern const struct dpif_class dpif_linux_class;
+extern const struct dpif_class dpif_solaris_class;
 extern const struct dpif_class dpif_netdev_class;
 
 #ifdef  __cplusplus
diff --git a/lib/dpif.c b/lib/dpif.c
index 450c6c8..337cf4b 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -60,6 +60,9 @@ static const struct dpif_class *base_dpif_classes[] = {
 #ifdef __linux__
     &dpif_linux_class,
 #endif
+#ifdef __sun
+    &dpif_solaris_class,
+#endif
     &dpif_netdev_class,
 };
 
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 9b87248..656e6b1 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1469,7 +1469,7 @@ run(struct ofproto *ofproto_)
 }
 
 static void
-wait(struct ofproto *ofproto_)
+dpwait(struct ofproto *ofproto_)
 {
     struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
 
@@ -4946,7 +4946,7 @@ const struct ofproto_class ofproto_dpif_class = {
     destruct,
     dealloc,
     run,
-    wait,
+    dpwait,
     NULL,                       /* get_memory_usage. */
     type_get_memory_usage,
     flush,
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 028e7e0..62e0cf1 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -3236,6 +3236,7 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout)
     fat_rwlock_unlock(&xlate_rwlock);
 }
 
+#ifdef __linux__
 /* Returns the maximum number of packets that the Linux kernel is willing to
  * queue up internally to certain kinds of software-implemented ports, or the
  * default (and rarely modified) value if it cannot be determined. */
@@ -3288,7 +3289,9 @@ count_output_actions(const struct ofpbuf *odp_actions)
     }
     return n;
 }
+#endif
 
+#ifdef __linux__
 /* Returns true if 'odp_actions' contains more output actions than the datapath
  * can reliably handle in one go.  On Linux, this is the value of the
  * net.core.netdev_max_backlog sysctl, which limits the maximum number of
@@ -3297,15 +3300,19 @@ count_output_actions(const struct ofpbuf *odp_actions)
 static bool
 too_many_output_actions(const struct ofpbuf *odp_actions)
 {
-#ifdef __linux__
     return (ofpbuf_size(odp_actions) / NL_A_U32_SIZE > netdev_max_backlog()
             && count_output_actions(odp_actions) > netdev_max_backlog());
+}
 #else
+static bool
+too_many_output_actions(const struct ofpbuf *odp_actions OVS_UNUSED)
+{
+
     /* OSes other than Linux might have similar limits, but we don't know how
      * to determine them.*/
     return false;
-#endif
 }
+#endif
 
 /* Translates the 'ofpacts_len' bytes of "struct ofpacts" starting at 'ofpacts'
  * into datapath actions in 'odp_actions', using 'ctx'.