session: unset fifo event before reading fifo size 11/9511/1
authorFlorin Coras <fcoras@cisco.com>
Tue, 21 Nov 2017 12:20:42 +0000 (04:20 -0800)
committerFlorin Coras <fcoras@cisco.com>
Tue, 21 Nov 2017 12:49:22 +0000 (04:49 -0800)
Change-Id: Ic32a76e5f7c48fd52f2e93ee18ba23fb6ad1b855
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/session/session_node.c

index bc24d95..7811617 100644 (file)
@@ -168,6 +168,9 @@ session_tx_fifo_read_and_snd_i (vlib_main_t * vm, vlib_node_runtime_t * node,
       return 0;
     }
 
+  /* Allow enqueuing of a new event */
+  svm_fifo_unset_event (s0->server_tx_fifo);
+
   /* Check how much we can pull. */
   max_dequeue0 = svm_fifo_max_dequeue (s0->server_tx_fifo);
 
@@ -183,10 +186,7 @@ session_tx_fifo_read_and_snd_i (vlib_main_t * vm, vlib_node_runtime_t * node,
 
   /* Nothing to read return */
   if (max_dequeue0 == 0)
-    {
-      svm_fifo_unset_event (s0->server_tx_fifo);
-      return 0;
-    }
+    return 0;
 
   /* Ensure we're not writing more than transport window allows */
   if (max_dequeue0 < snd_space0)
@@ -249,8 +249,6 @@ session_tx_fifo_read_and_snd_i (vlib_main_t * vm, vlib_node_runtime_t * node,
            }
          ASSERT (n_bufs >= n_bufs_per_frame);
        }
-      /* Allow enqueuing of a new event */
-      svm_fifo_unset_event (s0->server_tx_fifo);
 
       vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
       while (left_to_snd0 && n_left_to_next)