Annotation of kernel/bsd/netiso/tp_stat.h, revision 1.1.1.1

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.