Donald Becker wrote:
>
> 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.
Sounds like it might also break 802.1Q/P, since it has a slightly
larger header (18 bytes total). If you could detect 802.1Q before
you pulled the header, then you could do variable-length pulls, but
that doesn't sound like much fun...
Ben
>
> 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
--
Ben Greear (greearb@xxxxxxxxxxxxxxx) http://www.candelatech.com
Author of ScryMUD: scry.wanfear.com 4444 (Released under GPL)
http://scry.wanfear.com http://scry.wanfear.com/~greear
|