Skip to content

Commit be63189

Browse files
Prj2223davem330
authored andcommitted
tcp: add ca_state stat in SCM_TIMESTAMPING_OPT_STATS
This patch adds TCP_NLA_CA_STATE stat into SCM_TIMESTAMPING_OPT_STATS. It reports ca_state of socket, when timestamp is generated. Signed-off-by: Priyaranjan Jha <[email protected]> Signed-off-by: Neal Cardwell <[email protected]> Signed-off-by: Yuchung Cheng <[email protected]> Signed-off-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 87ecc95 commit be63189

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/uapi/linux/tcp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ enum {
242242
TCP_NLA_RECUR_RETRANS, /* Recurring retransmits for the current pkt */
243243
TCP_NLA_DELIVERY_RATE_APP_LMT, /* delivery rate application limited ? */
244244
TCP_NLA_SNDQ_SIZE, /* Data (bytes) pending in send queue */
245+
TCP_NLA_CA_STATE, /* ca_state of socket */
245246

246247
};
247248

net/ipv4/tcp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3032,7 +3032,7 @@ struct sk_buff *tcp_get_timestamping_opt_stats(const struct sock *sk)
30323032

30333033
stats = alloc_skb(7 * nla_total_size_64bit(sizeof(u64)) +
30343034
4 * nla_total_size(sizeof(u32)) +
3035-
2 * nla_total_size(sizeof(u8)), GFP_ATOMIC);
3035+
3 * nla_total_size(sizeof(u8)), GFP_ATOMIC);
30363036
if (!stats)
30373037
return NULL;
30383038

@@ -3063,6 +3063,7 @@ struct sk_buff *tcp_get_timestamping_opt_stats(const struct sock *sk)
30633063
nla_put_u8(stats, TCP_NLA_DELIVERY_RATE_APP_LMT, !!tp->rate_app_limited);
30643064

30653065
nla_put_u32(stats, TCP_NLA_SNDQ_SIZE, tp->write_seq - tp->snd_una);
3066+
nla_put_u8(stats, TCP_NLA_CA_STATE, inet_csk(sk)->icsk_ca_state);
30663067
return stats;
30673068
}
30683069

0 commit comments

Comments
 (0)