X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdpo%2Freceive_dpo.c;h=0a97e1d373bc3cadd25311ad1d8fad1106c06683;hb=49378f206b8e780a898e632f7dd8db912b9b118e;hp=2b2571c6c831b792d9e27e08a6917c096ee5928f;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vnet/dpo/receive_dpo.c b/src/vnet/dpo/receive_dpo.c index 2b2571c6c83..0a97e1d373b 100644 --- a/src/vnet/dpo/receive_dpo.c +++ b/src/vnet/dpo/receive_dpo.c @@ -25,13 +25,24 @@ */ 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] =