A method and structure for performing a delayed counter increment is provided.
The method and structure allows a counter decision to be modified based upon what
the computer system hardware does with the data packet. Subsequent to the generation
of a counter command, the processing of the data packet may change: for example,
the data packet may be discarded instead of forwarded. Accordingly, the counter
increment instruction is changed. A delayed counter increment will perform the
actual counter update after the processing of the data packet is completed. In
one embodiment of the invention, the counter update action is modified depending
upon whether the data packet is forwarded or discarded, and a different counter
is selected to be updated. This solves a problem that sometimes the forwarding
code is unable to determine if some independent action may later discard a data packet.