ATNGW100 Atmel, ATNGW100 Datasheet - Page 3

KIT AVR32 NETWORK GATEWAY

ATNGW100

Manufacturer Part Number
ATNGW100
Description
KIT AVR32 NETWORK GATEWAY
Manufacturer
Atmel
Series
AVR®32r
Type
MCUr
Datasheets

Specifications of ATNGW100

Contents
Board and Linux Dev. and Debug Toolchain
Processor To Be Evaluated
AT32AP7000
Data Bus Width
32 bit
Interface Type
RS-232, Ethernet, USB
Silicon Manufacturer
Atmel
Core Architecture
AVR
Core Sub-architecture
AVR UC3
Silicon Core Number
AT32AP7000
Silicon Family Name
AVR
Kit Contents
Board CD Docs
Rohs Compliant
Yes
For Use With/related Products
AT32AP7000, AT32AP7001, AT32AP7002
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATNGW100
Manufacturer:
Atmel
Quantity:
135
3.2 Optimization 1: Offset the first RX buffer by two bytes
3.3 Optimization 2: Use non-coherent memory as RX buffers
3.4 Optimization 3: Avoid copying of fragments into the linear data area
32066A-AVR32-02/08
As the Linux networking stack processes the incoming packets, data is copied from
the fragments into the linear data area as needed. The code parsing the Ethernet
header, however, does not do this, so a minimum of 14 bytes must be copied into the
linear data area by the driver.
An Ethernet header is 14 bytes long. This is not a multiple of 4, so if the packet data
is word-aligned initially, whatever comes after the Ethernet header will not be,
resulting in poor performance. The existing MACB driver solves this by adding two
bytes of padding to the SKB data area, making the Ethernet payload properly word-
aligned. However, since the DMA buffer does not have the same padding, the source
and destination buffers will be aligned differently when the data is copied, resulting in
poor performance of the copy operation itself.
The MACB controller includes a RBOFF field in the NCFG register which specifies the
amount of padding to be added before a packet is stored in RAM. For packets that
span multiple buffers, this padding is only added to the first buffer. By specifying 2
bytes of padding in this field and adjusting the RX copying code accordingly, a minor
performance increase is expected due to faster memcpy performance.
Even though this optimization may not increase performance much by itself, it is a
prerequisite for the last optimization where the buffers are passed up the stack as-is.
The MACB driver currently uses coherent, i.e. non-cacheable, memory to store the
RX data. This simplifies the code a bit because there’s no need for any cache
synchronization with such buffers, but it may also give suboptimal performance. By
mapping the RX DMA buffers in non-coherent, cacheable memory, the CPU will be
able to do burst accesses to transfer data from memory into the data cache.
The second patch replaces the coherent DMA buffers with regular pages obtained
from the page allocator. Since each MACB receive buffer is 128 bytes and the default
page size is 4096 bytes, each of these pages map 32 RX buffers.
Using single pages as receive buffers is also a prerequisite for the third optimization
since the SKB fragment list consists of a list of single pages.
When one or more packets have been received, the current incarnation of the MACB
driver scans the receive DMA descriptors and copies all the 128-byte DMA buffers
that make up a packet into the linear data area of the SKB. The last optimization aims
to avoid this copying by passing one or more references to the DMA buffers
themselves up the stack.
Since Optimization 2 already replaced the single contiguous, coherent DMA buffer
with multiple single pages, this becomes relatively straightforward. An SKB is
allocated with just enough room for the Ethernet header plus the alignment padding.
Then, each page that covers one or more of the receive buffers is added to the
fragment list, after having its reference count incremented using
the Ethernet header is copied into the linear data area and the page offset and size of
the first fragment is adjusted so that it doesn’t cover the Ethernet header anymore.
When the SKB isn’t needed anymore,
buffer and decrementing the reference count of all the pages in the fragment list using
kfree_skb
() is called, freeing the linear data
get_page()
AVR32705
. Finally,
3

Related parts for ATNGW100