tcp: consume incoming buffers instead of reusing

Instead of reusing buffers for acking, consume all buffers and program
output for (dup)ack generation. This implicitly fixes the drop counters
that were artificially inflated by both data and feedback traffic.

Moreover, the patch also significantly reduces the ack traffic as we now
only generate an ack per frame, unless duplicate acks need to be sent.

Because of the reduced feedback traffic, a sender's rx path and a
receiver's tx path are now significantly less loaded. In particular, a
sender can overwhelm a 40Gbps NIC and generate tx drop bursts for low
rtts. Consequently, tx pacing is now enforced by default.

Change-Id: I619c29a8945bf26c093f8f9e197e3c6d5d43868e
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index 3bdf6c9..35c8fb4 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -524,6 +524,13 @@
   return s->server_tx_fifo->nitems;
 }
 
+always_inline u8
+transport_rx_fifo_has_ooo_data (transport_connection_t * tc)
+{
+  stream_session_t *s = session_get (tc->c_index, tc->thread_index);
+  return svm_fifo_has_ooo_data (s->server_rx_fifo);
+}
+
 always_inline f64
 transport_dispatch_period (u32 thread_index)
 {