IXP1200 Network Processor Family ATM OC-3/12/Ethernet IP Router Example Design

On hardware, counters.c is compiled into the atm_utils.o VxWorks-loadable module to provide counters at the VxWorks console.

4.8.1Global Parameters

Parameter

Description

 

 

COUNTERS_BASE

Base address of the scratchpad counter array (mandatory)

 

 

COUNTER_LOCATIONS

Size of the counter array (optional). Default is 64

 

 

COUNTER_STRINGn

String to print for counter n, where n is from 0 until

COUNTER_LOCATIONS -1 (optional). Default is "Counter n"

 

 

 

4.8.2Use of the Counter Subsystem

In this design, system_config.h controls the counter subsystem and defines a handle for each counter. This handle provides the parameters to counter_inc() in the microcode. For example, counter_inc(ATM_RX_CELL_DROP_VC_CLOSED) is invoked in ATM Receive threads every time a cell is discarded because it arrived on a VC that is not open.

#define ATM_RX_CELL_DROP_VC_CLOSED COUNTERS_BASE, 5, COUNT_CELL_DROP

The counter handle has three members:

The base address of the counter array.

The index of the counter in the array.

The flags to determine at compile-time if the counter should be invoked.

4.8.2.1Counter Base Address

The base address of the counter array is defined so that it starts immediately after the per-port exception counters defined in mem_map.h, and it is used as the first member of every counter handle. (This is why the counter example in “counters_print()”starts at (decimal) scratchpad location 195.)

#define COUNTERS_BASE 0xc3

4.8.2.2Counter Index

The index of the counter is simply entered directly into the list of counter handle definitions. Be careful not to duplicate any counter indexes, because it would cause multiple handles to increment the same location.

Application Note

47

Modified on: 3/20/02,

Page 47
Image 47
Intel IXP1200 manual Global Parameters, Use of the Counter Subsystem, Counter Base Address, Counter Index