summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_output.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-07-29 18:13:25 -0700
committerDave Barach <openvpp@barachs.net>2019-08-02 16:32:34 +0000
commitedfe0eea7a938e650074fcb82a971187a7beb12e (patch)
tree36e42838e4fc3f90594ee48b8eef3ce9c461e0e2 /src/vnet/tcp/tcp_output.c
parentc62a83daeac52c8642206ac1660e4e3e6ead77bf (diff)
tcp: add more connection stats
Type:feature Change-Id: If02884d0f1f26bfe31ec609ea9611cb27b699868 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_output.c')
-rw-r--r--src/vnet/tcp/tcp_output.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 010397b9e04..751d8b31382 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -1137,6 +1137,9 @@ tcp_push_hdr_i (tcp_connection_t * tc, vlib_buffer_t * b, u32 snd_nxt,
tc->snd_nxt += data_len;
tc->rcv_las = tc->rcv_nxt;
+ tc->bytes_out += data_len;
+ tc->data_segs_out += 1;
+
TCP_EVT_DBG (TCP_EVT_PKTIZE, tc);
}
@@ -1410,14 +1413,14 @@ tcp_prepare_retransmit_segment (tcp_worker_ctx_t * wrk,
/* Start is beyond snd_congestion */
start = tc->snd_una + offset;
if (seq_geq (start, tc->snd_congestion))
- goto done;
+ return 0;
/* Don't overshoot snd_congestion */
if (seq_gt (start + max_deq_bytes, tc->snd_congestion))
{
max_deq_bytes = tc->snd_congestion - start;
if (max_deq_bytes == 0)
- goto done;
+ return 0;
}
n_bytes = tcp_prepare_segment (wrk, tc, offset, max_deq_bytes, b);
@@ -1431,7 +1434,8 @@ tcp_prepare_retransmit_segment (tcp_worker_ctx_t * wrk,
tcp_bt_track_rxt (tc, start, start + n_bytes);
}
-done:
+ tc->bytes_retrans += n_bytes;
+ tc->segs_retrans += 1;
TCP_EVT_DBG (TCP_EVT_CC_RTX, tc, offset, n_bytes);
return n_bytes;
}
@@ -1458,6 +1462,7 @@ tcp_cc_init_rxt_timeout (tcp_connection_t * tc)
tc->rcv_dupacks = 0;
tc->rtt_ts = 0;
tc->cwnd_acc_bytes = 0;
+ tc->tr_occurences += 1;
tcp_connection_tx_pacer_reset (tc, tc->cwnd, 2 * tc->snd_mss);
tcp_recovery_on (tc);
}
@@ -2015,12 +2020,14 @@ tcp_send_acks (tcp_connection_t * tc, u32 max_burst_size)
{
tc->pending_dupacks = 0;
tc->snd_sack_pos = 0;
+ tc->dupacks_out += n_acks;
return n_acks;
}
else
{
TCP_DBG ("constrained by burst size");
tc->pending_dupacks = n_acks - max_burst_size;
+ tc->dupacks_out += max_burst_size;
tcp_program_dupack (tc);
return max_burst_size;
}
@@ -2196,6 +2203,8 @@ tcp_output_handle_packet (tcp_connection_t * tc0, vlib_buffer_t * b0,
if (!TCP_ALWAYS_ACK)
tcp_timer_reset (tc0, TCP_TIMER_DELACK);
+
+ tc0->segs_out += 1;
}
always_inline uword