session: handle multiple attempts to mark mq congested
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iadc6ec58f5fc7fbff62e4fd31d509557b60395cb
diff --git a/src/vnet/session/application_worker.c b/src/vnet/session/application_worker.c
index befdb7c..43007ad 100644
--- a/src/vnet/session/application_worker.c
+++ b/src/vnet/session/application_worker.c
@@ -836,9 +836,12 @@
void
app_worker_set_mq_wrk_congested (app_worker_t *app_wrk, u32 thread_index)
{
- clib_atomic_fetch_add_relax (&app_wrk->mq_congested, 1);
ASSERT (thread_index == vlib_get_thread_index ());
- app_wrk->wrk_mq_congested[thread_index] = 1;
+ if (!app_wrk->wrk_mq_congested[thread_index])
+ {
+ clib_atomic_fetch_add_relax (&app_wrk->mq_congested, 1);
+ app_wrk->wrk_mq_congested[thread_index] = 1;
+ }
}
void