Author: oleg
Date: Tue Nov 19 14:24:25 2013
New Revision: 258346
URL: http://svnweb.freebsd.org/changeset/base/258346

Log:
  MFC: 257695
  
  - Fix link loss on vlan reconfiguration.
  - Fix issues with 'vlanhwfilter'.
  
  Approved by:  re (glebius)

Modified:
  stable/10/sys/dev/ixgbe/ixgbe.c
Directory Properties:
  stable/10/sys/   (props changed)

Modified: stable/10/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- stable/10/sys/dev/ixgbe/ixgbe.c     Tue Nov 19 13:32:24 2013        
(r258345)
+++ stable/10/sys/dev/ixgbe/ixgbe.c     Tue Nov 19 14:24:25 2013        
(r258346)
@@ -1253,9 +1253,6 @@ ixgbe_init_locked(struct adapter *adapte
                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 *adapte
        /* 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);
 
@@ -4691,7 +4691,7 @@ ixgbe_register_vlan(void *arg, struct if
        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);
 }
 
@@ -4718,7 +4718,7 @@ ixgbe_unregister_vlan(void *arg, struct 
        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);
 }
 
@@ -4740,6 +4740,20 @@ ixgbe_setup_vlan_hw_support(struct adapt
        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.
@@ -4758,18 +4772,6 @@ ixgbe_setup_vlan_hw_support(struct adapt
        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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to