session: move svm_fifo_clear_deq_ntf to before calling the app callback 34/21634/2
authorVladimir Kropylev <vladimir.kropylev@enea.com>
Fri, 30 Aug 2019 10:04:06 +0000 (13:04 +0300)
committerFlorin Coras <florin.coras@gmail.com>
Fri, 30 Aug 2019 14:23:22 +0000 (14:23 +0000)
Type: fix

in case the app requests another dequeue notification, it should not be cleared

Change-Id: I7e94e8e30ef098f87f5e7f4880af276970ee5b37
Signed-off-by: Vladimir Kropylev <vladimir.kropylev@enea.com>
src/vnet/session/session.c

index a27e80e..1010f05 100644 (file)
@@ -604,6 +604,8 @@ session_dequeue_notify (session_t * s)
 {
   app_worker_t *app_wrk;
 
+  svm_fifo_clear_deq_ntf (s->tx_fifo);
+
   app_wrk = app_worker_get_if_valid (s->app_wrk_index);
   if (PREDICT_FALSE (!app_wrk))
     return -1;
@@ -616,8 +618,6 @@ session_dequeue_notify (session_t * s)
     return session_notify_subscribers (app_wrk->app_index, s,
                                       s->tx_fifo, SESSION_IO_EVT_TX);
 
-  svm_fifo_clear_deq_ntf (s->tx_fifo);
-
   return 0;
 }