i40e: Support FW CEE DCB UP to TC map nibble swap
authorGreg Bowers <gregory.j.bowers@intel.com>
Fri, 28 Aug 2015 21:55:52 +0000 (17:55 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 8 Oct 2015 23:05:45 +0000 (16:05 -0700)
Changes parsing of AQ command Get CEE DCBX OPER CFG (0x0A07). Change is
required because FW creates the oper_prio_tc nibbles reversed from those
in the CEE Priority Group sub-TLV.

Change-ID: I7d9d8641bb430d30e286fc3fac909866ef8a0de8
Signed-off-by: Greg Bowers <gregory.j.bowers@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_dcb.c

index fbec7d787f9d190e3949c18a3c2b3b1c552c8cf4..6fa07ef1651d8d3aa7d93ef89b8db79ffbb6a85c 100644 (file)
@@ -681,15 +681,18 @@ static void i40e_cee_to_dcb_config(
        /* CEE PG data to ETS config */
        dcbcfg->etscfg.maxtcs = cee_cfg->oper_num_tc;
 
+       /* Note that the FW creates the oper_prio_tc nibbles reversed
+        * from those in the CEE Priority Group sub-TLV.
+        */
        for (i = 0; i < 4; i++) {
-               tc = (u8)((cee_cfg->oper_prio_tc[i] &
-                        I40E_CEE_PGID_PRIO_1_MASK) >>
-                        I40E_CEE_PGID_PRIO_1_SHIFT);
-               dcbcfg->etscfg.prioritytable[i*2] =  tc;
                tc = (u8)((cee_cfg->oper_prio_tc[i] &
                         I40E_CEE_PGID_PRIO_0_MASK) >>
                         I40E_CEE_PGID_PRIO_0_SHIFT);
-               dcbcfg->etscfg.prioritytable[i*2 + 1] = tc;
+               dcbcfg->etscfg.prioritytable[i * 2] =  tc;
+               tc = (u8)((cee_cfg->oper_prio_tc[i] &
+                        I40E_CEE_PGID_PRIO_1_MASK) >>
+                        I40E_CEE_PGID_PRIO_1_SHIFT);
+               dcbcfg->etscfg.prioritytable[i * 2 + 1] = tc;
        }
 
        for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)