Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
bier: fix vector size confusing ASan
[vpp.git]
/
src
/
vnet
/
bier
/
bier_lookup.c
diff --git
a/src/vnet/bier/bier_lookup.c
b/src/vnet/bier/bier_lookup.c
index
4e544a3
..
f7a21a1
100644
(file)
--- a/
src/vnet/bier/bier_lookup.c
+++ b/
src/vnet/bier/bier_lookup.c
@@
-22,7
+22,7
@@
#include <vnet/bier/bier_fmask.h>
/**
#include <vnet/bier/bier_fmask.h>
/**
- * Struct maintining the per-worker thread data for BIER lookups
+ * Struct maint
a
ining the per-worker thread data for BIER lookups
*/
typedef struct bier_lookup_main_t_
{
*/
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 sema
n
tically the same as BIER lookup
*/
#define foreach_bier_lookup_next \
_(DROP, "bier-drop") \
*/
#define foreach_bier_lookup_next \
_(DROP, "bier-drop") \
@@
-67,7
+67,7
@@
typedef enum {
vlib_node_registration_t bier_lookup_node;
/**
vlib_node_registration_t bier_lookup_node;
/**
- * @brief Packet trace reco
e
d for a BIER lookup
+ * @brief Packet trace reco
r
d for a BIER lookup
*/
typedef struct bier_lookup_trace_t_
{
*/
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);
/*
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_fmasks[thread_index]);
- vec_reset_length (blm->blm_clones[thread_index]);
/*
* Loop through the buckets in the header
/*
* Loop through the buckets in the header
@@
-220,13
+219,16
@@
bier_lookup (vlib_main_t * vm,
if (PREDICT_TRUE(0 != n_clones))
{
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,
num_cloned = vlib_buffer_clone(vm, bi0,
blm->blm_clones[thread_index],
n_clones,
-
n_bytes + 8
);
+
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);
vlib_node_increment_counter
(vm, node->node_index,
BIER_LOOKUP_ERROR_BUFFER_ALLOCATION_FAILURE, 1);
@@
-250,12
+252,9
@@
bier_lookup (vlib_main_t * vm,
{
bier_lookup_trace_t *tr;
{
bier_lookup_trace_t *tr;
- vlib_trace_buffer (vm, node, next0, c0, 0);
tr = vlib_add_trace (vm, node, c0, sizeof (*tr));
tr->bt_index = bti0;
tr->bfm_index = blm->blm_fmasks[thread_index][clone];
tr = vlib_add_trace (vm, node, c0, sizeof (*tr));
tr->bt_index = bti0;
tr->bfm_index = blm->blm_fmasks[thread_index][clone];
-
- c0->flags |= VLIB_BUFFER_IS_TRACED;
}
vlib_validate_buffer_enqueue_x1(vm, node, next_index,
}
vlib_validate_buffer_enqueue_x1(vm, node, next_index,