summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-12-22 15:47:40 +0000
committerjhb <jhb@FreeBSD.org>2009-12-22 15:47:40 +0000
commitbeb0e14aaecd525d5f725dfc202df2ee235628aa (patch)
tree792e6b45ea8beea48f71a424e0912b8c92144f92
parent697c5264152a1e8eb28d5d1f48f7836ac9bbae2a (diff)
downloadFreeBSD-src-beb0e14aaecd525d5f725dfc202df2ee235628aa.zip
FreeBSD-src-beb0e14aaecd525d5f725dfc202df2ee235628aa.tar.gz
- Rename the __tcpi_(snd|rcv)_mss fields of the tcp_info structure to remove
the leading underscores since they are now implemented. - Implement the tcpi_rto and tcpi_last_data_recv fields in the tcp_info structure. Reviewed by: rwatson MFC after: 2 weeks
-rw-r--r--sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c2
-rw-r--r--sys/netinet/tcp.h8
-rw-r--r--sys/netinet/tcp_usrreq.c6
3 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c b/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c
index c582dbd..975b908 100644
--- a/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c
+++ b/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c
@@ -203,7 +203,7 @@ static int set_tcpinfo(struct iwch_ep *ep)
ep->snd_seq = ti.tcpi_snd_nxt;
ep->rcv_seq = ti.tcpi_rcv_nxt;
- ep->emss = ti.__tcpi_snd_mss - sizeof(struct tcpiphdr);
+ ep->emss = ti.tcpi_snd_mss - sizeof(struct tcpiphdr);
ep->hwtid = TOEPCB(ep->com.so)->tp_tid; /* XXX */
if (ti.tcpi_options & TCPI_OPT_TIMESTAMPS)
ep->emss -= 12;
diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h
index 03b8bf6..8779582 100644
--- a/sys/netinet/tcp.h
+++ b/sys/netinet/tcp.h
@@ -181,10 +181,10 @@ struct tcp_info {
u_int8_t tcpi_snd_wscale:4, /* RFC1323 send shift value. */
tcpi_rcv_wscale:4; /* RFC1323 recv shift value. */
- u_int32_t __tcpi_rto;
+ u_int32_t tcpi_rto; /* Retransmission timeout (usec). */
u_int32_t __tcpi_ato;
- u_int32_t __tcpi_snd_mss;
- u_int32_t __tcpi_rcv_mss;
+ u_int32_t tcpi_snd_mss; /* Max segment size for send. */
+ u_int32_t tcpi_rcv_mss; /* Max segment size for receive. */
u_int32_t __tcpi_unacked;
u_int32_t __tcpi_sacked;
@@ -195,7 +195,7 @@ struct tcp_info {
/* Times; measurements in usecs. */
u_int32_t __tcpi_last_data_sent;
u_int32_t __tcpi_last_ack_sent; /* Also unimpl. on Linux? */
- u_int32_t __tcpi_last_data_recv;
+ u_int32_t tcpi_last_data_recv; /* Time since last recv data. */
u_int32_t __tcpi_last_ack_recv;
/* Metrics; variable units. */
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 4913e6c..dc9f11b 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1194,6 +1194,8 @@ tcp_fill_info(struct tcpcb *tp, struct tcp_info *ti)
ti->tcpi_rcv_wscale = tp->rcv_scale;
}
+ ti->tcpi_rto = tp->t_rxtcur * tick;
+ ti->tcpi_last_data_recv = (long)(ticks - (int)tp->t_rcvtime) * tick;
ti->tcpi_rtt = ((u_int64_t)tp->t_srtt * tick) >> TCP_RTT_SHIFT;
ti->tcpi_rttvar = ((u_int64_t)tp->t_rttvar * tick) >> TCP_RTTVAR_SHIFT;
@@ -1208,8 +1210,8 @@ tcp_fill_info(struct tcpcb *tp, struct tcp_info *ti)
ti->tcpi_snd_wnd = tp->snd_wnd;
ti->tcpi_snd_bwnd = tp->snd_bwnd;
ti->tcpi_snd_nxt = tp->snd_nxt;
- ti->__tcpi_snd_mss = tp->t_maxseg;
- ti->__tcpi_rcv_mss = tp->t_maxseg;
+ ti->tcpi_snd_mss = tp->t_maxseg;
+ ti->tcpi_rcv_mss = tp->t_maxseg;
if (tp->t_flags & TF_TOE)
ti->tcpi_options |= TCPI_OPT_TOE;
}
OpenPOWER on IntegriCloud