Commit 46f3dece authored by Stephen Hemminger's avatar Stephen Hemminger

[TCP]: Report vegas info via tcp_diag.

parent 7ce42ae1
......@@ -98,9 +98,10 @@ enum
TCPDIAG_NONE,
TCPDIAG_MEMINFO,
TCPDIAG_INFO,
TCPDIAG_VEGASINFO,
};
#define TCPDIAG_MAX TCPDIAG_INFO
#define TCPDIAG_MAX TCPDIAG_VEGASINFO
/* TCPDIAG_MEM */
......@@ -113,4 +114,14 @@ struct tcpdiag_meminfo
__u32 tcpdiag_tmem;
};
/* TCPDIAG_VEGASINFO */
struct tcpvegas_info {
__u32 tcpv_enabled;
__u32 tcpv_rttcnt;
__u32 tcpv_rtt;
__u32 tcpv_minrtt;
};
#endif /* _TCP_DIAG_H_ */
......@@ -50,6 +50,7 @@ static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
struct nlmsghdr *nlh;
struct tcp_info *info = NULL;
struct tcpdiag_meminfo *minfo = NULL;
struct tcpvegas_info *vinfo = NULL;
unsigned char *b = skb->tail;
nlh = NLMSG_PUT(skb, pid, seq, TCPDIAG_GETSOCK, sizeof(*r));
......@@ -59,6 +60,9 @@ static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
minfo = TCPDIAG_PUT(skb, TCPDIAG_MEMINFO, sizeof(*minfo));
if (ext & (1<<(TCPDIAG_INFO-1)))
info = TCPDIAG_PUT(skb, TCPDIAG_INFO, sizeof(*info));
if (tcp_is_vegas(tp) && (ext & (1<<(TCPDIAG_VEGASINFO-1))))
vinfo = TCPDIAG_PUT(skb, TCPDIAG_VEGASINFO, sizeof(*vinfo));
}
r->tcpdiag_family = sk->sk_family;
r->tcpdiag_state = sk->sk_state;
......@@ -196,6 +200,13 @@ static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
info->tcpi_reordering = tp->reordering;
}
if (vinfo) {
vinfo->tcpv_enabled = tp->vegas.doing_vegas_now;
vinfo->tcpv_rttcnt = tp->vegas.cntRTT;
vinfo->tcpv_rtt = tp->vegas.baseRTT;
vinfo->tcpv_minrtt = tp->vegas.minRTT;
}
nlh->nlmsg_len = skb->tail - b;
return skb->len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment