6.4 Programming Errors
Programming Multicore Navigator’s various components can be tedious, and if done incorrectly, may cause dataflow to stop with no alert given. Here are a few things to watch for:
- Queue manager:
- Pushing the same descriptor into the same queue more than once. This corrupts the linking RAM, making it inconsistent with the rest of the queue manager’s internal data for the queue.
- Pushing the same descriptor into more than one queue at the same time. This also will corrupt the linking RAM, causing a loss of data.
- Pushing any descriptor address to a queue where the address is not contained within a descriptor memory region that has been programmed into the queue manager.
- Pushing a descriptor address that is not on an N-word boundary within a programmed memory region, where N-word is the programmed descriptor size.
- Linking host descriptors in an RX FDQ. This should never be done, because the RX DMA will pop descriptors and link them together automatically. The RX DMA does not differentiate between host packet and host buffer type descriptors (it will fill in the fields to create what it needs).
- Incorrect host descriptor linking for TX. The host should create and push a host packet descriptor for each packet. If additional host buffer descriptors are needed because the packet length is too large for the host packet's buffer, then host buffer descriptors should be linked to the Host Packet as needed.
- Programming overlapping descriptor memory regions.
- Not using a consistent physical/virtual memory scheme.
- PKTDMA:
- An RX flow must be programmed for every RX transaction. If the application is directly (or indirectly) driving the PKTDMA’s RX Streaming I/F (infrastructure tests is an example) and a valid RX flow ID is not specified, the RX DMA will substitute the channel number and use it for the RX flow ID. To specify the RX flow from the TX descriptor, fill the SOURCE TAG LO field with the desired RX flow number.
- Trying to reconfigure a TX channel while it is still enabled, or reprogramming an RX flow while any channel that uses it is still enabled. This is a difficult-to-find error.
- There are several error situations that can cause the PKTDMA to suddenly stop processing packets:
- Not pushing a valid DESC_SIZE value when pushing to a PKTDMA Tx queue.
- Pushing a Host descriptor who's packet length field is greater than the sum of all of the linked Host buffers, or if there is a NULL next link encountered prior to the PKTDMA reading the entire packet length number of bytes.
- Pushing a Host descriptor where one of the next links points to itself. If the descriptor is marked to return descriptors individually, this will corrupt the QM as well.
- Giving the PKTDMA any pointer that is illegal (NULL, a pointer to unbacked memory, or a pointer to a memory region for which the PKTDMA does not have access).
- Pushing misaligned descriptors, or linked host descriptors. Misaligned in this context means an address that is not on a descriptor boundary, as programmed into the QMSS Descriptor Region registers. It is mandatory that all descriptors be aligned on a 16 byte boundary so that the 4 least significant bits are always 0.
- Pushing a descriptor with a PS word count larger than that specific PKTDMA is configured for. This is not a software configuration, but one set at SoC design time.
- Receive side starvation. Both Tx and Rx sides of the PKTDMA contain internal FIFOs for storing small amounts of data. If the Rx FDQs become empty and the incoming Tx queue continues to have descriptors, the internal FIFOs quickly fill and Tx processing stops.
- Race conditions that cause conditions 2 through 6 above. This can happen when an application writes valid data to the descriptor, pushes it, and the PKTDMA starts reading it before the application's write has actually landed.
- Accumulator:
- Mismatching the list count mode or list entry size in the accumulator program with how the host code reads the list.
- Not sizing the list correctly. If 100 entries in the list are desired, and a 2-word entry size (regs C and D) is programmed, then the list must be sized appropriately: (100 + 1) × 2 × 2 = 404 words. The pong side begins at word 202.