tcp: export packets delivery info
Export data delivered and delivered with CE marks to 1) SNMP TCPDelivered and TCPDeliveredCE 2) getsockopt(TCP_INFO) 3) Timestamping API SOF_TIMESTAMPING_OPT_STATS Note that for SCM_TSTAMP_ACK, the delivery info in SOF_TIMESTAMPING_OPT_STATS is reported before the info was fully updated on the ACK. These stats help application monitor TCP delivery and ECN status on per host, per connection, even per message level. Signed-off-by: Yuchung Cheng <ycheng@google.com> Reviewed-by: Neal Cardwell <ncardwell@google.com> Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e21db6f69a
commit
feb5f2ec64
@@ -3499,12 +3499,16 @@ static void tcp_xmit_recovery(struct sock *sk, int rexmit)
|
||||
/* Returns the number of packets newly acked or sacked by the current ACK */
|
||||
static u32 tcp_newly_delivered(struct sock *sk, u32 prior_delivered, int flag)
|
||||
{
|
||||
const struct net *net = sock_net(sk);
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
u32 delivered;
|
||||
|
||||
delivered = tp->delivered - prior_delivered;
|
||||
if (flag & FLAG_ECE)
|
||||
NET_ADD_STATS(net, LINUX_MIB_TCPDELIVERED, delivered);
|
||||
if (flag & FLAG_ECE) {
|
||||
tp->delivered_ce += delivered;
|
||||
NET_ADD_STATS(net, LINUX_MIB_TCPDELIVEREDCE, delivered);
|
||||
}
|
||||
return delivered;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user