tcp: snmp stats for Fast Open, SYN rtx, and data pkts
Add the following snmp stats: TCPFastOpenActiveFail: Fast Open attempts (SYN/data) failed beacuse the remote does not accept it or the attempts timed out. TCPSynRetrans: number of SYN and SYN/ACK retransmits to break down retransmissions into SYN, fast-retransmits, timeout retransmits, etc. TCPOrigDataSent: number of outgoing packets with original data (excluding retransmission but including data-in-SYN). This counter is different from TcpOutSegs because TcpOutSegs also tracks pure ACKs. TCPOrigDataSent is more useful to track the TCP retransmission rate. Change TCPFastOpenActive to track only successful Fast Opens to be symmetric to TCPFastOpenPassive. Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Nandita Dukkipati <nanditad@google.com> Signed-off-by: Lawrence Brakmo <brakmo@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
a135e598c4
commit
f19c29e3e3
@@ -86,6 +86,9 @@ static void tcp_event_new_data_sent(struct sock *sk, const struct sk_buff *skb)
|
||||
icsk->icsk_pending == ICSK_TIME_LOSS_PROBE) {
|
||||
tcp_rearm_rto(sk);
|
||||
}
|
||||
|
||||
NET_ADD_STATS_BH(sock_net(sk), LINUX_MIB_TCPORIGDATASENT,
|
||||
tcp_skb_pcount(skb));
|
||||
}
|
||||
|
||||
/* SND.NXT, if window was not shrunk.
|
||||
@@ -2433,7 +2436,8 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
|
||||
if (err == 0) {
|
||||
/* Update global TCP statistics. */
|
||||
TCP_INC_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS);
|
||||
|
||||
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)
|
||||
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSYNRETRANS);
|
||||
tp->total_retrans++;
|
||||
|
||||
#if FASTRETRANS_DEBUG > 0
|
||||
@@ -2958,7 +2962,7 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn)
|
||||
|
||||
if (tcp_transmit_skb(sk, syn_data, 0, sk->sk_allocation) == 0) {
|
||||
tp->syn_data = (fo->copied > 0);
|
||||
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENACTIVE);
|
||||
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPORIGDATASENT);
|
||||
goto done;
|
||||
}
|
||||
syn_data = NULL;
|
||||
|
Reference in New Issue
Block a user