Print this page
tcp: spelling


  31  */
  32 
  33 #ifdef  __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #ifdef _KERNEL
  38 
  39 /*
  40  * TCP Statistics.
  41  *
  42  * How TCP statistics work.
  43  *
  44  * There are two types of statistics invoked by two macros.
  45  *
  46  * TCP_STAT(name) does non-atomic increment of a named stat counter. It is
  47  * supposed to be used in non MT-hot paths of the code.
  48  *
  49  * TCP_DBGSTAT(name) does atomic increment of a named stat counter. It is
  50  * supposed to be used for DEBUG purposes and may be used on a hot path.
  51  * These counters are only available in a debugged kerel.  They are grouped
  52  * under the TCP_DEBUG_COUNTER C pre-processor condition.
  53  *
  54  * Both TCP_STAT and TCP_DBGSTAT counters are available using kstat
  55  * (use "kstat tcp" to get them).
  56  *
  57  * How to add new counters.
  58  *
  59  * 1) Add a field in the tcp_stat structure describing your counter.
  60  * 2) Add a line in the template in tcp_kstat2_init() with the name
  61  *    of the counter.
  62  * 3) Update tcp_clr_stats() and tcp_cp_stats() with the new counters.
  63  *    IMPORTANT!! - make sure that all the above functions are in sync !!
  64  * 4) Use either TCP_STAT or TCP_DBGSTAT with the name.
  65  *
  66  * Please avoid using private counters which are not kstat-exported.
  67  *
  68  * Implementation note.
  69  *
  70  * Both the MIB2 and tcp_stat_t counters are kept per CPU in the array
  71  * tcps_sc in tcp_stack_t.  Each array element is a pointer to a




  31  */
  32 
  33 #ifdef  __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #ifdef _KERNEL
  38 
  39 /*
  40  * TCP Statistics.
  41  *
  42  * How TCP statistics work.
  43  *
  44  * There are two types of statistics invoked by two macros.
  45  *
  46  * TCP_STAT(name) does non-atomic increment of a named stat counter. It is
  47  * supposed to be used in non MT-hot paths of the code.
  48  *
  49  * TCP_DBGSTAT(name) does atomic increment of a named stat counter. It is
  50  * supposed to be used for DEBUG purposes and may be used on a hot path.
  51  * These counters are only available in a debugged kernel.  They are grouped
  52  * under the TCP_DEBUG_COUNTER C pre-processor condition.
  53  *
  54  * Both TCP_STAT and TCP_DBGSTAT counters are available using kstat
  55  * (use "kstat tcp" to get them).
  56  *
  57  * How to add new counters.
  58  *
  59  * 1) Add a field in the tcp_stat structure describing your counter.
  60  * 2) Add a line in the template in tcp_kstat2_init() with the name
  61  *    of the counter.
  62  * 3) Update tcp_clr_stats() and tcp_cp_stats() with the new counters.
  63  *    IMPORTANT!! - make sure that all the above functions are in sync !!
  64  * 4) Use either TCP_STAT or TCP_DBGSTAT with the name.
  65  *
  66  * Please avoid using private counters which are not kstat-exported.
  67  *
  68  * Implementation note.
  69  *
  70  * Both the MIB2 and tcp_stat_t counters are kept per CPU in the array
  71  * tcps_sc in tcp_stack_t.  Each array element is a pointer to a