fib: Support the POP of a Psuedo Wire Control Word
[vpp.git] / src / vnet / dpo / dpo.c
index 83eb6f1..d5865d1 100644 (file)
@@ -16,9 +16,9 @@
  * @brief
  * A Data-Path Object is an object that represents actions that are
  * applied to packets are they are switched through VPP.
- * 
+ *
  * The DPO is a base class that is specialised by other objects to provide
- * concreate actions
+ * concrete actions
  *
  * The VLIB graph nodes are graph of types, the DPO graph is a graph of instances.
  */
@@ -43,6 +43,7 @@
 #include <vnet/dpo/dvr_dpo.h>
 #include <vnet/dpo/l3_proxy_dpo.h>
 #include <vnet/dpo/ip6_ll_dpo.h>
+#include <vnet/dpo/pw_cw.h>
 
 /**
  * Array of char* names for the DPO types and protos
@@ -78,7 +79,7 @@ static const char* const * const ** dpo_nodes;
  * the third dimension in dpo_nodes is lost, hence, the edge index from each
  * node MUST be the same.
  * Including both the child and parent protocol is required to support the
- * case where it changes as the grapth is traversed, most notablly when an
+ * case where it changes as the graph is traversed, most notably when an
  * MPLS label is popped.
  *
  * Note that this array is child type specific, not child instance specific.
@@ -86,7 +87,7 @@ static const char* const * const ** dpo_nodes;
 static u32 ****dpo_edges;
 
 /**
- * @brief The DPO type value that can be assigend to the next dynamic
+ * @brief The DPO type value that can be assigned to the next dynamic
  *        type registration.
  */
 static dpo_type_t dpo_dynamic = DPO_LAST;
@@ -267,10 +268,10 @@ dpo_copy (dpo_id_t *dst,
      * the destination is written in a single u64 write - hence atomically w.r.t
      * any packets inflight.
      */
-    *((u64*)dst) = *(u64*)src; 
+    *((u64*)dst) = *(u64*)src;
 
     dpo_lock(dst);
-    dpo_unlock(&tmp);    
+    dpo_unlock(&tmp);
 }
 
 int
@@ -408,7 +409,7 @@ dpo_get_next_node (dpo_type_t child_type,
         parent_proto, ~0);
 
     /*
-     * if the edge index has not yet been created for this node to node transistion
+     * if the edge index has not yet been created for this node to node transition
      */
     if (~0 == dpo_edges[child_type][child_proto][parent_type][parent_proto])
     {
@@ -494,7 +495,7 @@ dpo_stack_i (u32 edge,
     dpo_copy(&tmp, parent);
 
     /*
-     * get the edge index for the parent to child VLIB graph transisition
+     * get the edge index for the parent to child VLIB graph transition
      */
     tmp.dpoi_next_node = edge;
 
@@ -588,11 +589,17 @@ dpo_module_init (vlib_main_t * vm)
     mpls_disp_dpo_module_init();
     dvr_dpo_module_init();
     l3_proxy_dpo_module_init();
+    pw_cw_dpo_module_init();
 
     return (NULL);
 }
 
-VLIB_INIT_FUNCTION(dpo_module_init);
+/* *INDENT-OFF* */
+VLIB_INIT_FUNCTION(dpo_module_init) =
+{
+    .runs_before = VLIB_INITS ("ip_main_init"),
+};
+/* *INDENT-ON* */
 
 static clib_error_t *
 dpo_memory_show (vlib_main_t * vm,