UCSI(7)

NAME
UCSI

DESCRIPTION
UCSI(universal counter statistics interface) enables the automatic identification by software of the presence of counters or informational bits from a predefined set. Each counter and information bit in this predefined set will have a set functionality. This will allow different combinations of counters and functional bits to be used in different cards without the requirement of additional software.
Goals
1.
      To make an easy translation of the existing firmware module statistics to unified counter blocks interface.Which can be automatically recognized by the software
      to give both the firmware and software unique counter and deterministic Ids to prevent name changes and duplications across different cards and images.
2
      Extend the possibility for customer specific statistics with out software changes
3
      Extend the possibility for debugging statistics and counters with out need of special software support.
4
      Give the option for accumulated counters in near future and to backwards compatible with the software
Function definitions see the respective man pages. The main enumeration table will store entry(ies) of type CSI per 'counter statistics interface' which will point to a CSI block in the DRB address space. The enumeration entry will have different versions depending on the CSI format (type of data access: direct v0, or indirect v1).
Component
Each CSI block has a description field indicating:
1. the number of counters,
2. the type of the counters in the block (firmware module based or functional based),
3. a latch and clear set up.
This CSI block is implemented as a new component in dagconfig with attributes. Its attributes are:
1. Counter Statistics Interface type (kUint32AttributeCSIType),
2. Number of counters in CSI (kUint32AttributeNbCounters),
3. Latch & Clear set up (kBooleanAttributeLatchClear),
4. Counter description base address (kUint32AttributeCounterDescBaseAdd),
5. Counter value base address (kUint32AttributeCounterValueBaseAdd).
The post-initialization function creates the subcomponent(s) counter and initializes their state structure. Subcomponent
Each counter is considered as a sub component of the CSI block component. Each individual counter will have a 32-bit description entry containing:
1. The counter ID which is unique and depending on the function is implemented when applicable,
2. A sub-function ID which covers multiple streams, filters or interfaces ports,
3. A block value type (counter value or address), this value type determines whether it is the counter value (0) or the address (1) where the counter value is stored,
4. A 'Latch and Clear' information,
5. The size of the counter can be 32 bits or 64 bits,
6. Type of access Indirect or Direct,
7. Base address of the counter value. The attributes are the following
Counter ID (kUint32AttributeCounterID),
Sub-function (kUint32AttributeSubFunction),
Value type (kBooleanAttributeValueType),
Latch and Clear information (kBooleanAttributeLatchClear),
Counter size (kUint32AttributeCounterSize),
Type of access (kBooleanAttributeAccess),
Counter value (kUint32AttributeCounterValue),
Sub-function (KUnit32AttributeSubFunctionsType)

The state structure contains:
1. the index of the subcomponent,
2. the address or offset (from the DRB base) of the description field,
3. the address or offset (from the DRB base) of the counter value.
            typedef struct
            {
                uint32_t mIndex;
                uint32_t mValueOffset
                uint32_t mDescrOffset;
                uint32_t* mValueAddress;
                uint32_t* mDescrAddress;
           } counter_state_t;

A specific function is implemented to read and set up each attribute.

Command:
    The command used to print the counters is : dagconfig -u Structures Structure of one counter, dag_counter_value_t:
  dag_counter_type_t typeID: indicates the type ID,
  int size : indicates the size of counter (32 or 64 bits),
  dag_subfct_type_t subfct: indicates the type of sub-function,
  int lc: indicates if there is a latch and clear bit to read
  the register,
  int value_type: indicates whether it is the counter value (0)
  or the address where the
  counter value is stored (1),
  uint64_t value: indicates the counter value,

            typedef struct
            {
                dag_counter_type_t typeID; (see below.)
                int size;
                dag_subfct_type_t subfct; (see below.)
                uint32_t interface_number
                int lc;
                int value_type; /*available for direct register */
                uint64_t value;
          } dag_counter_value_t;

           typedef enum
           {
             kIDSubfctPort = 0x00,
             kIDSubfctStream = 0x01,
             kIDSubfctFilter = 0x02,
             kIDSubfctGeneral = 0x03,
          }dag_subfct_type_t;

          typedef enum
          {
             kIDCounterInvalid = 0x0,
             kIDCounterRXFrame = 0x01,
             kIDCounterRXByte= 0x02,
             kIDCounterRXShort = 0x03,
             kIDCounterRXLong = 0x04,
             kIDCounterRXError = 0x05,
             kIDCounterRXFCS = 0x06,
             kIDCounterRXAbort = 0x07,
             kIDCounterTXFrame = 0x08,
             kIDCounterTXByte = 0x09,
             kIDCounterDIP4Error = 0x0A,
             kIDCounterDIP4PlError = 0x0B,
             kIDCounterBurstError = 0x0C,
             kIDCounterPlError = 0x0D,
             kIDCounterDebug = 0x0E,
             kIDCounterFilter = 0x0F,
             kIDCounterB1Error = 0x10,
             kIDCounterB2Error = 0x11,
             kIDCounterB3Error = 0x12,
             kIDCounterRXErr = 0x13,
             kIDCounterSpaceError = 0x14,
             kIDCounterContWdError = 0x15,
             kIDCounterPlContError = 0x16,
             kIDCounterTRDip4Error = 0x17,
             kIDCounterResvWd = 0x18,
             kIDCounterAddrError = 0x19,
             kIDCounterOOFPeriod = 0x1A,
             kIDCounterNbOOF = 0x1B,
             kIDCounterTXOOFPeriod = 0x1C,
             kIDCounterTXNbOOF = 0x1D,
             kIDCounterTXError = 0x1E,
             kIDCounterStatFrError = 0x1F,
             kIDCounterDip2Error = 0x20,
             kIDCounterPatternError = 0x21,
             kIDCounterRXStreamPacket = 0x22,
             kIDCounterRXStreamByte = 0x23,
             kIDCounterTXStreamPacket = 0x24,
             kIDCounterTXStreamByte = 0x25,
             kIDCounterPortDrop = 0x26,
             kIDCounterStreamDrop = 0x27,
             kIDCounterSubStreamDrop = 0x28,
             kIDCounterFilterDrop = 0x29,
         } dag_counter_type_t;

SEE ALSO
dag_config_get_number_counters(3),dag_config_get_number_all_counters(3),dag_config_get_counter_id_subfct(3),dag_config_get_all_block_id(3),dag_config_latch_clear_all(3),dag_config_latch_clear_block(3),dag_config_read_single_block(3),dag_config_read_all_counters(3),dag_config_read_single_counter(3)

BUGS
Report bugs to <support@endace.com>.

LAST UPDATED
$Author: karthik $
$Revision: 11654 $
$Date: 2009-07-29 15:22:08 +1200 (Wed, 29 Jul 2009) $

COPYRIGHT
(c) 2009 Endace Technology Ltd, Hamilton, New Zealand. All Rights Reserved.