netdev
[Top] [All Lists]

Re: alignment issues on netif_rx

To: kuznet@xxxxxxxxxxxxx
Subject: Re: alignment issues on netif_rx
From: Donald Becker <becker@xxxxxxxxx>
Date: Tue, 19 Dec 2000 12:43:43 -0500 (EST)
Cc: Jes Sorensen <jes@xxxxxxxxxxxxx>, netdev@xxxxxxxxxxx, davem@xxxxxxxxxx
In-reply-to: <200012191552.SAA14335@xxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Tue, 19 Dec 2000 kuznet@xxxxxxxxxxxxx wrote:

> > Thats why I suggested the misaligned-word loads, otherwise we have to
> > copy both Ethernet and IP/TCP/UDP headers.
> 
> Thats why I suggested to copy a few of headers in a few of weird cases,
> otherwise we have to do misaligned-word loads over all the stack. 8)

You will have to do mis-aligned word loads _somewhere_.

Ethernet cards do not look at the encapsulation type.  They just store the
packet into the receive buffer.  Since almost all Ethernet packets are in DIX
format (2 byte protocol field, no length field), that is the preferred
default alignment.

BTW, a common thought process for descriptor-based cards is
"I'll receive the 14 byte header into one fragment, and then the IP header
will be word aligned in the next fragment."  But every chip that has a
word-alignment-only restriction on the Rx buffers also has a
multiple-of-4-only restriction on the Rx buffer size, so you can't change
the header alignment written out by the hardware.

Donald Becker                           becker@xxxxxxxxx
Scyld Computing Corporation             http://www.scyld.com
410 Severn Ave. Suite 210               Second Generation Beowulf Clusters
Annapolis MD 21403                      410-990-9993


<Prev in Thread] Current Thread [Next in Thread>