session: clear ct fifo flag prior to notification 41/30941/3
authorFlorin Coras <fcoras@cisco.com>
Tue, 26 Jan 2021 22:10:43 +0000 (14:10 -0800)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 26 Jan 2021 22:11:01 +0000 (22:11 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6db15780d87426eee852aa020c50cbdf45dc1f95

src/vnet/session/application_local.c

index 18e26f2..478fc7a 100644 (file)
@@ -520,13 +520,14 @@ ct_custom_tx (void *session, transport_send_params_t * sp)
   session_t *s = (session_t *) session;
   if (session_has_transport (s))
     return 0;
-  /* If event enqueued towards peer, remove from scheduler and
-   * remove session tx flag, i.e., accept new tx events */
+  /* If event enqueued towards peer, remove from scheduler and remove
+   * session tx flag, i.e., accept new tx events. Unset fifo flag now to
+   * avoid missing events if peer did not clear fifo flag yet, which is
+   * interpreted as successful notification and session is descheduled. */
+  svm_fifo_unset_event (s->tx_fifo);
   if (!ct_session_tx (s))
-    {
-      sp->flags = TRANSPORT_SND_F_DESCHED;
-      svm_fifo_unset_event (s->tx_fifo);
-    }
+    sp->flags = TRANSPORT_SND_F_DESCHED;
+
   /* The scheduler uses packet count as a means of upper bounding the amount
    * of work done per dispatch. So make it look like we have sent something */
   return 1;