ixgbe: dcb: up2tc mapping lost on disable/enable CEE DCB state
authorJohn Fastabend <john.r.fastabend@intel.com>
Sat, 28 Jan 2012 01:22:35 +0000 (01:22 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 9 Feb 2012 09:27:41 +0000 (01:27 -0800)
Users expect the up2tc mapping to be maintained across a DCB
enable/disable/enable transition. And since we maintain all
the other DCB attributes we should do this for up2tc mappings
as well just to be consistent. Also without this we break
user space applications that expect this to occur that
previously worked.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c

index 005e5f25600dcd65302d6e5c72a1521309f73cb3..79a92fe987b997d203d6afde03f428bed78bb7fb 100644 (file)
@@ -112,6 +112,8 @@ static u8 ixgbe_dcbnl_get_state(struct net_device *netdev)
 static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
 {
        u8 err = 0;
+       u8 prio_tc[MAX_USER_PRIORITY] = {0};
+       int i;
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
 
        /* Fail command if not in CEE mode */
@@ -122,10 +124,15 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
        if (!!state != !(adapter->flags & IXGBE_FLAG_DCB_ENABLED))
                return err;
 
-       if (state > 0)
+       if (state > 0) {
                err = ixgbe_setup_tc(netdev, adapter->dcb_cfg.num_tcs.pg_tcs);
-       else
+               ixgbe_dcb_unpack_map(&adapter->dcb_cfg, DCB_TX_CONFIG, prio_tc);
+       } else {
                err = ixgbe_setup_tc(netdev, 0);
+       }
+
+       for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
+               netdev_set_prio_tc_map(netdev, i, prio_tc[i]);
 
        return err;
 }