From: Dave Ertman <davi…@intel.com> The FW uses a 3-bit field in a TLV to represent the maximum number of Traffic Classes supported per interface. Since the maximum value is 8, and at least one TC must be supported, the encoding uses bit values of 000 to represent 8 TCs. The driver currently does not translate this value and reports 0 max TCs instead of 8. Add a translation when interfacing with the FW to use 0x0 as the value for 8 max TCs. This value is used for reporting only; configuration uses the hardware capabilities so no configuration issues are seen due to this. Signed-off-by: Dave Ertman <davi…@intel.com> Signed-off-by: Aleksandr Loktionov <alek…@intel.com> Reviewed-by: Simon Horman <hor…@kernel.org> Tested-by: Alexander Nowlin <alex…@intel.com> Signed-off-by: Tony Nguyen <anth…@intel.com> --- drivers/net/ethernet/intel/ice/ice_dcb.c | 2 ++ drivers/net/ethernet/intel/ice/ice_dcb.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_dcb.c b/drivers/net/ethernet/intel/ice/ice_dcb.c index abea84f14658..a6e988ab9f61 100644 --- a/drivers/net/ethernet/intel/ice/ice_dcb.c +++ b/drivers/net/ethernet/intel/ice/ice_dcb.c @@ -221,6 +221,8 @@ ice_parse_ieee_etscfg_tlv(struct ice_lldp_org_tlv *tlv, etscfg->willing = FIELD_GET(ICE_IEEE_ETS_WILLING_M, buf[0]); etscfg->cbs = FIELD_GET(ICE_IEEE_ETS_CBS_M, buf[0]); etscfg->maxtcs = FIELD_GET(ICE_IEEE_ETS_MAXTC_M, buf[0]); + if (etscfg->maxtcs == ICE_DCB_MAXTC_ENCODE) + etscfg->maxtcs = ICE_DCB_MAXTC; /* Begin parsing at Priority Assignment Table (offset 1 in buf) */ ice_parse_ieee_ets_common_tlv(&buf[1], etscfg); diff --git a/drivers/net/ethernet/intel/ice/ice_dcb.h b/drivers/net/ethernet/intel/ice/ice_dcb.h index be34650a77d5..c8b642ace797 100644 --- a/drivers/net/ethernet/intel/ice/ice_dcb.h +++ b/drivers/net/ethernet/intel/ice/ice_dcb.h @@ -101,6 +101,9 @@ #define ICE_DSCP_TC_BW_TLV_LEN 25 #define ICE_DSCP_PFC_TLV_LEN 6 +#define ICE_DCB_MAXTC 8 +#define ICE_DCB_MAXTC_ENCODE 0x0 + /* IEEE 802.1AB LLDP Organization specific TLV */ struct ice_lldp_org_tlv { __be16 typelen;
-- 2.47.1