session tcp: handle rxt and acks as custom events
[vpp.git] / src / vnet / tcp / tcp.h
index a13a30d..8f2665d 100644 (file)
@@ -183,6 +183,7 @@ typedef struct _sack_scoreboard
   u32 high_rxt;                                /**< Highest retransmitted sequence */
   u32 rescue_rxt;                      /**< Rescue sequence number */
   u32 lost_bytes;                      /**< Bytes lost as per RFC6675 */
+  u32 last_lost_bytes;                 /**< Number of bytes last lost */
   u32 cur_rxt_hole;                    /**< Retransmitting from this hole */
 
 #if TCP_SCOREBOARD_TRACE
@@ -248,18 +249,24 @@ typedef struct tcp_bt_sample_
   u32 prev;                    /**< Previous sample index in list */
   u32 min_seq;                 /**< Min seq number in sample */
   u32 max_seq;                 /**< Max seq number. Set for rxt samples */
-  u64 delivered;               /**< Total delivered when sample taken */
+  u64 delivered;               /**< Total delivered bytes for sample */
   f64 delivered_time;          /**< Delivered time when sample taken */
+  f64 tx_time;                 /**< Transmit time for the burst */
   u64 tx_rate;                 /**< Tx pacing rate */
   tcp_bts_flags_t flags;       /**< Sample flag */
 } tcp_bt_sample_t;
 
 typedef struct tcp_rate_sample_
 {
-  u64 sample_delivered;                /**< Delivered of sample used for rate */
-  u32 delivered;               /**< Bytes delivered in ack time */
-  f64 ack_time;                        /**< Time to ack the bytes delivered */
+  u64 prior_delivered;         /**< Delivered of sample used for rate, i.e.,
+                                    total bytes delivered at prior_time */
+  f64 prior_time;              /**< Delivered time of sample used for rate */
+  f64 interval_time;           /**< Time to ack the bytes delivered */
+  f64 rtt_time;                        /**< RTT for sample */
   u64 tx_rate;                 /**< Tx pacing rate */
+  u32 delivered;               /**< Bytes delivered in interval_time */
+  u32 acked_and_sacked;                /**< Bytes acked + sacked now */
+  u32 lost;                    /**< Bytes lost now */
   tcp_bts_flags_t flags;       /**< Rate sample flags from bt sample */
 } tcp_rate_sample_t;
 
@@ -457,21 +464,9 @@ typedef struct tcp_worker_ctx_
   /** tx frames for ip 4/6 lookup nodes */
   vlib_frame_t *ip_lookup_tx_frames[2];
 
-  /** vector of connections needing fast rxt */
-  u32 *pending_fast_rxt;
-
-  /** vector of connections now doing fast rxt */
-  u32 *ongoing_fast_rxt;
-
-  /** vector of connections that will do fast rxt */
-  u32 *postponed_fast_rxt;
-
   /** vector of pending ack dequeues */
   u32 *pending_deq_acked;
 
-  /** vector of pending acks */
-  u32 *pending_acks;
-
   /** vector of pending disconnect notifications */
   u32 *pending_disconnects;
 
@@ -693,15 +688,12 @@ void tcp_update_burst_snd_vars (tcp_connection_t * tc);
 void tcp_update_rto (tcp_connection_t * tc);
 void tcp_flush_frame_to_output (tcp_worker_ctx_t * wrk, u8 is_ip4);
 void tcp_flush_frames_to_output (tcp_worker_ctx_t * wrk);
-void tcp_program_fastretransmit (tcp_worker_ctx_t * wrk,
-                                tcp_connection_t * tc);
-void tcp_do_fastretransmits (tcp_worker_ctx_t * wrk);
-
-void tcp_program_ack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc);
-void tcp_program_dupack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc);
-void tcp_send_acks (tcp_worker_ctx_t * wrk);
 void tcp_send_window_update_ack (tcp_connection_t * tc);
 
+void tcp_program_ack (tcp_connection_t * tc);
+void tcp_program_dupack (tcp_connection_t * tc);
+void tcp_program_fastretransmit (tcp_connection_t * tc);
+
 /*
  * Rate estimation
  */
@@ -954,6 +946,7 @@ tcp_set_time_now (tcp_worker_ctx_t * wrk)
 
 u32 tcp_session_push_header (transport_connection_t * tconn,
                             vlib_buffer_t * b);
+int tcp_session_custom_tx (void *conn, u32 max_burst_size);
 
 void tcp_connection_timers_init (tcp_connection_t * tc);
 void tcp_connection_timers_reset (tcp_connection_t * tc);