Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2001 14:06:13 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        tlambert2@mindspring.com
Cc:        Luigi Rizzo <luigi@info.iet.unipi.it>, hackers@freebsd.org, wpaul@freebsd.org
Subject:   Re: any reason to use m_devget in the "dc" driver ?
Message-ID:  <15275.33173.594275.19570@grasshopper.cs.duke.edu>
In-Reply-To: <3BAB7CFD.D5776F77@mindspring.com>
References:  <200109210703.JAA57756@info.iet.unipi.it> <15275.15530.678683.65377@grasshopper.cs.duke.edu> <3BAB7CFD.D5776F77@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Terry Lambert writes:
 > Andrew Gallatin wrote:
 > > I imagine that this was done to follow alignment constraints on
 > > non-i386 platforms where having the ip header misaligned is fatal.
 > > (the tulip is not capable of byte granularity DMA, so you can't
 > > intentionally misalign the ethernet header & end up with an aligned IP
 > > header)
 > 
 > This is the reason: the ethernet header is 14 bytes.
 > 
 > 
 > > I imagine the i386 should be made an exception. See rev 1.17 of
 > > sys/dev/nge/if_nge.c
 > 
 > I disagree with this code; the elemenets in the header
 > are referenced multiple times.  If you are doing the
 > checksum check, you might as well be relocating the data,
 > as well.  The change I would make would be to integrate
 > the checksum calculation with the m_devget(), to ensure
 > a single pass, in the case that m_devget() must be used
 > to get aligned packet payload, and the checksum has not
 > been offloaded to hardware.

Interesting idea... However, what if you're a bridge or a router?
You've just done a whole lot of work for nothing.  I imagine its just
this case that Luigi cares about.

If you want to integrate a checksum & a copy, it should really be done
at the copyout() stage. 

Drew

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15275.33173.594275.19570>