session: limit max number of ct sessions per dispatch 82/28582/3
authorFlorin Coras <fcoras@cisco.com>
Wed, 26 Aug 2020 02:07:02 +0000 (19:07 -0700)
committerDave Barach <openvpp@barachs.net>
Thu, 27 Aug 2020 10:35:48 +0000 (10:35 +0000)
Type: improvement

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

src/vnet/session/application_local.c

index decff4e..cea22e3 100644 (file)
@@ -587,11 +587,14 @@ ct_session_tx (session_t * s)
   ct = (ct_connection_t *) session_get_transport (s);
   peer_ct = ct_connection_get (ct->peer_index);
   if (!peer_ct)
-    return -1;
+    return 0;
   peer_s = session_get (peer_ct->c_s_index, 0);
   if (peer_s->session_state >= SESSION_STATE_TRANSPORT_CLOSING)
     return 0;
-  return session_enqueue_notify (peer_s);
+  session_enqueue_notify (peer_s);
+  /* 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;
 }
 
 static clib_error_t *