ipsec: IPSec interface correct drop w/ no protection
[vpp.git] / src / vnet / dpo / receive_dpo.c
index 2b2571c..0a97e1d 100644 (file)
  */
 receive_dpo_t *receive_dpo_pool;
 
+int
+dpo_is_receive (const dpo_id_t *dpo)
+{
+    return (dpo->dpoi_type == DPO_RECEIVE);
+}
+
 static receive_dpo_t *
 receive_dpo_alloc (void)
 {
     receive_dpo_t *rd;
+    vlib_main_t *vm;
+    u8 did_barrier_sync;
 
+    dpo_pool_barrier_sync (vm, receive_dpo_pool, did_barrier_sync);
     pool_get_aligned(receive_dpo_pool, rd, CLIB_CACHE_LINE_BYTES);
-    memset(rd, 0, sizeof(*rd));
+    dpo_pool_barrier_release (vm, did_barrier_sync);
+
+    clib_memset(rd, 0, sizeof(*rd));
 
     return (rd);
 }
@@ -102,6 +113,11 @@ format_receive_dpo (u8 *s, va_list *ap)
     vnet_main_t * vnm = vnet_get_main();
     receive_dpo_t *rd;
 
+    if (pool_is_free_index(receive_dpo_pool, index))
+    {
+        return (format(s, "dpo-receive DELETED"));
+    }
+
     rd = receive_dpo_get(index);
 
     if (~0 != rd->rd_sw_if_index)
@@ -140,15 +156,13 @@ const static dpo_vft_t receive_vft = {
  * this means that these graph nodes are ones from which a receive is the
  * parent object in the DPO-graph.
  */
-const static char* const receive_ip4_nodes[] =
-{
-    "ip4-local",
-    NULL,
+const static char *const receive_ip4_nodes[] = {
+  "ip4-receive",
+  NULL,
 };
-const static char* const receive_ip6_nodes[] =
-{
-    "ip6-local",
-    NULL,
+const static char *const receive_ip6_nodes[] = {
+  "ip6-receive",
+  NULL,
 };
 
 const static char* const * const receive_nodes[DPO_PROTO_NUM] =