net/ice/base: set max number of TCs per port to 4
authorLeyi Rong <leyi.rong@intel.com>
Wed, 19 Jun 2019 15:18:03 +0000 (23:18 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 28 Jun 2019 18:31:48 +0000 (20:31 +0200)
On devices with more than 4 ports, the maximum number of TCs per port is
limited to 4.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/base/ice_common.c

index 4618568..81eab7e 100644 (file)
@@ -2092,6 +2092,18 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count,
                        break;
                }
        }
+
+       /* Re-calculate capabilities that are dependent on the number of
+        * physical ports; i.e. some features are not supported or function
+        * differently on devices with more than 4 ports.
+        */
+       if (caps && (ice_hweight32(caps->valid_functions) > 4)) {
+               /* Max 4 TCs per port */
+               caps->maxtc = 4;
+               ice_debug(hw, ICE_DBG_INIT,
+                         "%s: TC max = %d (based on #ports)\n", prefix,
+                         caps->maxtc);
+       }
 }
 
 /**