From: Leyi Rong Date: Wed, 19 Jun 2019 15:18:03 +0000 (+0800) Subject: net/ice/base: set max number of TCs per port to 4 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b965268f82c24c33b5362ba534b8f2b01f6be6d2;p=dpdk.git net/ice/base: set max number of TCs per port to 4 On devices with more than 4 ports, the maximum number of TCs per port is limited to 4. Signed-off-by: Bruce Allan Signed-off-by: Paul M Stillwell Jr Signed-off-by: Leyi Rong Acked-by: Qi Zhang --- diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 4618568274..81eab7ecc4 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -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); + } } /**