PowerPC64-be arch support. Qemu ("qppc") platform support.

Change-Id: Ib0a05f9d1b08bacef09f6d7c101391737031ee0d
Signed-off-by: Dave Barach <dave@barachs.net>
diff --git a/vnet/vnet/devices/ssvm/node.c b/vnet/vnet/devices/ssvm/node.c
index fe53d11..b26d73d 100644
--- a/vnet/vnet/devices/ssvm/node.c
+++ b/vnet/vnet/devices/ssvm/node.c
@@ -94,6 +94,7 @@
   u32 trace_cnt __attribute__((unused)) = vlib_get_trace_count (vm, node);
   volatile u32 * lock;
   u32 * elt_indices;
+  uword n_trace = vlib_get_trace_count (vm, node);
 
   /* Either side down? buh-bye... */
   if ((u64)(sh->opaque [MASTER_ADMIN_STATE_INDEX]) == 0 ||
@@ -236,7 +237,19 @@
            */
           VLIB_BUFFER_TRACE_TRAJECTORY_INIT(b0);
 
-          /* $$$$ tracing */
+          if (PREDICT_FALSE(n_trace > 0))
+          {
+              ssvm_eth_input_trace_t *tr;
+              
+              vlib_trace_buffer (vm, node, next0,
+                                 b0, /* follow_chain */ 1);
+              vlib_set_trace_count (vm, node, --n_trace);
+
+              tr = vlib_add_trace (vm, node, b0, sizeof (*tr));
+
+              tr->next_index = next0;
+              tr->sw_if_index = intfc->vlib_hw_if_index;
+          }
 
           vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
                                            to_next, n_left_to_next,
diff --git a/vnet/vnet/lawful-intercept/lawful_intercept.c b/vnet/vnet/lawful-intercept/lawful_intercept.c
index bd3f33e..6b2f41f 100644
--- a/vnet/vnet/lawful-intercept/lawful_intercept.c
+++ b/vnet/vnet/lawful-intercept/lawful_intercept.c
@@ -13,6 +13,7 @@
  * limitations under the License.
  */
 
+#if DPDK==1
 #include <vnet/lawful-intercept/lawful_intercept.h>
 
 static clib_error_t *
@@ -109,3 +110,6 @@
 }
 
 VLIB_INIT_FUNCTION(li_init);
+#else
+#endif /* DPDK */
+
diff --git a/vnet/vnet/lawful-intercept/node.c b/vnet/vnet/lawful-intercept/node.c
index cc06649..8a47aa3 100644
--- a/vnet/vnet/lawful-intercept/node.c
+++ b/vnet/vnet/lawful-intercept/node.c
@@ -17,6 +17,7 @@
 #include <vnet/vnet.h>
 #include <vppinfra/error.h>
 
+#if DPDK==1
 #include <vnet/lawful-intercept/lawful_intercept.h>
 
 #include <vppinfra/error.h>
@@ -270,3 +271,38 @@
         [LI_HIT_NEXT_ETHERNET] = "ethernet-input-not-l2",
   },
 };
+
+#else
+#include <vlib/vlib.h>
+
+static uword
+li_hit_node_fn (vlib_main_t * vm,
+		  vlib_node_runtime_t * node,
+		  vlib_frame_t * frame)
+{
+  clib_warning ("LI not implemented (no DPDK)");
+  return 0;
+}
+
+VLIB_REGISTER_NODE (li_hit_node) = {
+  .vector_size = sizeof (u32),
+  .function = li_hit_node_fn,
+  .name = "li-hit",
+};
+
+VLIB_REGISTER_NODE (ipsec_output_node) = {
+  .vector_size = sizeof (u32),
+  .function = li_hit_node_fn,
+  .name = "ipsec-output",
+};
+
+static clib_error_t *
+li_init (vlib_main_t * vm)
+{
+  return 0;
+}
+
+VLIB_INIT_FUNCTION(li_init);
+
+
+#endif /* DPDK */
diff --git a/vnet/vnet/map/map.c b/vnet/vnet/map/map.c
index a63122b..3cf5e69 100644
--- a/vnet/vnet/map/map.c
+++ b/vnet/vnet/map/map.c
@@ -17,6 +17,17 @@
 
 #include "map.h"
 
+#ifdef __powerpc64__
+#include <vppinfra/xxhash.h>
+
+static inline u32
+crc_u32(u32 data, u32 value)
+{
+  u64 tmp = ((u64)data<<32) | (u64) value;
+  return (u32) clib_xxhash(tmp);
+}
+#endif
+
 /*
  * This code supports the following MAP modes:
  * 
diff --git a/vnet/vnet/policer/fix_types.h b/vnet/vnet/policer/fix_types.h
index cbb79e0..71a4173 100644
--- a/vnet/vnet/policer/fix_types.h
+++ b/vnet/vnet/policer/fix_types.h
@@ -28,4 +28,8 @@
 typedef unsigned short int uint16_t;
 typedef unsigned int uint32_t;
 
+#ifdef __powerpc64__
+typedef unsigned long uint64_t;
+#endif
+
 #endif /* __included_fix_types_h__ */
diff --git a/vnet/vnet/vcgn/vcgn_classify.c b/vnet/vnet/vcgn/vcgn_classify.c
index 518f910..5574f80 100644
--- a/vnet/vnet/vcgn/vcgn_classify.c
+++ b/vnet/vnet/vcgn/vcgn_classify.c
@@ -397,7 +397,9 @@
   mp->inside_sw_if_index = 1;
   mp->outside_sw_if_index = 0;
 
+#if DPDK==1
   dpdk_set_next_node (DPDK_RX_NEXT_IP4_INPUT, "vcgn-classify");
+#endif
 
   {
     pg_node_t * pn;