aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ixgbe/ixgbe.c
diff options
context:
space:
mode:
authorOleg Bulyzhin <oleg@FreeBSD.org>2013-11-05 09:46:01 +0000
committerOleg Bulyzhin <oleg@FreeBSD.org>2013-11-05 09:46:01 +0000
commitba36d317f6c47585e26503ed831cfc68ffb44ee0 (patch)
tree86c36e18533d6eadf14b8b09cc6035255c8a6f4c /sys/dev/ixgbe/ixgbe.c
parent3e0f3c1e42683c00f49cc2fc0a933b52f26806eb (diff)
downloadsrc-ba36d317f6c47585e26503ed831cfc68ffb44ee0.tar.gz
src-ba36d317f6c47585e26503ed831cfc68ffb44ee0.zip
Notes
Diffstat (limited to 'sys/dev/ixgbe/ixgbe.c')
-rw-r--r--sys/dev/ixgbe/ixgbe.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c
index 3e1471d2d565..1245fc87c97c 100644
--- a/sys/dev/ixgbe/ixgbe.c
+++ b/sys/dev/ixgbe/ixgbe.c
@@ -1253,9 +1253,6 @@ ixgbe_init_locked(struct adapter *adapter)
IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1);
}
- /* Set up VLAN support and filter */
- ixgbe_setup_vlan_hw_support(adapter);
-
/* Enable Receive engine */
rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
if (hw->mac.type == ixgbe_mac_82598EB)
@@ -1339,6 +1336,9 @@ ixgbe_init_locked(struct adapter *adapter)
/* Initialize the FC settings */
ixgbe_start_hw(hw);
+ /* Set up VLAN support and filter */
+ ixgbe_setup_vlan_hw_support(adapter);
+
/* And now turn on interrupts */
ixgbe_enable_intr(adapter);
@@ -4688,7 +4688,7 @@ ixgbe_register_vlan(void *arg, struct ifnet *ifp, u16 vtag)
bit = vtag & 0x1F;
adapter->shadow_vfta[index] |= (1 << bit);
++adapter->num_vlans;
- ixgbe_init_locked(adapter);
+ ixgbe_setup_vlan_hw_support(adapter);
IXGBE_CORE_UNLOCK(adapter);
}
@@ -4715,7 +4715,7 @@ ixgbe_unregister_vlan(void *arg, struct ifnet *ifp, u16 vtag)
adapter->shadow_vfta[index] &= ~(1 << bit);
--adapter->num_vlans;
/* Re-init to load the changes */
- ixgbe_init_locked(adapter);
+ ixgbe_setup_vlan_hw_support(adapter);
IXGBE_CORE_UNLOCK(adapter);
}
@@ -4737,6 +4737,20 @@ ixgbe_setup_vlan_hw_support(struct adapter *adapter)
if (adapter->num_vlans == 0)
return;
+ /* Setup the queues for vlans */
+ for (int i = 0; i < adapter->num_queues; i++) {
+ rxr = &adapter->rx_rings[i];
+ /* On 82599 the VLAN enable is per/queue in RXDCTL */
+ if (hw->mac.type != ixgbe_mac_82598EB) {
+ ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i));
+ ctrl |= IXGBE_RXDCTL_VME;
+ IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl);
+ }
+ rxr->vtag_strip = TRUE;
+ }
+
+ if ((ifp->if_capenable & IFCAP_VLAN_HWFILTER) == 0)
+ return;
/*
** A soft reset zero's out the VFTA, so
** we need to repopulate it now.
@@ -4755,18 +4769,6 @@ ixgbe_setup_vlan_hw_support(struct adapter *adapter)
if (hw->mac.type == ixgbe_mac_82598EB)
ctrl |= IXGBE_VLNCTRL_VME;
IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, ctrl);
-
- /* Setup the queues for vlans */
- for (int i = 0; i < adapter->num_queues; i++) {
- rxr = &adapter->rx_rings[i];
- /* On 82599 the VLAN enable is per/queue in RXDCTL */
- if (hw->mac.type != ixgbe_mac_82598EB) {
- ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i));
- ctrl |= IXGBE_RXDCTL_VME;
- IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl);
- }
- rxr->vtag_strip = TRUE;
- }
}
static void