Counter functions in an application program interface for network devices
First Claim
Patent Images
1. A method performed by an application program interface (API), the method comprising:
- reading a count value from a hardware counter in a network device;
resetting the hardware counter;
updating a software counter with the count value, said software counter being stored in a memory location in a memory, said memory location being associated with the hardware counter, and said memory being accessible by at least one of the API and an application program using the API;
reading a plurality of additional count values from a plurality of additional hardware counters;
resetting the plurality of additional hardware counters;
updating a plurality of additional software counters with the plurality of additional count values, said plurality of additional software counters being stored in a plurality of additional memory locations in the memory, at least one of said additional memory locations being associated with a respective one of the plurality of additional hardware counters; and
receiving a function command from the application program prior to reading the count value or the plurality of additional count values, said function command to identify the hardware counter and the plurality of additional hardware counters from among a plurality of hardware counters and to initiate the reading, resetting, and updating, wherein each of the plurality of hardware counters is individually identified by a mask index, and wherein the application program provides a single index value to identify the hardware counter and the plurality of additional hardware counters by performing a logical CR operation on respective mask indices for the hardware counter and the plurality of additional hardware counters.
6 Assignments
0 Petitions
Accused Products
Abstract
Application program interface (API) reads a count value from a hardware counter in a network device. Then, the API resets the hardware counter and uses the count value to update a software counter. The software counter is stored in a memory location corresponding to the hardware counter. The memory is accessible both by the API and an application program using the API.
-
Citations
32 Claims
-
1. A method performed by an application program interface (API), the method comprising:
-
reading a count value from a hardware counter in a network device; resetting the hardware counter; updating a software counter with the count value, said software counter being stored in a memory location in a memory, said memory location being associated with the hardware counter, and said memory being accessible by at least one of the API and an application program using the API; reading a plurality of additional count values from a plurality of additional hardware counters; resetting the plurality of additional hardware counters; updating a plurality of additional software counters with the plurality of additional count values, said plurality of additional software counters being stored in a plurality of additional memory locations in the memory, at least one of said additional memory locations being associated with a respective one of the plurality of additional hardware counters; and receiving a function command from the application program prior to reading the count value or the plurality of additional count values, said function command to identify the hardware counter and the plurality of additional hardware counters from among a plurality of hardware counters and to initiate the reading, resetting, and updating, wherein each of the plurality of hardware counters is individually identified by a mask index, and wherein the application program provides a single index value to identify the hardware counter and the plurality of additional hardware counters by performing a logical CR operation on respective mask indices for the hardware counter and the plurality of additional hardware counters. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
-
-
20. An apparatus comprising:
-
means for reading a count value from a hardware counter in a network device7 means for resetting the hardware counter; and
means for updating a software counter with the count value count value to a current value stored in said software counter, said software counter being stored in a memory location in a memory , said memory location being associated with the hardware counter, and said memory being accessible by at least one of an application program interface (API) and an application program using the API;means for reading a plurality of additional count values from a plurality of additional hardware counters; means for resetting the plurality of additional hardware counters; means for updating a plurality of additional software counters with the plurality of additional count values, said plurality of additional software counters being stored in a plurality of additional memory locations in the memory, at least one of said additional memory locations being associated with a respective one of the plurality of additional hardware counters; and means for receiving a function command from the application program prior to reading the count value or the plurality of additional count values, said function command to identify the hardware counter and the plurality of additional hardware counters from among a plurality of hardware counters and to initiate the reading, resetting, and updating, wherein each of the plurality of hardware counters is individually identified by a mask index, and wherein the application program provides a single index value to identify the hardware counter and the luralit of additional hardware counters by performing a logical OR operation on respective mask indices for the hardware counter and the plurality of additional hardware counters. - View Dependent Claims (21, 22, 23, 24, 25, 26, 27)
-
-
28. An apparatus, comprising:
-
a processor; a networking interface coupled to the processor, including a hardware counter, to couple the apparatus to a network, the hardware counter configured to hold a first maximum counter value; and a storage medium coupled to a processor, having storage locations, a subset of which configurable to be a software counter, and programming instructions stored therein, to be executed by the processor, to; read a count value from the hardware counter; reset the hardware counter; update the software counter with the count value by adding the count value to a current value stored in said software counter;
read a plurality of additional count values from a plurality of additional hardware counters;reset the plurality of additional hardware counters; undate a plurality of additional software counters with the plurality of additional count values, said plurality of additional software counters being stored in a plurality of additional storage locations in the storage medium, at least one of said additional storage locations being associated with a respective one of the plurality of additional hardware counters; and receive a function command from the application program prior to reading the count value or the plurality of additional count values, said function command to identify the hardware counter and the plurality of additional hardware counters from among a plurality of hardware counters and to initiate the reading, resetting, and updating, wherein each of the plurality of hardware counters is individually identified by a mask index, and wherein the application program provides a single index value to identify the hardware counter and the plurality of additional hardware counters by performing a logical OR operation on respective mask indices for the hardware counter and the plurality of additional hardware counters. - View Dependent Claims (29, 30, 31, 32)
-
Specification