session: improve use of session handles
[vpp.git] / src / vcl / vcl_private.h
index 8345e34..b89052f 100644 (file)
@@ -159,8 +159,8 @@ typedef struct vcl_session_
   svm_fifo_t *ct_tx_fifo;
   vcl_session_msg_t *accept_evts_fifo;
 
-  u64 vpp_handle;
-  u64 parent_handle;
+  session_handle_t vpp_handle;
+  session_handle_t parent_handle;
   u32 listener_index;          /**< index of parent listener (if any) */
   int n_accepted_sessions;     /**< sessions accepted by this listener */
   vppcom_epoll_t vep;
@@ -675,7 +675,11 @@ vcl_session_add_want_deq_ntf (vcl_session_t *s, svm_fifo_deq_ntf_t evt)
 {
   svm_fifo_t *txf = vcl_session_is_ct (s) ? s->ct_tx_fifo : s->tx_fifo;
   if (txf)
-    svm_fifo_add_want_deq_ntf (txf, evt);
+    {
+      svm_fifo_add_want_deq_ntf (txf, evt);
+      /* Request tx notification only if 3% of fifo is empty */
+      svm_fifo_set_deq_thresh (txf, 0.03 * svm_fifo_size (txf));
+    }
 }
 
 static inline void