Adjacency layout change and move to vnet/adj
[vpp.git] / src / vnet / adj / adj.c
index f3d483a..7cf9e9d 100644 (file)
 #include <vnet/adj/adj_mcast.h>
 #include <vnet/fib/fib_node_list.h>
 
-/*
- * Special Adj with index zero. we need to define this since the v4 mtrie
- * assumes an index of 0 implies the ply is empty. therefore all 'real'
- * adjs need a non-zero index.
- */
-static ip_adjacency_t *special_v4_miss_adj_with_index_zero;
-
 /* Adjacency packet/byte counters indexed by adjacency index. */
 vlib_combined_counter_main_t adjacency_counters;
 
@@ -55,7 +48,7 @@ adj_alloc (fib_protocol_t proto)
 {
     ip_adjacency_t *adj;
 
-    pool_get(adj_pool, adj);
+    pool_get_aligned(adj_pool, adj, CLIB_CACHE_LINE_BYTES);
 
     adj_poison(adj);
 
@@ -65,7 +58,6 @@ adj_alloc (fib_protocol_t proto)
                                    adj_get_index(adj));
 
     adj->rewrite_header.sw_if_index = ~0;
-    adj->n_adj = 1;
     adj->lookup_next_index = 0;
 
     fib_node_init(&adj->ia_node,
@@ -360,7 +352,7 @@ adj_get_sw_if_index (adj_index_t ai)
 }
 
 /**
- * @brief Return the link type of the adjacency
+ * @brief Return the rewrite string of the adjacency
  */
 const u8*
 adj_get_rewrite (adj_index_t ai)
@@ -426,11 +418,6 @@ adj_module_init (vlib_main_t * vm)
     adj_midchain_module_init();
     adj_mcast_module_init();
 
-    /*
-     * one special adj to reserve index 0
-     */
-    special_v4_miss_adj_with_index_zero = adj_alloc(FIB_PROTOCOL_IP4);
-
     return (NULL);
 }