Date: Sat, 22 Sep 2001 07:58:25 +0200 (CEST) From: Luigi Rizzo <luigi@info.iet.unipi.it> To: tlambert2@mindspring.com Cc: Andrew Gallatin <gallatin@cs.duke.edu>, hackers@freebsd.org, wpaul@freebsd.org Subject: Re: any reason to use m_devget in the "dc" driver ? Message-ID: <200109220558.HAA64949@info.iet.unipi.it> In-Reply-To: <3BAC2910.90CE4265@mindspring.com> from Terry Lambert at "Sep 21, 2001 11:00:48 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
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 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?200109220558.HAA64949>