From owner-freebsd-bugs@FreeBSD.ORG Sat Mar 13 06:50:15 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3AAA716A4CE for ; Sat, 13 Mar 2004 06:50:15 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3019E43D2D for ; Sat, 13 Mar 2004 06:50:15 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i2DEoFbv012858 for ; Sat, 13 Mar 2004 06:50:15 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i2DEoFUW012854; Sat, 13 Mar 2004 06:50:15 -0800 (PST) (envelope-from gnats) Resent-Date: Sat, 13 Mar 2004 06:50:15 -0800 (PST) Resent-Message-Id: <200403131450.i2DEoFUW012854@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Steinar Haug Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22F1B16A4CE for ; Sat, 13 Mar 2004 06:46:27 -0800 (PST) Received: from bizet.nethelp.no (c510081D9.inet.catch.no [81.0.129.217]) by mx1.FreeBSD.org (Postfix) with SMTP id A347143D41 for ; Sat, 13 Mar 2004 06:46:25 -0800 (PST) (envelope-from sthaug@nethelp.no) Received: (qmail 1786 invoked by uid 1001); 13 Mar 2004 14:46:24 +0000 (GMT) Message-Id: <20040313144624.1785.qmail@bizet.nethelp.no> Date: 13 Mar 2004 14:46:24 +0000 (GMT) From: Steinar Haug To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: sthaug@nethelp.no Subject: kern/64222: if_bfe correction for VLAN MTU X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Steinar Haug List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Mar 2004 14:50:15 -0000 >Number: 64222 >Category: kern >Synopsis: if_bfe correction for VLAN MTU >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Mar 13 06:50:14 PST 2004 >Closed-Date: >Last-Modified: >Originator: Steinar Haug >Release: FreeBSD 4.9-STABLE i386 >Organization: Nethelp Consulting >Environment: System: FreeBSD bizet.nethelp.no 4.9-STABLE FreeBSD 4.9-STABLE #2: Sat Mar 13 15:07:25 CET 2004 sthaug@bizet.nethelp.no:/local/freebsd/stable4/src/sys/compile/BIZET i386 Hardware is Dell Dimension 2400 with Broadcom 10/100 Ethernet onboard. >Description: Configure a VLAN interface (vlan0) with bfe0 as vlandev. Observe that MTU is set to 1496 for vlan0. However, the system is able to *receive* 1500 byte packets - but any outgoing traffic is fragmented if the Ethernet data part is > 1496. >How-To-Repeat: As described above. >Fix: Unified diff included below. It sets ifp->if_data.ifi_hdrlen, the same way that this is done in the fxp driver. With this change, normal 1500 byte packets work fine both receiving and sending. The patch also corrects some other, minor points: - The driver claims that miibus0 is required. This is simply not true, it works fine with standard miibus. - The DRIVER_MODULE name is set to if_bfe, not bfe, to be consistent with other Ethernet drivers. - The ifp->if_baudrate is set to 100M instead of 10M, to be consistent with other Ethernet drivers for 10/100 cards. --- if_bfe.c.diff begins here --- --- if_bfe.c.orig Sat Mar 13 10:05:59 2004 +++ if_bfe.c Sat Mar 13 15:06:43 2004 @@ -84,7 +84,6 @@ MODULE_DEPEND(bfe, ether, 1, 1, 1); MODULE_DEPEND(bfe, miibus, 1, 1, 1); -/* "controller miibus0" required. See GENERIC if you get errors here. */ #include "miibus_if.h" #define BFE_DEVDESC_MAX 64 /* Maximum device description length */ @@ -166,7 +165,7 @@ static devclass_t bfe_devclass; -DRIVER_MODULE(bfe, pci, bfe_driver, bfe_devclass, 0, 0); +DRIVER_MODULE(if_bfe, pci, bfe_driver, bfe_devclass, 0, 0); DRIVER_MODULE(miibus, bfe, miibus_driver, miibus_devclass, 0, 0); /* @@ -420,7 +419,7 @@ ifp->if_watchdog = bfe_watchdog; ifp->if_init = bfe_init; ifp->if_mtu = ETHERMTU; - ifp->if_baudrate = 10000000; + ifp->if_baudrate = 100000000; ifp->if_snd.ifq_maxlen = BFE_TX_QLEN; bfe_get_config(sc); @@ -444,6 +443,11 @@ ether_ifattach(ifp, ETHER_BPF_SUPPORTED); #endif callout_handle_init(&sc->bfe_stat_ch); + + /* + * Tell the upper layer(s) we support long frames. + */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); /* * Hook interrupt last to avoid having to lock softc --- if_bfe.c.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: