Designing High-Performance Networking Applications: Essential Insights for Developers of IXP2XXX Network Processor-based Systems

Processors in the IXP2XXX Product Line support a number of features that are useful in the implementation of traffic management on the microengines. Some of these features are described briefly here.
Monitoring the rate at which traffic flows implies that the microengines need the notion of time. For this purpose, the microengines include a local CSR that provides a 64-bit timestamp. The meter and shaper blocks use the timestamp for measuring the arrival or departure rate of packets.
Implementations of metering, WRED, and shaping often include a multiply operation in the calculations. While you can approximate this operation using multiple shift and add instructions, such a computation is typically neither efficient nor completely accurate. The microengines include a multiply instruction for efficiently performing such calculations.
The implementation of WRED requires randomly dropping packets based on a drop probability. To perform this operation, the buffer management block needs to calculate the drop probability for every packet and then generate a random number between zero and one. If the random number is less than the calculated drop probability, the buffer manager enqueues the packet, otherwise it drops it.
To help generate the random number, the microengines support a pseudo-random number generator that is accessible through a local CSR.
Implementation of scheduling algorithms typically maintains different bit vectors such as bit vectors for queues that contain packets, queues that are flow-controlled, or queues that are eligible to send packets under a specific...