summaryrefslogtreecommitdiff
path: root/slirp/tcp_input.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-06-24 14:42:29 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-29 08:52:46 -0500
commit0fe6a7f28455cd003b2668e77d5bd1e1cf15309e (patch)
tree450145c474ae8fed5ff03859e3ab2611afbc4dc6 /slirp/tcp_input.c
parent0d62c4cfe21752df4c1d6e2c2398f15d5eaa794a (diff)
downloadqemu-0fe6a7f28455cd003b2668e77d5bd1e1cf15309e.tar.gz
slirp: Drop statistic code
As agreed on the mailing list, there is no interest in keeping the usually disabled slirp statistics in the tree. So this patch removes them. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'slirp/tcp_input.c')
-rw-r--r--slirp/tcp_input.c49
1 files changed, 3 insertions, 46 deletions
diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c
index 980ae06d34..b7a67e561f 100644
--- a/slirp/tcp_input.c
+++ b/slirp/tcp_input.c
@@ -75,8 +75,6 @@ tcp_seq tcp_iss; /* tcp initial send seq # */
tp->t_flags |= TF_DELACK; \
(tp)->rcv_nxt += (ti)->ti_len; \
flags = (ti)->ti_flags & TH_FIN; \
- STAT(tcpstat.tcps_rcvpack++); \
- STAT(tcpstat.tcps_rcvbyte += (ti)->ti_len); \
if (so->so_emu) { \
if (tcp_emu((so),(m))) sbappend((so), (m)); \
} else \
@@ -94,8 +92,6 @@ tcp_seq tcp_iss; /* tcp initial send seq # */
tp->t_flags |= TF_DELACK; \
(tp)->rcv_nxt += (ti)->ti_len; \
flags = (ti)->ti_flags & TH_FIN; \
- STAT(tcpstat.tcps_rcvpack++); \
- STAT(tcpstat.tcps_rcvbyte += (ti)->ti_len); \
if (so->so_emu) { \
if (tcp_emu((so),(m))) sbappend(so, (m)); \
} else \
@@ -145,8 +141,6 @@ tcp_reass(register struct tcpcb *tp, register struct tcpiphdr *ti,
i = q->ti_seq + q->ti_len - ti->ti_seq;
if (i > 0) {
if (i >= ti->ti_len) {
- STAT(tcpstat.tcps_rcvduppack++);
- STAT(tcpstat.tcps_rcvdupbyte += ti->ti_len);
m_freem(m);
/*
* Try to present any queued data
@@ -162,8 +156,6 @@ tcp_reass(register struct tcpcb *tp, register struct tcpiphdr *ti,
}
q = tcpiphdr_next(q);
}
- STAT(tcpstat.tcps_rcvoopack++);
- STAT(tcpstat.tcps_rcvoobyte += ti->ti_len);
ti->ti_mbuf = m;
/*
@@ -263,8 +255,6 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
goto cont_conn;
}
-
- STAT(tcpstat.tcps_rcvtotal++);
/*
* Get IP and TCP header together in first mbuf.
* Note: IP leaves IP header in first mbuf.
@@ -295,7 +285,6 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
ti->ti_len = htons((u_int16_t)tlen);
len = sizeof(struct ip ) + tlen;
if(cksum(m, len)) {
- STAT(tcpstat.tcps_rcvbadsum++);
goto drop;
}
@@ -305,7 +294,6 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
*/
off = ti->ti_off << 2;
if (off < sizeof (struct tcphdr) || off > tlen) {
- STAT(tcpstat.tcps_rcvbadoff++);
goto drop;
}
tlen -= off;
@@ -353,7 +341,6 @@ findso:
ti->ti_dst, ti->ti_dport);
if (so)
tcp_last_so = so;
- STAT(tcpstat.tcps_socachemiss++);
}
/*
@@ -460,13 +447,10 @@ findso:
/*
* this is a pure ack for outstanding data.
*/
- STAT(tcpstat.tcps_predack++);
if (tp->t_rtt &&
SEQ_GT(ti->ti_ack, tp->t_rtseq))
tcp_xmit_timer(tp, tp->t_rtt);
acked = ti->ti_ack - tp->snd_una;
- STAT(tcpstat.tcps_rcvackpack++);
- STAT(tcpstat.tcps_rcvackbyte += acked);
sbdrop(&so->so_snd, acked);
tp->snd_una = ti->ti_ack;
m_freem(m);
@@ -503,10 +487,7 @@ findso:
* with nothing on the reassembly queue and
* we have enough buffer space to take it.
*/
- STAT(tcpstat.tcps_preddat++);
tp->rcv_nxt += ti->ti_len;
- STAT(tcpstat.tcps_rcvpack++);
- STAT(tcpstat.tcps_rcvbyte += ti->ti_len);
/*
* Add data to socket buffer.
*/
@@ -658,7 +639,6 @@ findso:
tp->t_flags |= TF_ACKNOW;
tp->t_state = TCPS_SYN_RECEIVED;
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT;
- STAT(tcpstat.tcps_accepts++);
goto trimthenstep6;
} /* case TCPS_LISTEN */
@@ -699,7 +679,6 @@ findso:
tcp_rcvseqinit(tp);
tp->t_flags |= TF_ACKNOW;
if (tiflags & TH_ACK && SEQ_GT(tp->snd_una, tp->iss)) {
- STAT(tcpstat.tcps_connects++);
soisfconnected(so);
tp->t_state = TCPS_ESTABLISHED;
@@ -726,8 +705,6 @@ trimthenstep6:
m_adj(m, -todrop);
ti->ti_len = tp->rcv_wnd;
tiflags &= ~TH_FIN;
- STAT(tcpstat.tcps_rcvpackafterwin++);
- STAT(tcpstat.tcps_rcvbyteafterwin += todrop);
}
tp->snd_wl1 = ti->ti_seq - 1;
tp->rcv_up = ti->ti_seq;
@@ -768,11 +745,6 @@ trimthenstep6:
*/
tp->t_flags |= TF_ACKNOW;
todrop = ti->ti_len;
- STAT(tcpstat.tcps_rcvduppack++);
- STAT(tcpstat.tcps_rcvdupbyte += todrop);
- } else {
- STAT(tcpstat.tcps_rcvpartduppack++);
- STAT(tcpstat.tcps_rcvpartdupbyte += todrop);
}
m_adj(m, todrop);
ti->ti_seq += todrop;
@@ -791,7 +763,6 @@ trimthenstep6:
if ((so->so_state & SS_NOFDREF) &&
tp->t_state > TCPS_CLOSE_WAIT && ti->ti_len) {
tp = tcp_close(tp);
- STAT(tcpstat.tcps_rcvafterclose++);
goto dropwithreset;
}
@@ -801,9 +772,7 @@ trimthenstep6:
*/
todrop = (ti->ti_seq+ti->ti_len) - (tp->rcv_nxt+tp->rcv_wnd);
if (todrop > 0) {
- STAT(tcpstat.tcps_rcvpackafterwin++);
if (todrop >= ti->ti_len) {
- STAT(tcpstat.tcps_rcvbyteafterwin += ti->ti_len);
/*
* If a new connection request is received
* while in TIME_WAIT, drop the old connection
@@ -826,11 +795,10 @@ trimthenstep6:
*/
if (tp->rcv_wnd == 0 && ti->ti_seq == tp->rcv_nxt) {
tp->t_flags |= TF_ACKNOW;
- STAT(tcpstat.tcps_rcvwinprobe++);
- } else
+ } else {
goto dropafterack;
- } else
- STAT(tcpstat.tcps_rcvbyteafterwin += todrop);
+ }
+ }
m_adj(m, -todrop);
ti->ti_len -= todrop;
tiflags &= ~(TH_PUSH|TH_FIN);
@@ -854,7 +822,6 @@ trimthenstep6:
case TCPS_FIN_WAIT_2:
case TCPS_CLOSE_WAIT:
tp->t_state = TCPS_CLOSED;
- STAT(tcpstat.tcps_drops++);
tp = tcp_close(tp);
goto drop;
@@ -893,7 +860,6 @@ trimthenstep6:
if (SEQ_GT(tp->snd_una, ti->ti_ack) ||
SEQ_GT(ti->ti_ack, tp->snd_max))
goto dropwithreset;
- STAT(tcpstat.tcps_connects++);
tp->t_state = TCPS_ESTABLISHED;
/*
* The sent SYN is ack'ed with our sequence number +1
@@ -944,7 +910,6 @@ trimthenstep6:
if (SEQ_LEQ(ti->ti_ack, tp->snd_una)) {
if (ti->ti_len == 0 && tiwin == tp->snd_wnd) {
- STAT(tcpstat.tcps_rcvdupack++);
DEBUG_MISC((dfd," dup ack m = %lx so = %lx \n",
(long )m, (long )so));
/*
@@ -1012,12 +977,9 @@ trimthenstep6:
tp->snd_cwnd = tp->snd_ssthresh;
tp->t_dupacks = 0;
if (SEQ_GT(ti->ti_ack, tp->snd_max)) {
- STAT(tcpstat.tcps_rcvacktoomuch++);
goto dropafterack;
}
acked = ti->ti_ack - tp->snd_una;
- STAT(tcpstat.tcps_rcvackpack++);
- STAT(tcpstat.tcps_rcvackbyte += acked);
/*
* If transmit timer is running and timed sequence
@@ -1138,10 +1100,6 @@ step6:
(SEQ_LT(tp->snd_wl1, ti->ti_seq) ||
(tp->snd_wl1 == ti->ti_seq && (SEQ_LT(tp->snd_wl2, ti->ti_ack) ||
(tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))))) {
- /* keep track of pure window updates */
- if (ti->ti_len == 0 &&
- tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd)
- STAT(tcpstat.tcps_rcvwinupd++);
tp->snd_wnd = tiwin;
tp->snd_wl1 = ti->ti_seq;
tp->snd_wl2 = ti->ti_ack;
@@ -1425,7 +1383,6 @@ tcp_xmit_timer(register struct tcpcb *tp, int rtt)
DEBUG_ARG("tp = %lx", (long)tp);
DEBUG_ARG("rtt = %d", rtt);
- STAT(tcpstat.tcps_rttupdated++);
if (tp->t_srtt != 0) {
/*
* srtt is stored as fixed point with 3 bits after the