I probably missed some emails ?
In any case i was only concerned about the additional copy
done by m_devget when the controller can already DMA into
an mbuf, and there are no alignment constraints.

        cheers
        luigi

> Andrew Gallatin wrote:
> >  > 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.
> 
> You're missing the point.  You do the m_devget() only when
> you decide to do a checksum, which means you've decided to handle
> the packet yourself.  The alignment is done via a copy of the
> header field; specifically, a byte copy of the protocol type,
> when you decide how to handle it.
> 
> In the case of the bridge, it's very easy: you don't care about
> the contents of the packet, unless it's destined for you.  For
> a router, you are operating above layer 2, so you _do_ care,
> and must hterefore do the checksum to be correct (since you
> should not reference the field contents without knowledge that
> the checksum is correct).  The Cisco approach of ignoring the
> checksums is all well and good, if the work is being done in
> hardware, but for most software, it very definitely cares (it's
> more overhead to relay bad packets onto your network, even if
> you assume it's OK for a router to do that).
> 
> -- Terry
> 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to