Patent ID: 7321595

Claim:
A method for processing data received from various numbers of ports in a network processor, the method comprising: receiving a number N corresponding to a number of ports; allocating N−1 registers for storing N−1 items of port management data, the N−1 registers including a first register and a last register, the last register corresponding to (N−1)th register; sequentially accessing the N ports to receive packets; when a packet is received from a selected port selected from among the N ports, processing the packet received from the selected port; and storing current management data of the selected port in a selected one register selected from among the N−1 registers, the selected one register being used for storing next management data of a next port before storing current management data of the selected port, the next port being selected from among the N ports and being a port to be accessed after the selected port is accessed; the selected one register being the first register when a previous register is the (N−1)th register, the previous register being currently used for storing previous management data of a previous port selected from among the N ports, and the previous port was accessed before the selected port was accessed.