session: disconnect and echo client improvements
[vpp.git] / src / vnet / mpls / mpls_lookup.c
index 4b8a3ee..30031e5 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <vlib/vlib.h>
 #include <vnet/pg/pg.h>
-#include <vnet/mpls/mpls.h>
+#include <vnet/mpls/mpls_lookup.h>
 #include <vnet/fib/mpls_fib.h>
 #include <vnet/dpo/load_balance_map.h>
 #include <vnet/dpo/replicate_dpo.h>
@@ -30,7 +30,7 @@ static vlib_node_registration_t mpls_lookup_node;
 /**
  * The arc/edge from the MPLS lookup node to the MPLS replicate node
  */
-static u32 mpls_lookup_to_replicate_edge;
+u32 mpls_lookup_to_replicate_edge;
 
 typedef struct {
   u32 next_index;
@@ -47,34 +47,16 @@ format_mpls_lookup_trace (u8 * s, va_list * args)
   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
   mpls_lookup_trace_t * t = va_arg (*args, mpls_lookup_trace_t *);
 
-  s = format (s, "MPLS: next [%d], lookup fib index %d, LB index %d hash %#x "
+  s = format (s, "MPLS: next [%d], lookup fib index %d, LB index %d hash %x "
               "label %d eos %d", 
               t->next_index, t->lfib_index, t->lb_index, t->hash,
               vnet_mpls_uc_get_label(
                   clib_net_to_host_u32(t->label_net_byte_order)),
-              vnet_mpls_uc_get_s(t->label_net_byte_order));
+              vnet_mpls_uc_get_s(
+                  clib_net_to_host_u32(t->label_net_byte_order)));
   return s;
 }
 
-/*
- * Compute flow hash. 
- * We'll use it to select which adjacency to use for this flow.  And other things.
- */
-always_inline u32
-mpls_compute_flow_hash (const mpls_unicast_header_t * hdr,
-                        flow_hash_config_t flow_hash_config)
-{
-    /*
-     * improve this to include:
-     *  - all labels in the stack.
-     *  - recognise entropy labels.
-     *
-     * We need to byte swap so we use the numerical value. i.e. an odd label
-     * leads to an odd bucket. ass opposed to a label above and below value X.
-     */
-    return (vnet_mpls_uc_get_label(clib_net_to_host_u32(hdr->label_exp_s_ttl)));
-}
-
 static inline uword
 mpls_lookup (vlib_main_t * vm,
              vlib_node_runtime_t * node,