Date: Fri, 29 Jan 2010 18:13:44 +0000 From: Marco van Tol <marco@tols.org> To: FreeBSD STABLE <freebsd-stable@freebsd.org> Subject: Re: em interface slow down on 8.0R Message-ID: <20100129181344.GH23403@goofy.tols.org> In-Reply-To: <2a41acea1001290945m77e9ae18if927716d82e50b2f@mail.gmail.com> 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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
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
[-- Attachment #2 --]
--- 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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100129181344.GH23403>
