6.1.2 Notification of Completed Work
One of the first things the programmer must consider is how to tell when the PKTDMA has completed some transfers that the host software needs to act upon. In general, there are two ways this can be done:
- Interrupts – The host software correctly configures an interrupt service routine to be called when one of the QM’s accumulators has popped descriptors from a queue and placed the descriptor pointers into a host buffer.
- Polling – Reading one of the QM’s registers to see that descriptors have arrived. There are several ways to do this, some of them are:
- Reading the queue’s Que N Reg D register until it returns a non-NULL descriptor pointer.
- Reading the queue’s Que N Reg A register until it returns a non-zero count.
- Reading the queue’s corresponding Queue Pend register looking for a 1 bit in the correct bit of the register. If polling a large number of queues, making a local copy of the queue pend register with EDMA prior to polling should dramatically lower the number of processors stalls.