- s = format (s, "cwnd %u ssthresh %u rtx_bytes %u bytes_acked %u\n",
- tc->cwnd, tc->ssthresh, tc->snd_rxt_bytes, tc->bytes_acked);
- s = format (s, "%Ucc space %u prev_ssthresh %u snd_congestion %u"
- " dupack %u\n", format_white_space, indent,
- tcp_available_cc_snd_space (tc), tc->prev_ssthresh,
- tc->snd_congestion - tc->iss, tc->rcv_dupacks);
- s = format (s, "%Utsecr %u tsecr_last_ack %u limited_transmit %u\n",
- format_white_space, indent, tc->rcv_opts.tsecr,
- tc->tsecr_last_ack, tc->limited_transmit - tc->iss);
+ s = format (s, "algo %s cwnd %u ssthresh %u bytes_acked %u\n",
+ tc->cc_algo->name, tc->cwnd, tc->ssthresh, tc->bytes_acked);
+ s = format (s, "%Ucc space %u prev_cwnd %u prev_ssthresh %u\n",
+ format_white_space, indent, tcp_available_cc_snd_space (tc),
+ tc->prev_cwnd, tc->prev_ssthresh);
+ s = format (s, "%Usnd_cong %u dupack %u limited_tx %u\n",
+ format_white_space, indent, tc->snd_congestion - tc->iss,
+ tc->rcv_dupacks, tc->limited_transmit - tc->iss);
+ s = format (s, "%Urxt_bytes %u rxt_delivered %u rxt_head %u rxt_ts %u\n",
+ format_white_space, indent, tc->snd_rxt_bytes,
+ tc->rxt_delivered, tc->rxt_head - tc->iss,
+ tcp_time_now_w_thread (tc->c_thread_index) - tc->snd_rxt_ts);
+ if (tcp_in_fastrecovery (tc))
+ prr_space = tcp_fastrecovery_prr_snd_space (tc);
+ s = format (s, "%Uprr_start %u prr_delivered %u prr space %u\n",
+ format_white_space, indent, tc->prr_start - tc->iss,
+ tc->prr_delivered, prr_space);
+ return s;
+}
+
+static u8 *
+format_tcp_stats (u8 * s, va_list * args)
+{
+ tcp_connection_t *tc = va_arg (*args, tcp_connection_t *);
+ u32 indent = format_get_indent (s);
+ s = format (s, "in segs %lu dsegs %lu bytes %lu dupacks %u\n",
+ tc->segs_in, tc->data_segs_in, tc->bytes_in, tc->dupacks_in);
+ s = format (s, "%Uout segs %lu dsegs %lu bytes %lu dupacks %u\n",
+ format_white_space, indent, tc->segs_out,
+ tc->data_segs_out, tc->bytes_out, tc->dupacks_out);
+ s = format (s, "%Ufr %u tr %u rxt segs %lu bytes %lu duration %.3f\n",
+ format_white_space, indent, tc->fr_occurences,
+ tc->tr_occurences, tc->segs_retrans, tc->bytes_retrans,
+ tcp_time_now_us (tc->c_thread_index) - tc->start_ts);
+ s = format (s, "%Uerr wnd data below %u above %u ack below %u above %u",
+ format_white_space, indent, tc->errors.below_data_wnd,
+ tc->errors.above_data_wnd, tc->errors.below_ack_wnd,
+ tc->errors.above_ack_wnd);