|
|
1.1 root 1: /*-
2: * Copyright (c) 1991 The Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms, with or without
6: * modification, are permitted provided that the following conditions
7: * are met:
8: * 1. Redistributions of source code must retain the above copyright
9: * notice, this list of conditions and the following disclaimer.
10: * 2. Redistributions in binary form must reproduce the above copyright
11: * notice, this list of conditions and the following disclaimer in the
12: * documentation and/or other materials provided with the distribution.
13: * 3. All advertising materials mentioning features or use of this software
14: * must display the following acknowledgement:
15: * This product includes software developed by the University of
16: * California, Berkeley and its contributors.
17: * 4. Neither the name of the University nor the names of its contributors
18: * may be used to endorse or promote products derived from this software
19: * without specific prior written permission.
20: *
21: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31: * SUCH DAMAGE.
32: *
1.1.1.3 ! root 33: * from: @(#)tp_stat.h 7.5 (Berkeley) 6/27/91
! 34: * tp_stat.h,v 1.3 1993/05/20 05:27:53 cgd Exp
1.1 root 35: */
36:
1.1.1.3 ! root 37: #ifndef _NETISO_TP_STAT_H_
! 38: #define _NETISO_TP_STAT_H_
! 39:
1.1 root 40: /***********************************************************
41: Copyright IBM Corporation 1987
42:
43: All Rights Reserved
44:
45: Permission to use, copy, modify, and distribute this software and its
46: documentation for any purpose and without fee is hereby granted,
47: provided that the above copyright notice appear in all copies and that
48: both that copyright notice and this permission notice appear in
49: supporting documentation, and that the name of IBM not be
50: used in advertising or publicity pertaining to distribution of the
51: software without specific, written prior permission.
52:
53: IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
54: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
55: IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
56: ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
57: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
58: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
59: SOFTWARE.
60:
61: ******************************************************************/
62:
63: /*
64: * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
65: */
66: /*
67: * ARGO TP
68: *
69: * Here are the data structures in which the global
70: * statistics(counters) are gathered.
71: */
72:
73: struct tp_stat {
74: u_long ts_param_ignored;
75: u_long ts_unused3;
76: u_long ts_bad_csum;
77:
78: u_long ts_inv_length;
79: u_long ts_inv_pcode;
80: u_long ts_inv_dutype;
81: u_long ts_negotfailed;
82: u_long ts_inv_dref;
83: u_long ts_inv_pval;
84: u_long ts_inv_sufx;
85: u_long ts_inv_aclass;
86:
87: u_long ts_xtd_fmt;
88: u_long ts_use_txpd;
89: u_long ts_csum_off;
90: u_long ts_send_drop;
91: u_long ts_recv_drop;
92:
93: u_long ts_xpd_intheway;/* xpd mark caused data flow to stop */
94: u_long ts_xpdmark_del; /* xpd markers thrown away */
95: u_long ts_dt_ooo; /* dt tpdus received out of order */
96: u_long ts_dt_niw; /* dt tpdus received & not in window */
97: u_long ts_xpd_niw; /* xpd tpdus received & not in window */
98: u_long ts_xpd_dup;
99: u_long ts_dt_dup; /* dt tpdus received & are duplicates */
100:
101: u_long ts_zfcdt; /* # times f credit went down to 0 */
102: u_long ts_lcdt_reduced; /*
103: # times local cdt reduced on an acknowledgement.
104: */
105:
106: u_long ts_pkt_rcvd; /* from ip */
107: u_long ts_tpdu_rcvd; /* accepted as a TPDU in tp_input */
108: u_long ts_tpdu_sent;
109: u_long ts_unused2;
110:
111: u_long ts_retrans_cr;
112: u_long ts_retrans_cc;
113: u_long ts_retrans_dr;
114: u_long ts_retrans_dt;
115: u_long ts_retrans_xpd;
116: u_long ts_conn_gaveup;
117:
118: u_long ts_ER_sent;
119: u_long ts_DT_sent;
120: u_long ts_XPD_sent;
121: u_long ts_AK_sent;
122: u_long ts_XAK_sent;
123: u_long ts_DR_sent;
124: u_long ts_DC_sent;
125: u_long ts_CR_sent;
126: u_long ts_CC_sent;
127:
128: u_long ts_ER_rcvd;
129: u_long ts_DT_rcvd;
130: u_long ts_XPD_rcvd;
131: u_long ts_AK_rcvd;
132: u_long ts_XAK_rcvd;
133: u_long ts_DR_rcvd;
134: u_long ts_DC_rcvd;
135: u_long ts_CR_rcvd;
136: u_long ts_CC_rcvd;
137:
138: u_long ts_Eticks;
139: u_long ts_Eexpired;
140: u_long ts_Eset;
141: u_long ts_Ecan_act;
142: u_long ts_Cticks;
143: u_long ts_Cexpired;
144: u_long ts_Cset;
145: u_long ts_Ccan_act;
146: u_long ts_Ccan_inact;
147:
148: u_long ts_concat_rcvd;
149:
150: u_long ts_zdebug; /* zero dref to test timeout on conn estab tp_input.c */
151: u_long ts_ydebug; /* throw away pseudo-random pkts tp_input.c */
152: u_long ts_unused5;
153: u_long ts_unused; /* kludged concat to test separation tp_emit.c */
154: u_long ts_vdebug; /* kludge to test input size checking tp_emit.c */
155: u_long ts_unused4;
156: u_long ts_ldebug; /* faked a renegging of credit */
157:
158: u_long ts_mb_small;
159: u_long ts_mb_cluster;
160: u_long ts_mb_len_distr[17];
161:
162: u_long ts_eot_input;
163: u_long ts_eot_user;
164: u_long ts_EOT_sent;
165: u_long ts_tp0_conn;
166: u_long ts_tp4_conn;
167: u_long ts_quench;
168: u_long ts_rcvdecbit;
169:
170: #define NRTT_CATEGORIES 4
171: /* The 4 categories are:
172: * 0 --> tp_flags: ~TPF_PEER_ON_SAMENET | TPF_NL_PDN
173: * 1 --> tp_flags: ~TPF_PEER_ON_SAMENET | ~TPF_NL_PDN
174: * 2 --> tp_flags: TPF_PEER_ON_SAMENET | ~TPF_NL_PDN
175: * 3 --> tp_flags: TPF_PEER_ON_SAMENET | TPF_NL_PDN
176: */
177: struct timeval ts_rtt[NRTT_CATEGORIES];
178: struct timeval ts_rtv[NRTT_CATEGORIES];
179:
180: u_long ts_ackreason[_ACK_NUM_REASONS_];
181: /* ACK_DONT 0 / ACK_STRAT_EACH 0x1 / ACK_STRAT_FULLWIN 0x4
182: * ACK_DUP 0x8 / ACK_EOT 0x10 / ACK_REORDER 0x20
183: * ACK_USRRCV **
184: * ACK_FCC **
185: */
186: } tp_stat ;
187: #define TP_PM_MAX 0xa /* 10 decimal */
188:
189: #define IncStat(x) tp_stat./**/x/**/++
190:
191: #ifdef TP_PERF_MEAS
192:
193: #define PStat(Tpcb, X) (Tpcb)->tp_p_meas->/**/X/**/
194: #define IncPStat(Tpcb, X) if((Tpcb)->tp_perf_on) (Tpcb)->tp_p_meas->/**/X/**/++
195:
196: /* BEWARE OF MACROS like this ^^^ must be sure it's surrounded by {} if
197: * it's used in an if-else statement.
198: */
199:
200:
201: /* for perf measurement stuff: maximum window size it can handle */
202:
203: struct tp_pmeas {
204: /* the first few are distributions as a fn of window size
205: * only keep enough space for normal format plus 1 slot for
206: * extended format, in case any windows larger than 15 are used
207: */
208:
209: /*
210: * tps_npdusent: for each call to tp_sbsend, we inc the
211: * element representing the number of pdus sent in this call
212: */
213: int tps_win_lim_by_cdt[TP_PM_MAX+1];
214: int tps_win_lim_by_data[TP_PM_MAX+1];
215: /*
216: * tps_sendtime: Each call to tp_sbsend() is timed. For
217: * Each window size, we keep the running average of the time
218: * taken by tp_sbsend() for each window size.
219: */
220: struct timeval tps_sendtime[TP_PM_MAX+1];
221: /*
222: * n_TMsendack: # times ack sent because timer went off
223: * n_ack_cuz_eot: # times ack sent due to EOTSDU on incoming packet
224: * n_ack_cuz_dup: # times ack sent for receiving a duplicate pkt.
225: * n_ack_cuz_fullwin: # times ack sent for receiving the full window.
226: * n_ack_cuz_doack: # times ack sent for having just reordered data.
227: */
228: int tps_n_TMsendack;
229: int tps_n_ack_cuz_eot;
230: int tps_n_ack_cuz_fullwin;
231: int tps_n_ack_cuz_reorder;
232: int tps_n_ack_cuz_dup;
233: int tps_n_ack_cuz_strat;
234: /*
235: * when we send an ack: how much less than the "expected" window
236: * did we actually ack. For example: if we last sent a credit
237: * of 10, and we're acking now for whatever reason, and have
238: * only received 6 since our last credit advertisement, we'll
239: * keep the difference, 4, in this variable.
240: */
241: int tps_ack_early[TP_PM_MAX+1];
242: /*
243: * when we ack, for the # pkts we actually acked w/ this ack,
244: * how much cdt are we advertising?
245: * [ size of window acknowledged ] [ cdt we're giving ]
246: */
247: int tps_cdt_acked[TP_PM_MAX+1][TP_PM_MAX+1];
248:
249: int tps_AK_sent;
250: int tps_XAK_sent;
251: int tps_DT_sent;
252: int tps_XPD_sent;
253: int tps_AK_rcvd;
254: int tps_XAK_rcvd;
255: int tps_DT_rcvd;
256: int tps_XPD_rcvd;
257:
258: int Nb_from_sess;
259: int Nb_to_sess;
260: int Nb_to_ll;
261: int Nb_from_ll;
262: };
263:
264: #define IFPERF(tpcb) if (tpcb->tp_perf_on && tpcb->tp_p_meas) {
265: #define ENDPERF }
266:
267: #else
268:
269: int PStat_Junk;
270: #define PStat(tpcb, x) PStat_Junk
271: #define IncPStat(tpcb, x) /* no-op */
272: #define tpmeas(a,b,c,d,e,f) 0
273:
274: #define IFPERF(x) if (0) {
275: #define ENDPERF }
276:
277: #endif TP_PERF_MEAS
278:
1.1.1.3 ! root 279: #endif /* !_NETISO_TP_STAT_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.