Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Aug 2003 18:37:46 +0100
From:      "Peter Edwards" <pmedwards@eircom.net>
To:        John Polstra <jdp@polstra.com>, current@freebsd.org
Subject:   Re: bge & vlan stranges
Message-ID:  <20030801173748.04C7343F85@mx1.FreeBSD.org>

next in thread | raw e-mail | index | archive | help
John Polstra <jdp@polstra.com> wrote:
> Peter Edwards  <pmedwards@eircom.net> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030801173748.04C7343F85>