5.0 Buffer Management (Continued)
and the buffer size to 762 words (1524 bytes). A similar
example for 16-bit mode would be EOBC
e
759 words
(1518 bytes) and the buffer size set to 760 words (1520
bytes). The buffer can be any size, but as long as the EOBC
is 2 words, for 32-bit mode, or 1 word, for 16-bit mode, less
than the buffer size, only one packet will be buffered in that
RBA.
Note 1: It is possible to filter out most oversized packets by setting the buff-
er size to 760 words (1520 bytes) in 32-bit mode or 759 words (1518
bytes) in 16-bit mode. EOBC would be set to 758 words (1516
bytes) for both cases. With this configuration, any packet over 1520
bytes, in 32-bit mode, or 1518 bytes, in 16-bit mode, will not be
completely buffered because the packet will overflow the buffer.
When a packet overflow occurs, a Receive Buffer Area Exceeded
interrupt (RBAE in the Interrupt Status Register, Section 6.3.6) will
occur.
Note 2: When buffering one packet per buffer, it is suggested that the val-
ues in Note 1 above be used. Since the minimum legal sized Ethernet packet is 64 bytes, however, it is possible to set EOBC as much
as 64 bytes less than the buffer size and still end up with one packet
per buffer.
Figure 5-11
shows this ‘‘range.’’
5.4.5 Beginning Of Reception
At the beginning of reception, the SONIC-T checks its internally stored EOL bit from the previous RXpkt.link field for a
‘‘1’’. If the SONIC-T finds EOL
e
1, it recognizes that after
the previous reception, there were no more remaining receive packet descriptors. It re-reads the same RXpkt.link
field to check if the system has updated this field since the
last reception. If the SONIC-T still finds EOL
e
1, reception
ceases. (See Section 5.5 for adding descriptors to the list.)
Otherwise, the SONIC-T begins storing the packet in the
RBA starting at the Current Receive Buffer Address
(CRBA0,1) registers and continues until the packet has
completed. Concurrent with the packet reception, the Remaining Buffer Word Count (RBWC0,1) registers are decremented after each word is written to memory. This register
determines the remaining words in the RBA at the end of
reception.
5.4.6 End Of Packet Processing
At the end of a reception, the SONIC-T enters its end of
packet processing sequence to determine whether to accept or reject the packet based on receive errors and packet size. At the end of reception the SONIC-T enters one of
the following two sequences:
Ð Successful reception sequence
Ð Buffer recovery for runt packets or packets with errors
5.4.6.1 Successful Reception
If the SONIC-T accepts the packet, it first writes 5 words of
descriptor information in the RDA beginning at the address
pointed to by the Current Receive Descriptor Address
(CRDA) register. It then reads the RXpkt.link field to advance the CRDA register to the next receive descriptor. The
SONIC-T also checks the EOL bit for a ‘‘1’’ in this field. If
EOL
e
1, no more descriptors are available for the SONIC-T.
The SONIC-T recovers the address of the current RXpkt.link
field (from a temporary register) and generates a ‘‘Receive
Descriptors Exhausted’’ indication in the Interrupt Status
register. (See Section 5.4.7 on how to add descriptors.) The
SONIC-T maintains ownership of the descriptor by
not
writ-
ing to the RXpkt.inÐuse field. Otherwise, if EOL
e
0, the
SONIC-T advances the CRDA register to the next descriptor
and resets the RXpkt.inÐuse field to all ‘‘0’s’’.
The SONIC-T accesses the complete 7 word RDA descriptor in a single block operation.
The SONIC-T also checks if there is remaining space in the
RBA. The SONIC-T compares the Remaining Buffer Word
Count (RBWC0,1) registers with the static End Of Buffer
Count (EOBC). If the RBWC is less than the EOBC, a maximum sized packet will no longer fit in the remaining space in
the RBA; hence, the SONIC-T fetches a resource descriptor
from the RRA and loads its registers with the pointer and
word count of the next available RBA.
5.4.6.2 Buffer Recovery For Runt Packets Or
Packets With Errors
If a runt packet (less than 64 bytes) or packet with errors
arrives and the Receive Control register has been configured to not accept these packets, the SONIC-T recovers its
pointers back to the original positions. The CRBA0,1 registers are not advanced and the RBWC0,1 registers are not
decremented. The SONIC-T recovers its pointers by maintaining a copy of the buffer address in the Temporary Receive Buffer Address registers (TRBA0,1). The SONIC-T recovers the value in the RBWC0,1 registers from the Temporary Buffer Word Count registers (TBWC0,1).
5.4.7 Overflow Conditions
When an overflow condition occurs, the SONIC-T halts its
DMA operations to prevent writing into unauthorized memory. The SONIC-T uses the Interrupt Status register (ISR) to
indicate three possible overflow conditions that can occur
TL/F/11719– 22
Range of EOBCe(RXrsrc.wc0,1b2 to RXrsrc.wc0,1b32)
FIGURE 5-11. Setting EOBC for Single Packet RBA
30