GT-64260A Design Guide
Doc. No. MV-S300165-00, Rev. A
CONFIDENTIAL
Copyright © 2002 Marvell
Page 64
Document Classification: Proprietary Information
May 21, 2002, Preliminary
Although similar, the MPSC SDMA and the Ethernet SDMA differ in the SDMA descriptors’ command status field
(different for each protocol) and the Tx descriptors’ shadow Byte Count field. The descriptors are 16 byte in size
and do not require enormous processing resources.
It’s recommended to allocate the descriptors in a non-cached region. If the descriptors are allocated in a cache-
able region, memory coherency must be guaranteed.
For efficient use, descriptors are managed in a chain list.
Tx Descriptors
It is recommended to use the Tx descriptors in a cyclical chained list to reduce software overhead.
For better performance, use two pointers for each Tx descriptors queue. One of the pointers always points to the
next available descriptor. In this way, packets are prepared for transmission without waiting for the previous pack-
ets to its transmission.
The second pointer is used to release the Tx descriptors after transmit ends.
For improved descriptor manipulation, extra fields can be added to the Tx descriptors. The additional field must be
an integer factor of the descriptor size. For example,
typedef struct SdmaTxDesc
{
unsigned int bytecnt:16;
unsigned int shadow:16;
TX_COMMAND cmd_sts;
unsigned int next_desc_ptr;
unsigned int buf_ptr;
/* extra field - where the source buffer taken from */
unsigned int pointerToRxQueue;
/* extra field - help to release used buffers */
unsigned int shadowOwner:1; /* if 1 -> belong to the GT */
} TX_DESC;
ShadowOwner is an extra 1-bit field which determines if this descriptor is released. This is because a Tx descrip-
tor is owned by the CPU has no indication whether it’s free or should be released, by the CPU after sending a
packet.
Before sending a packet, the shadowOwner field is marked as SHADOW_OWNER_BY_CPU (defined as ’0’). This
is the indictor to free this descriptor. After the descriptor is freed, this field is marked as
SHADOW_OWNER_BY_GT (defined as ’1’).
Rx Descriptors
It is recommended to use the Rx descriptors in a long chain terminated with two descriptors owned by the CPU.
The last descriptor is a dummy used to avoid a NULL pointer. The descriptor before the last one is the tail.
The software holds two pointers. The head is the first descriptor in the list and the tail is the last descriptor before
the dummy descriptor. (See
.)