From owner-freebsd-current@FreeBSD.ORG Fri Aug 1 10:37:49 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 3AFED37B401 for ; Fri, 1 Aug 2003 10:37:49 -0700 (PDT) Received: from mail04.svc.cra.dublin.eircom.net (mail04.svc.cra.dublin.eircom.net [159.134.118.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 04C7343F85 for ; Fri, 1 Aug 2003 10:37:48 -0700 (PDT) (envelope-from pmedwards@eircom.net) Received: (qmail 26632 messnum 2207416 invoked from network[159.134.237.83/webmail02.eircom.net]); 1 Aug 2003 17:37:46 -0000 Received: from webmail02.eircom.net (HELO webmail.eircom.net) (159.134.237.83) by mail04.svc.cra.dublin.eircom.net (qp 26632) with SMTP; 1 Aug 2003 17:37:46 -0000 From: "Peter Edwards" To: John Polstra , current@freebsd.org Date: Fri, 1 Aug 2003 18:37:46 +0100 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-Originating-IP: 62.17.151.61 X-Mailer: Eircom Net CRC Webmail (http://www.eircom.net/) Organization: Eircom Net (http://www.eircom.net/) Message-Id: <20030801173748.04C7343F85@mx1.FreeBSD.org> 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:37:49 -0000 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: 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); I don't have a bge device, so I can't muck about with it to try.