From owner-freebsd-current@FreeBSD.ORG Fri Aug 1 10:45:23 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FB2A37B401 for ; Fri, 1 Aug 2003 10:45:23 -0700 (PDT) Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5A9443FA3 for ; Fri, 1 Aug 2003 10:45:21 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from strings.polstra.com (strings.polstra.com [206.213.73.20]) by wall.polstra.com (8.12.3p2/8.12.3) with ESMTP id h71HjJfK063197 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2003 10:45:19 -0700 (PDT) (envelope-from jdp@strings.polstra.com) Received: (from jdp@localhost) by strings.polstra.com (8.12.6/8.12.6/Submit) id h71HjJgA071872; Fri, 1 Aug 2003 10:45:19 -0700 (PDT) (envelope-from jdp) Date: Fri, 1 Aug 2003 10:45:19 -0700 (PDT) Message-Id: <200308011745.h71HjJgA071872@strings.polstra.com> To: current@freebsd.org From: John Polstra In-Reply-To: <20030801173748.04C7343F85@mx1.FreeBSD.org> References: <20030801173748.04C7343F85@mx1.FreeBSD.org> Organization: Polstra & Co., Seattle, WA X-Bogosity: No, tests=bogofilter, spamicity=0.499988, version=0.11.2 cc: pmedwards@eircom.net Subject: Re: bge & vlan stranges X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2003 17:45:23 -0000 In article <20030801173748.04C7343F85@mx1.FreeBSD.org>, Peter Edwards wrote: > John Polstra wrote: > > Peter Edwards wrote: > > > > CSR_WRITE_4(sc, BGE_RX_MTU, ifp->if_mtu + > > > > ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN); > > > Good guess, but the approved way of doing it is to add this code > > near the point where IFCAP_VLAN_MTU is set: > > > > ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); > > > > See "sys/dev/fxp/if_fxp.c" for an example that works. > > Sorry for being obtuse, but just to clarify: No, you are right. I didn't read the posting carefully enough. Sorry! > fxp just seems to have an "allow long frames" flag, rather than a "max > frame size" > register in the hardware, so you never seem to have to tell the hardware the max > size of a frame it needs to accept. I assume you mean, that after > setting if_hdrlen, > you still need to write to the PCI register, like this: > CSR_WRITE_4(sc, BGE_RX_MTU, > ifp->if_mtu + ifp->if_hdrlen + ETHER_CRC_LEN); Yes, you probably do have to do that. I think you also have to set if_data.ifi_hdrlen as I said, or the MTU as understood by the rest of the system will come out 4 bytes too short. But I'm just speaking from memory without any actual experiments to back up what I'm saying. :-} Thanks for the correction! John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Two buttocks cannot avoid friction." -- Malawi saying