[PATCH iwl-next 1/10] ice: translate FW to SW for max num TCs encoding

Aleksandr Loktionov
2026-04-10T07:49:26Z

From: Dave Ertman <david.m.ertman@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
to the DCBNL interface instead of 8.

Add a translation when interfacing with the FW to use 0x0 as the value
for 8 max TCs.

Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@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 7be1fa7..f15c6fe 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 da57497..285c5f6 100644
--- a/drivers/net/ethernet/intel/ice/ice_dcb.h
+++ b/drivers/net/ethernet/intel/ice/ice_dcb.h
@@ -109,6 +109,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.52.0