Skip to content

Commit 6d39ea1

Browse files
dmertmananguy11
authored andcommitted
ice: Fix problems with DSCP QoS implementation
The patch that implemented DSCP QoS implementation removed a bandwidth check that was used to check for a specific condition caused by some corner cases. This check should not of been removed. The same patch also added a check for when the DCBx state could be changed in relation to DSCP, but the check was erroneously added nested in a check for CEE mode, which made the check useless. Fix these problems by re-adding the bandwidth check and relocating the DSCP mode check earlier in the function that changes DCBx state in the driver. Fixes: 2a87bd7 ("ice: Add DSCP support") Reported-by: kernel test robot <[email protected]> Signed-off-by: Dave Ertman <[email protected]> Tested-by: Gurucharan G <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 2657e16 commit 6d39ea1

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

drivers/net/ethernet/intel/ice/ice_dcb_nl.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ static int ice_dcbnl_setets(struct net_device *netdev, struct ieee_ets *ets)
9797

9898
new_cfg->etscfg.maxtcs = pf->hw.func_caps.common_cap.maxtc;
9999

100+
if (!bwcfg)
101+
new_cfg->etscfg.tcbwtable[0] = 100;
102+
100103
if (!bwrec)
101104
new_cfg->etsrec.tcbwtable[0] = 100;
102105

@@ -167,15 +170,18 @@ static u8 ice_dcbnl_setdcbx(struct net_device *netdev, u8 mode)
167170
if (mode == pf->dcbx_cap)
168171
return ICE_DCB_NO_HW_CHG;
169172

170-
pf->dcbx_cap = mode;
171173
qos_cfg = &pf->hw.port_info->qos_cfg;
172-
if (mode & DCB_CAP_DCBX_VER_CEE) {
173-
if (qos_cfg->local_dcbx_cfg.pfc_mode == ICE_QOS_MODE_DSCP)
174-
return ICE_DCB_NO_HW_CHG;
174+
175+
/* DSCP configuration is not DCBx negotiated */
176+
if (qos_cfg->local_dcbx_cfg.pfc_mode == ICE_QOS_MODE_DSCP)
177+
return ICE_DCB_NO_HW_CHG;
178+
179+
pf->dcbx_cap = mode;
180+
181+
if (mode & DCB_CAP_DCBX_VER_CEE)
175182
qos_cfg->local_dcbx_cfg.dcbx_mode = ICE_DCBX_MODE_CEE;
176-
} else {
183+
else
177184
qos_cfg->local_dcbx_cfg.dcbx_mode = ICE_DCBX_MODE_IEEE;
178-
}
179185

180186
dev_info(ice_pf_to_dev(pf), "DCBx mode = 0x%x\n", mode);
181187
return ICE_DCB_HW_CHG_RST;

0 commit comments

Comments
 (0)