High-speed multi-processor, multi-thread queue implementation
First Claim
1. A method of processing packets, comprising:
- determining an availability of a queue, the queue being shared by a plurality of receive threads and having an associated produce index;
incrementing the produce index while the produce index is locked, if the queue is determined to be available; and
writing a packet to the queue while the produce index is unlocked.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and system of enqueueing and dequeueing packets in a multi-threaded environment provide enhanced speed and performance. An availability of a queue is determined, where the queue is shared by a plurality of receive threads and has an associated produce index. If the queue is determined to be available, the produce index is incremented while the produce index is locked. On the other hand, an incoming packet is written to the queue while the produce index is unlocked. It is further determined whether data is stored in a queue of an off-chip memory of a network processor based on a produce count and a consume count. The produce count and the consume are stored in an on-chip memory of the network processor.
42 Citations
34 Claims
-
1. A method of processing packets, comprising:
-
determining an availability of a queue, the queue being shared by a plurality of receive threads and having an associated produce index;
incrementing the produce index while the produce index is locked, if the queue is determined to be available; and
writing a packet to the queue while the produce index is unlocked. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method of processing packets, comprising:
determining whether data is stored in a queue of an off-chip memory of a network processor based on a produce count and a consume count, the produce count and the consume count being stored in an on-chip memory of the network processor. - View Dependent Claims (9, 10, 11, 12, 13)
-
14. A method of processing packets, comprising:
-
reading a produce count from an on-chip memory of a network processor;
reading a consume count from the on-chip memory of the network processor;
subtracting the produce count from the consume count to determine an availability of the queue, the queue having an associated produce index;
locking the produce index;
reading a value of the produce index;
incrementing the read value based on a size of a incoming packet;
writing the incremented value to the produce index;
unlocking the produce index;
writing the incoming packet to the queue while the produce index is unlocked; and
atomically incrementing the produce count. - View Dependent Claims (15, 16, 17)
-
-
18. A network processor comprising:
a receive micro-engine to use a first receive thread to determine an availability of a queue, the queue being shared by a plurality of receive threads and having an associated produce index, the receive micro-engine to use the first receive thread to increment the produce index while the produce index is locked, if the queue is determined to be available, and to write an incoming packet to the queue while the produce index is unlocked. - View Dependent Claims (19, 20, 21, 22, 23, 24)
-
25. A networking architecture comprising:
-
a first off-chip memory having a plurality of queues;
a second off-chip memory to store a plurality of produce indices corresponding to the plurality of queues; and
a network processor operatively coupled to the off-chip memories, the network processor having a receive micro-engine to use a first receive thread to determine an availability of a queue, the queue being shared by a plurality of receive threads and having an associated produce index, the receive micro-engine to use the first receive thread to increment the produce index while the produce index is locked, if the queue is determined to be available, and to write an incoming packet to the queue while the produce index is unlocked. - View Dependent Claims (26, 27, 28, 29)
-
-
30. A machine readable storage medium storing a set of instructions capable of being executed by a processor to:
-
determine an availability of a queue, the queue being shared by a plurality of receive threads and having an associated produce index;
increment the produce index while the produce index is locked, if the queue is determined to be available; and
write a packet to the queue while the produce index is unlocked. - View Dependent Claims (31)
-
-
32. A machine readable storage medium storing a set of instructions capable of being executed by a processor to:
determine whether data is stored in a queue of an off-chip memory of a network processor based on a produce count and a consume count, the produce count and the consume count being stored in an on-chip memory of the network processor. - View Dependent Claims (33, 34)
Specification