From owner-freebsd-stable@FreeBSD.ORG Fri Jan 29 18:13:47 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F6121065670 for ; Fri, 29 Jan 2010 18:13:47 +0000 (UTC) (envelope-from marco@goofy.tols.org) Received: from goofy.tols.org (goofy.tols.org [83.163.60.200]) by mx1.freebsd.org (Postfix) with ESMTP id B85518FC17 for ; Fri, 29 Jan 2010 18:13:46 +0000 (UTC) Received: from goofy.tols.org (localhost [127.0.0.1]) by goofy.tols.org (8.14.3/8.14.3) with ESMTP id o0TIDihW026908 for ; Fri, 29 Jan 2010 18:13:44 GMT (envelope-from marco@goofy.tols.org) Received: (from marco@localhost) by goofy.tols.org (8.14.3/8.14.3/Submit) id o0TIDijb026907 for freebsd-stable@freebsd.org; Fri, 29 Jan 2010 18:13:44 GMT (envelope-from marco) Date: Fri, 29 Jan 2010 18:13:44 +0000 From: Marco van Tol To: FreeBSD STABLE Message-ID: <20100129181344.GH23403@goofy.tols.org> Mail-Followup-To: FreeBSD STABLE References: <147432021001250825p202914a7ka5a2c1d28d96bac3@mail.gmail.com> <20100125182257.GG1187@michelle.cdnetworks.com> <147432021001251038r69393ab3m1a797e58f9fa905a@mail.gmail.com> <02307620-ECDC-4E8B-A5B1-FF8491E226C4@nokia.com> <33c6b0bc1001252031k508426bfh25fad65e9223d87@mail.gmail.com> <147432021001260900p60ed1804t97392d2dff5cd244@mail.gmail.com> <20100128121701.GB9408@goofy.tols.org> <2a41acea1001281116k7d14cc26x120f9960ab14d19d@mail.gmail.com> <20100129133824.GE23403@goofy.tols.org> <2a41acea1001290945m77e9ae18if927716d82e50b2f@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <2a41acea1001290945m77e9ae18if927716d82e50b2f@mail.gmail.com> User-Agent: Mutt/1.4.2.3i Subject: Re: em interface slow down on 8.0R X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2010 18:13:47 -0000 --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 29, 2010 at 09:45:42AM -0800, Jack Vogel wrote: > No need, I set it up and tried it, and I was right, it does not fail if that > routine is not used. The interesting thing is that the igb driver, which > has the same code, works fine. > > In any case, I'm hot on the track of this and hope I can figure it out > today. Ah nice, I found a hole in time to try it as well. I just rebuild a kernel and rebooted. During the reboot I found what you write above. :) Anyways, the attached patch makes it work indeed as you found yourself as well in the mean time. :-) I tried just deleting the call itself at first, but the module is compiled with warnings treated as errors and barfs about a defined but unused function. So in the patch you'll find the entire function removed. Let me know about anything else I can do. I don't have the necessary test equipment at home, so normally I'll need to find a time window to test things. But I'm more then willing to. The version I patch is the following by the way, from 8.0-RELEASE-p2: /*$FreeBSD: src/sys/dev/e1000/if_em.c,v 1.21.2.3.2.1 2009/10/25 01:10:29 kensmith Exp $*/ Thanks so far! Marco -- "Van Duitsers heb je pas gewonnen als ze met de bus de stad uit zijn." - Youp van 't Hek --oyUTqETQ0mS9luUI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="if_em.c.patch" --- sys/dev/e1000/if_em.c.orig 2010-01-29 18:20:46.000000000 +0100 +++ sys/dev/e1000/if_em.c 2010-01-29 18:26:59.000000000 +0100 @@ -289,7 +289,6 @@ #if __FreeBSD_version >= 700029 static void em_register_vlan(void *, struct ifnet *, u16); static void em_unregister_vlan(void *, struct ifnet *, u16); -static void em_setup_vlan_hw_support(struct adapter *); #endif static int em_xmit(struct adapter *, struct mbuf **); static void em_smartspeed(struct adapter *); @@ -1535,17 +1534,12 @@ /* Setup VLAN support, basic and offload if available */ E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN); -#if __FreeBSD_version < 700029 if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { u32 ctrl; ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); ctrl |= E1000_CTRL_VME; E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); } -#else - /* Use real VLAN Filter support */ - em_setup_vlan_hw_support(adapter); -#endif /* Set hardware offload abilities */ ifp->if_hwassist = 0; @@ -4762,44 +4756,6 @@ em_init(adapter); } -static void -em_setup_vlan_hw_support(struct adapter *adapter) -{ - struct e1000_hw *hw = &adapter->hw; - u32 reg; - - /* - ** We get here thru init_locked, meaning - ** a soft reset, this has already cleared - ** the VFTA and other state, so if there - ** have been no vlan's registered do nothing. - */ - if (adapter->num_vlans == 0) - return; - - /* - ** A soft reset zero's out the VFTA, so - ** we need to repopulate it now. - */ - for (int i = 0; i < EM_VFTA_SIZE; i++) - if (em_shadow_vfta[i] != 0) - E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, - i, em_shadow_vfta[i]); - - reg = E1000_READ_REG(hw, E1000_CTRL); - reg |= E1000_CTRL_VME; - E1000_WRITE_REG(hw, E1000_CTRL, reg); - - /* Enable the Filter Table */ - reg = E1000_READ_REG(hw, E1000_RCTL); - reg &= ~E1000_RCTL_CFIEN; - reg |= E1000_RCTL_VFE; - E1000_WRITE_REG(hw, E1000_RCTL, reg); - - /* Update the frame size */ - E1000_WRITE_REG(&adapter->hw, E1000_RLPML, - adapter->max_frame_size + VLAN_TAG_SIZE); -} #endif static void --oyUTqETQ0mS9luUI--