Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.6.0.3
|
This document provides a brief description of the Interface Statistics OpEN API. The Interface Statistics OpEN API allows processes outside of the ICOS main process (switchdrvr) access to Interface Statistics. It provides the following services:
In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.
intf_stats_example.c is a sample application that demonstrates the use of the Interface Statistics OpEN API's. intf_stats_example is started from the command line. It then exercises all the Interface Statistics OpEN APIs one by one with appropriate arguments.
cosq_stats_example.c is a sample application. It demonstrates the OpEN APIs which support reading cosq statistics on an interface and CPU port. In this release, per-queue multicast and unicast packet counts are retrievable for front panel ports. For the CPU port, drop counts per queue as well as transmit counts per queue are able to be read. You can use the APIs to read a specific queue associated with an egress port. Or you can read all queues for a given interface by making a single call and passing the constant OPEN_COS_ALL_QUEUES. The example application illustrates both. First it iterates all of the interfaces on the switch and displays counts for all of the available cos queues. After that, it once again iterates all of the interfaces, this time making calls for each cos queue separately. The example does the above for both unicast (UC) and multicast (MC) queues. Finally, CPU port tx stats and drop counts are retrieved and displayed.
The APIs accept an open_buffdesc to hold the results on return, and an index specifying the desired CoS queue to be read. The valid range for the index is [0, openapiCosQueueNumQueuesGet() - 1]. The number of queues for a given port may vary based on the port type. If the index is a value in the above range, then the open_buffdesc must contain enough space to store the single unsigned 64-bit counter found at that index. A special index, OPEN_COS_ALL_QUEUES, can be used to request the API to retrieve all queues for the specified interface. In this case, the open_buffdesc must contain enough memory to hold openapiCosQueueNumQueuesGet() unsigned 64-bit counters. The number of counters returned will be specified on output in the size member of the open_buffdesc, should the function return successfully.
CLI Command | OpEN API Reference |
---|---|
(Priv-User Mode)# clear counters [<slot/port> | all] | openapiInterfaceStatsReset() |
(Priv-User Mode)# show interface <slot/port>\ | openapiInterfaceStatsResetTimeGet() |
(Priv-User Mode)# show interface ethernet [<slot/port>\ | switchport] | openapiStatGet() openapiInterfaceStatsGet() |