X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fbier%2Fbier_lookup.c;h=f7a21a1c744c845674725a546c6c20863dfddc50;hb=77100efb37f7cb333f9ab55dc206bf1431e3ae50;hp=51011c980083587b1b8febb3d694f977b6360cd0;hpb=bd0da97e5ac0f84e1ea8e6e7f9549dd4e1a6a4ab;p=vpp.git diff --git a/src/vnet/bier/bier_lookup.c b/src/vnet/bier/bier_lookup.c index 51011c98008..f7a21a1c744 100644 --- a/src/vnet/bier/bier_lookup.c +++ b/src/vnet/bier/bier_lookup.c @@ -22,7 +22,7 @@ #include /** - * Struct maintining the per-worker thread data for BIER lookups + * Struct maintaining the per-worker thread data for BIER lookups */ typedef struct bier_lookup_main_t_ { @@ -44,7 +44,7 @@ static char * bier_lookup_error_strings[] = { }; /* - * Keep these values sematically the same as BIER lookup + * Keep these values semantically the same as BIER lookup */ #define foreach_bier_lookup_next \ _(DROP, "bier-drop") \ @@ -67,7 +67,7 @@ typedef enum { vlib_node_registration_t bier_lookup_node; /** - * @brief Packet trace recoed for a BIER lookup + * @brief Packet trace record for a BIER lookup */ typedef struct bier_lookup_trace_t_ { @@ -147,10 +147,9 @@ bier_lookup (vlib_main_t * vm, memcpy(bbs.bbs_buckets, bh0->bh_bit_string, bbs.bbs_len); /* - * reset the fmask and clone storage vectors + * reset the fmask storage vector */ vec_reset_length (blm->blm_fmasks[thread_index]); - vec_reset_length (blm->blm_clones[thread_index]); /* * Loop through the buckets in the header @@ -220,13 +219,16 @@ bier_lookup (vlib_main_t * vm, if (PREDICT_TRUE(0 != n_clones)) { + vec_set_len(blm->blm_clones[thread_index], n_clones); num_cloned = vlib_buffer_clone(vm, bi0, blm->blm_clones[thread_index], n_clones, VLIB_BUFFER_CLONE_HEAD_SIZE); - if (num_cloned != vec_len(blm->blm_fmasks[thread_index])) + + if (num_cloned != n_clones) { + vec_set_len(blm->blm_clones[thread_index], num_cloned); vlib_node_increment_counter (vm, node->node_index, BIER_LOOKUP_ERROR_BUFFER_ALLOCATION_FAILURE, 1); @@ -250,9 +252,6 @@ bier_lookup (vlib_main_t * vm, { bier_lookup_trace_t *tr; - if (c0 != b0) - vlib_buffer_copy_trace_flag (vm, b0, ci0); - tr = vlib_add_trace (vm, node, c0, sizeof (*tr)); tr->bt_index = bti0; tr->bfm_index = blm->blm_fmasks[thread_index][clone];