components/openvswitch/patches/03-dpif-provider.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Sat, 14 Jan 2017 13:51:41 -0800
changeset 7578 0d6f61408e89
parent 7412 49c812f3de0b
permissions -rw-r--r--
25395691 cannot install new pulseaudio package with de_CH enabled (fix pkgfmt)

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'.
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 193e6b7..23cfa4d 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -997,8 +997,11 @@ handle_upcalls(struct handler *handler, struct hmap *misses,
             struct ofpbuf mask;
             bool megaflow;
 
-            miss->put = true;
+#ifdef __sun
+            if (miss->xout.nf_output_iface != NF_OUT_FLOOD) {
+#endif
 
+            miss->put = true;
             atomic_read(&enable_megaflows, &megaflow);
             ofpbuf_use_stack(&mask, &miss->mask_buf, sizeof miss->mask_buf);
             if (megaflow) {
@@ -1031,6 +1034,11 @@ handle_upcalls(struct handler *handler, struct hmap *misses,
                 op->u.flow_put.actions = ofpbuf_data(&buf);
                 op->u.flow_put.actions_len = ofpbuf_size(&buf);
             }
+#ifdef __sun
+            } else {
+                VLOG_DBG("handle_upcalls flush action, do not flow_put");
+            }
+#endif
         }
 
         /*