summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-06-30 08:46:24 -0400
committerDave Barach <dave@barachs.net>2017-06-30 09:12:43 -0400
commit85e5b8da28b522ea7a88275f066d127c20eff171 (patch)
tree30951bdbd94532d95c0e6cb9771550a983319942
parentf45bc738aaf6bdaff59840932daf546187e38c33 (diff)
VPP-893: handle multiple simultaneous event registrations
Change-Id: I8cd90820624987dbef848935e2de86fa66a86c17 Signed-off-by: Dave Barach <dave@barachs.net>
-rw-r--r--src/vppinfra/elog.c7
-rw-r--r--src/vppinfra/elog.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/vppinfra/elog.c b/src/vppinfra/elog.c
index 12e3f5d4bd8..182ca127b12 100644
--- a/src/vppinfra/elog.c
+++ b/src/vppinfra/elog.c
@@ -108,6 +108,13 @@ elog_event_type_register (elog_main_t * em, elog_event_type_t * t)
elog_lock (em);
+ /* Multiple simultaneous registration attempts, */
+ if (t->type_index_plus_one > 0)
+ {
+ elog_unlock (em);
+ return t->type_index_plus_one - 1;
+ }
+
l = vec_len (em->event_types);
t->type_index_plus_one = 1 + l;
diff --git a/src/vppinfra/elog.h b/src/vppinfra/elog.h
index 359868dd0f0..05085b264df 100644
--- a/src/vppinfra/elog.h
+++ b/src/vppinfra/elog.h
@@ -309,7 +309,6 @@ elog_event_data_inline (elog_main_t * em,
track_index = elog_track_register (em, track);
}
- ASSERT (type_index < vec_len (em->event_types));
ASSERT (track_index < vec_len (em->tracks));
ASSERT (is_pow2 (vec_len (em->event_ring)));