From owner-freebsd-hackers Mon Jun 24 12:16:45 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by hub.freebsd.org (Postfix) with ESMTP id 6F33137B484 for ; Mon, 24 Jun 2002 12:16:11 -0700 (PDT) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id g5OJG4f39051; Mon, 24 Jun 2002 12:16:04 -0700 (PDT) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.6/8.11.0) id g5OJG3O31261; Mon, 24 Jun 2002 12:16:03 -0700 (PDT) (envelope-from jdp) Date: Mon, 24 Jun 2002 12:16:03 -0700 (PDT) Message-Id: <200206241916.g5OJG3O31261@vashon.polstra.com> To: hackers@freebsd.org From: John Polstra Cc: gallatin@cs.duke.edu Subject: Re: Re: bge driver issue In-Reply-To: <15639.28077.881363.884693@grasshopper.cs.duke.edu> References: <200206231552.g5NFqS002122@pacbell.net> <200206241645.g5OGjZH31049@vashon.polstra.com> <15639.28077.881363.884693@grasshopper.cs.duke.edu> Organization: Polstra & Co., Seattle, WA 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 In article <15639.28077.881363.884693@grasshopper.cs.duke.edu>, Andrew Gallatin wrote: > > If the bge's API allows it, you could setup a receive descriptor with > a length of 14 bytes (size of ethernet header), and start the next > descripter 2 bytes after it (at a 16 byte offset from the front of the > mbuf). When the receive is done, just copy the 14 bytes. That was my first thought too, but unfortunately the device doesn't appear to support scatter-gather for received packets. I had another totally evil idea which isn't really feasible. Empirically, it appears that the buffer has to be aligned to an 8-byte boundary. Also empirically, it seems that when the buffer isn't aligned, only the part before the first 8-byte boundary is corrupted. So we could offset the buffer by 6 bytes. Then the only corruption would be in the first 2 bytes of the packet, i.e., the first two bytes of the destination ethernet address. If we could ignore promiscuous mode and multicast, we could guess those bytes based on our own Ethernet address ... nah, that's Just Too Evil. :-) John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message