主权项 |
1. A method of deterministic message processing in a direct memory access (DMA) adapter, the DMA adapter utilizing a first first-in-first-out (FIFO) message queue and a second FIFO message queue for processing packets received by the DMA adapter, the DMA adapter using a head pointer, a tail pointer, a sub-head pointer, and a sub-tail pointer to point to particular packets within the first FIFO message queue and the second FIFO message queue, the method comprising:
incrementing from the sub-head pointer, the sub-tail pointer until encountering an out-of-sequence packet, the sub-head pointer and the sub-tail pointer pointing to packets in the first FIFO message queue; consuming packets between the sub-head pointer and the sub-tail pointer including incrementing with the consumption of each packet, the sub-head pointer until determining that the sub-head pointer is equal to the sub-tail pointer; in response to determining that the sub-head pointer is equal to the sub-tail pointer, determining that the next in-sequence packet is not in the first FIFO message queue; and in response to determining that the next in-sequence packet is not in the first FIFO message queue and that the first FIFO message queue exceeds a threshold capacity, copying the contents of the first FIFO message queue into the second FIFO message queue. |