Please pay attention to fix bug kern/141285
Pyun YongHyeon
pyunyh at gmail.com
Fri Mar 19 17:47:40 UTC 2010
On Fri, Mar 19, 2010 at 10:44:50AM -0700, Pyun YongHyeon wrote:
> On Fri, Mar 19, 2010 at 04:40:44PM +0200, Prokofyev S.P. wrote:
> > Hi ALL !
> >
> > Please pay attention to fix bug kern/141285(kern/141843) !
> >
>
> igb(4) also has a similar issue but it seems igb(4) does not even
> advertise IFCAP_VLAN_HWFILTER capability. igb(4) may have to remove
> VLAN event handler or should implement IFCAP_VLAN_HWFILTER to
> support VLAN hardware filtering.
>
> I have a patch for the hardware VLAN filtering of em(4). But it
> wouldn't address the issue reported in the PR. The root cause of
> issue was em(4) wants to reset controller whenever new VLAN is
> registered/unregistered. I'm not sure this is requirement of
> hardware. If this is requirement of hardware there is no way to
> avoid the controller reset unless you disable vlanhwfilter feature.
>
> #ifconfig em0 -vlanhwfilter
>
> em(4) in HEAD disabled VLAN hardware filtering by default so if you
> use that version you wouldn't encounter the issue again. Attached
> patch is small diff for VLAN hardware filtering which tries to
> avoid unnecessary controller reset and added missing lock. If
> hardware allows dynamic changing of VLAN filtering table we could
> completely bypass the controller reset. Jack may know the details.
Oops, posted old patch. Here is new one.
-------------- next part --------------
Index: sys/dev/e1000/if_em.c
===================================================================
--- sys/dev/e1000/if_em.c (revision 205300)
+++ sys/dev/e1000/if_em.c (working copy)
@@ -4652,10 +4652,15 @@
index = (vtag >> 5) & 0x7F;
bit = vtag & 0x1F;
+ EM_CORE_LOCK(adapter);
em_shadow_vfta[index] |= (1 << bit);
++adapter->num_vlans;
/* Re-init to load the changes */
- em_init(adapter);
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
+ (ifp->if_capabilities & IFCAP_VLAN_HWFILTER) != 0 &&
+ (ifp->if_capenable & IFCAP_VLAN_HWFILTER) != 0)
+ em_init_locked(adapter);
+ EM_CORE_UNLOCK(adapter);
}
/*
@@ -4676,10 +4681,15 @@
index = (vtag >> 5) & 0x7F;
bit = vtag & 0x1F;
+ EM_CORE_LOCK(adapter);
em_shadow_vfta[index] &= ~(1 << bit);
--adapter->num_vlans;
/* Re-init to load the changes */
- em_init(adapter);
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
+ (ifp->if_capabilities & IFCAP_VLAN_HWFILTER) != 0 &&
+ (ifp->if_capenable & IFCAP_VLAN_HWFILTER) != 0)
+ em_init_locked(adapter);
+ EM_CORE_UNLOCK(adapter);
}
static void
More information about the freebsd-net
mailing list