session tcp udp: consolidate transport snd apis

Type: improvement

Use only one api to retrieve transport send parameters. Additionally,
allow transports to request postponing and descheduling of events.

With this, tcp now requests descheduling of sessions when the
connections are stuck probing for zero snd_wnd

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I722c974f3e68fa15424c519a1fffacda43af050c
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index c8c5835..e27aaf3 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -103,6 +103,8 @@
       indent = format_get_indent (s) + 1;
       s = format (s, "%Upacer: %U\n", format_white_space, indent,
 		  format_transport_pacer, &tc->pacer, tc->thread_index);
+      s = format (s, "%Utransport: flags 0x%x\n", format_white_space, indent,
+		  tc->flags);
     }
   return s;
 }
@@ -720,6 +722,22 @@
 }
 
 void
+transport_connection_reschedule (transport_connection_t * tc)
+{
+  tc->flags &= ~TRANSPORT_CONNECTION_F_DESCHED;
+  if (transport_max_tx_dequeue (tc))
+    sesssion_reschedule_tx (tc);
+  else
+    {
+      session_t *s = session_get (tc->s_index, tc->thread_index);
+      svm_fifo_unset_event (s->tx_fifo);
+      if (svm_fifo_max_dequeue_cons (s->tx_fifo))
+	if (svm_fifo_set_event (s->tx_fifo))
+	  sesssion_reschedule_tx (tc);
+    }
+}
+
+void
 transport_update_time (clib_time_type_t time_now, u8 thread_index)
 {
   transport_proto_vft_t *vft;