Permalink
Browse files

Added rttvar as another stat to collect on TCP

  • Loading branch information...
1 parent d1825e3 commit cd0743835bbd5628c1d4dd760068d304e2ad180b @RobAtticus RobAtticus committed Mar 15, 2012
Showing with 9 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +4 −1 include/serval/ctrlmsg.h
  3. +3 −0 src/stack/serval_sal.c
  4. +1 −0 src/stack/serval_sock.c
View
@@ -88,4 +88,5 @@ Makefile
*.class
*.stamp
*.jar
+.*.swp
.DS_Store
View
@@ -255,7 +255,8 @@ struct ctrlmsg_stats_query {
struct stats_proto_tcp {
uint32_t retrans;
uint32_t lost;
- uint32_t srtt;
+ uint32_t srtt;
+ uint32_t rttvar;
uint32_t snd_una; /* next ACK we want */
uint32_t snd_nxt; /* next # we'll send */
@@ -271,6 +272,8 @@ struct ctrlmsg_stats_response {
#define tcp_retrans stats.retrans
#define tcp_lost stats.lost
#define tcp_srtt stats.srtt
+#define tcp_rttvar stats.rttvar
+
#define tcp_snd_una stats.snd_una
#define tcp_snd_nxt stats.snd_nxt
} CTRLMSG_PACKED;
View
@@ -3410,6 +3410,9 @@ static int serval_sal_do_xmit(struct sk_buff *skb)
if (err < 0) {
LOG_ERR("xmit failed err=%d\n", err);
}
+ else {
+ ssk->tot_pkts_sent++;
+ }
return err;
}
View
@@ -275,6 +275,7 @@ void serval_sock_stats_flow(struct flow_id *flow,
resp->tcp_lost = tsk->lost_out;
resp->pkts_sent = tsk->sk.tot_pkts_sent;
resp->tcp_srtt = tsk->srtt;
+ resp->tcp_rttvar = tsk->rttvar;
resp->tcp_snd_una = tsk->snd_una;
resp->tcp_snd_nxt = tsk->snd_nxt;
}

0 comments on commit cd07438

Please sign in to comment.