1 /* $NetBSD: tp_stat.h,v 1.8 2003/08/07 16:33:41 agc Exp $ */
4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * @(#)tp_stat.h 8.1 (Berkeley) 6/10/93
34 /***********************************************************
35 Copyright IBM Corporation 1987
39 Permission to use, copy, modify, and distribute this software and its
40 documentation for any purpose and without fee is hereby granted,
41 provided that the above copyright notice appear in all copies and that
42 both that copyright notice and this permission notice appear in
43 supporting documentation, and that the name of IBM not be
44 used in advertising or publicity pertaining to distribution of the
45 software without specific, written prior permission.
47 IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
48 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
49 IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
50 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
51 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
52 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
55 ******************************************************************/
58 * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
61 * Here are the data structures in which the global statistics(counters) are
65 #ifndef _NETISO_TP_STAT_H_
66 #define _NETISO_TP_STAT_H_
69 u_long ts_param_ignored
;
76 u_long ts_negotfailed
;
88 u_long ts_xpd_intheway
; /* xpd mark caused data flow
90 u_long ts_xpdmark_del
; /* xpd markers thrown away */
91 u_long ts_dt_ooo
; /* dt tpdus received out of order */
92 u_long ts_dt_niw
; /* dt tpdus received & not in window */
93 u_long ts_xpd_niw
; /* xpd tpdus received & not in window */
95 u_long ts_dt_dup
; /* dt tpdus received & are duplicates */
97 u_long ts_zfcdt
; /* # times f credit went down to 0 */
98 u_long ts_lcdt_reduced
; /* # times local cdt reduced
99 * on an acknowledgement. */
101 u_long ts_pkt_rcvd
; /* from ip */
102 u_long ts_tpdu_rcvd
; /* accepted as a TPDU in tp_input */
106 u_long ts_retrans_cr
;
107 u_long ts_retrans_cc
;
108 u_long ts_retrans_dr
;
109 u_long ts_retrans_dt
;
110 u_long ts_retrans_xpd
;
111 u_long ts_conn_gaveup
;
141 u_long ts_Ccan_inact
;
145 u_long ts_concat_rcvd
;
147 u_long ts_zdebug
; /* zero dref to test timeout on conn
148 * estab tp_input.c */
149 u_long ts_ydebug
; /* throw away pseudo-random pkts
152 u_long ts_unused
; /* kludged concat to test separation
154 u_long ts_vdebug
; /* kludge to test input size checking
157 u_long ts_ldebug
; /* faked a renegging of credit */
160 u_long ts_mb_cluster
;
161 u_long ts_mb_len_distr
[17];
171 #define NRTT_CATEGORIES 4
173 * The 4 categories are: 0 --> tp_flags: ~TPF_PEER_ON_SAMENET |
174 * TPF_NL_PDN 1 --> tp_flags: ~TPF_PEER_ON_SAMENET | ~TPF_NL_PDN 2
175 * --> tp_flags: TPF_PEER_ON_SAMENET | ~TPF_NL_PDN 3 --> tp_flags:
176 * TPF_PEER_ON_SAMENET | TPF_NL_PDN
178 int ts_rtt
[NRTT_CATEGORIES
];
179 int ts_rtv
[NRTT_CATEGORIES
];
181 u_long ts_ackreason
[_ACK_NUM_REASONS_
];
183 * ACK_DONT 0 / ACK_STRAT_EACH 0x1 / ACK_STRAT_FULLWIN 0x4 ACK_DUP
184 * 0x8 / ACK_EOT 0x10 / ACK_REORDER 0x20 ACK_USRRCV ** ACK_FCC **
189 extern struct tp_stat tp_stat
;
190 #define IncStat(x) tp_stat./**/x/**/++
193 #define TP_PM_MAX 0xa /* 10 decimal */
197 #define PStat(Tpcb, X) (Tpcb)->tp_p_meas->/**/X /**/
198 #define IncPStat(Tpcb, X) if((Tpcb)->tp_perf_on) (Tpcb)->tp_p_meas->/**/X/**/++
201 * BEWARE OF MACROS like this ^^^ must be sure it's surrounded by {} if it's
202 * used in an if-else statement.
206 /* for perf measurement stuff: maximum window size it can handle */
210 * the first few are distributions as a fn of window size only keep
211 * enough space for normal format plus 1 slot for extended format, in
212 * case any windows larger than 15 are used
216 * tps_npdusent: for each call to tp_sbsend, we inc the element
217 * representing the number of pdus sent in this call
219 int tps_win_lim_by_cdt
[TP_PM_MAX
+ 1];
220 int tps_win_lim_by_data
[TP_PM_MAX
+ 1];
222 * tps_sendtime: Each call to tp_sbsend() is timed. For Each window
223 * size, we keep the running average of the time taken by tp_sbsend()
224 * for each window size.
226 int tps_sendtime
[TP_PM_MAX
+ 1];
228 * n_TMsendack: # times ack sent because timer went off
229 * n_ack_cuz_eot: # times ack sent due to EOTSDU on incoming packet
230 * n_ack_cuz_dup: # times ack sent for receiving a duplicate pkt.
231 * n_ack_cuz_fullwin: # times ack sent for receiving the full window.
232 * n_ack_cuz_doack: # times ack sent for having just reordered data.
235 int tps_n_ack_cuz_eot
;
236 int tps_n_ack_cuz_fullwin
;
237 int tps_n_ack_cuz_reorder
;
238 int tps_n_ack_cuz_dup
;
239 int tps_n_ack_cuz_strat
;
241 * when we send an ack: how much less than the "expected" window
242 * did we actually ack. For example: if we last sent a credit
243 * of 10, and we're acking now for whatever reason, and have
244 * only received 6 since our last credit advertisement, we'll
245 * keep the difference, 4, in this variable.
247 int tps_ack_early
[TP_PM_MAX
+ 1];
249 * when we ack, for the # pkts we actually acked w/ this ack,
250 * how much cdt are we advertising?
251 * [ size of window acknowledged ] [ cdt we're giving ]
253 int tps_cdt_acked
[TP_PM_MAX
+ 1][TP_PM_MAX
+ 1];
273 #define PStat(tpcb, x) 0
274 #define IncPStat(tpcb, x) /* no-op */
275 #define tpmeas(a,b,c,d,e,f) 0
277 #endif /* TP_PERF_MEAS */
280 #define DOPERF(tpcb) (tpcb->tp_perf_on && tpcb->tp_p_meas)
282 #endif /* !_NETISO_TP_STAT_H_ */