From owner-freebsd-hackers Fri Sep 21 11: 6:51 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id DB08637B40E; Fri, 21 Sep 2001 11:06:45 -0700 (PDT) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id OAA19032; Fri, 21 Sep 2001 14:06:39 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.3/8.9.1) id f8LI6DX37320; Fri, 21 Sep 2001 14:06:13 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15275.33173.594275.19570@grasshopper.cs.duke.edu> Date: Fri, 21 Sep 2001 14:06:13 -0400 (EDT) To: tlambert2@mindspring.com Cc: Luigi Rizzo , hackers@freebsd.org, wpaul@freebsd.org Subject: Re: any reason to use m_devget in the "dc" driver ? 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> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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