]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbe: DCBnl set_all, order of operations fix
authorJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 14:30:40 +0000 (22:30 +0800)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 14:30:40 +0000 (22:30 +0800)
The order of operations is important in DCBnl set_all(). When FCoE
is configured it uses the up2tc map to learn which queues to configure
the hardware offloads on. Therefore we need to setup the map before
configuring FCoE.

This is only seen when the both up2tc mappings and APP info are
configured simultaneously.

(backported from commit 4909fe979c4863bb748cd35e2cec9aab1e140a10)
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/ixgbe/ixgbe_dcb_nl.c

index 27634c7dcdc2ead2ed14141b383fbead9d46e0f0..9ece5a66f9cfef8e60438d7f96c44e5f06ba3dcd 100644 (file)
@@ -309,6 +309,27 @@ static void ixgbe_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority,
        *setting = adapter->dcb_cfg.tc_config[priority].dcb_pfc;
 }
 
+#ifdef IXGBE_FCOE
+static void ixgbe_dcbnl_devreset(struct net_device *dev)
+{
+       struct ixgbe_adapter *adapter = netdev_priv(dev);
+
+       while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state))
+               usleep_range(1000, 2000);
+
+       if (netif_running(dev))
+               dev->netdev_ops->ndo_stop(dev);
+
+       ixgbe_clear_interrupt_scheme(adapter);
+       ixgbe_init_interrupt_scheme(adapter);
+
+       if (netif_running(dev))
+               dev->netdev_ops->ndo_open(dev);
+
+       clear_bit(__IXGBE_RESETTING, &adapter->state);
+}
+#endif
+
 static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
 {
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
@@ -338,27 +359,6 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
        if (ret)
                return DCB_NO_HW_CHG;
 
-#ifdef IXGBE_FCOE
-       if (up && !(up & (1 << adapter->fcoe.up)))
-               adapter->dcb_set_bitmap |= BIT_APP_UPCHG;
-
-       /*
-        * Only take down the adapter if an app change occurred. FCoE
-        * may shuffle tx rings in this case and this can not be done
-        * without a reset currently.
-        */
-       if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
-               while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state))
-                       usleep_range(1000, 2000);
-
-               adapter->fcoe.up = ffs(up) - 1;
-
-               if (netif_running(netdev))
-                       netdev->netdev_ops->ndo_stop(netdev);
-               ixgbe_clear_interrupt_scheme(adapter);
-       }
-#endif
-
        if (adapter->dcb_cfg.pfc_mode_enable) {
                switch (adapter->hw.mac.type) {
                case ixgbe_mac_82599EB:
@@ -385,15 +385,6 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
                }
        }
 
-#ifdef IXGBE_FCOE
-       if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
-               ixgbe_init_interrupt_scheme(adapter);
-               if (netif_running(netdev))
-                       netdev->netdev_ops->ndo_open(netdev);
-               ret = DCB_HW_CHG_RST;
-       }
-#endif
-
        if (adapter->dcb_set_bitmap & (BIT_PG_TX|BIT_PG_RX)) {
                u16 refill[MAX_TRAFFIC_CLASS], max[MAX_TRAFFIC_CLASS];
                u8 bwg_id[MAX_TRAFFIC_CLASS], prio_type[MAX_TRAFFIC_CLASS];
@@ -442,8 +433,14 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
        if (adapter->dcb_cfg.pfc_mode_enable)
                adapter->hw.fc.current_mode = ixgbe_fc_pfc;
 
-       if (adapter->dcb_set_bitmap & BIT_APP_UPCHG)
-               clear_bit(__IXGBE_RESETTING, &adapter->state);
+#ifdef IXGBE_FCOE
+       if (up && !(up & (1 << adapter->fcoe.up))) {
+               adapter->fcoe.up = ffs(up) - 1;
+               ixgbe_dcbnl_devreset(netdev);
+               ret = DCB_HW_CHG_RST;
+       }
+#endif
+
        adapter->dcb_set_bitmap = 0x00;
        return ret;
 }