Skip to contentSkip to conversation

i40e: Fix wrong mask used during DCB config

PATCH In review Ivan Vecera 4 participants 4 messages Nov 30, 2023 – Feb 9, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i40e: Fix wrong mask used during DCB config

Mask used for clearing PRTDCB_RETSTCC register in function i40e_dcb_hw_rx_ets_bw_config() is incorrect as there is used define I40E_PRTDCB_RETSTCC_ETSTC_SHIFT instead of define I40E_PRTDCB_RETSTCC_ETSTC_MASK.

The PRTDCB_RETSTCC register is used to configure whether ETS or strict priority is used as TSA in Rx for particular TC.

In practice it means that once the register is set to use ETS as TSA then it is not possible to switch back to strict priority without CoreR reset.

Fix the value in the clearing mask.

Fixes 90bc8e003be2 ("i40e: Add hardware configuration for software based DCB")
---
 drivers/net/ethernet/intel/i40e/i40e_dcb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_dcb.c +1 -1
index 68602fc375f6..073ffbfcbe8d 100644
@@ -1576,7 +1576,7 @@ void i40e_dcb_hw_rx_ets_bw_config(struct i40e_hw *hw, u8 *bw_share,
 		reg = rd32(hw, I40E_PRTDCB_RETSTCC(i));
 		reg &= ~(I40E_PRTDCB_RETSTCC_BWSHARE_MASK     |
 			 I40E_PRTDCB_RETSTCC_UPINTC_MODE_MASK |
-			 I40E_PRTDCB_RETSTCC_ETSTC_SHIFT);
+			 I40E_PRTDCB_RETSTCC_ETSTC_MASK);
 		reg |= ((u32)bw_share[i] << I40E_PRTDCB_RETSTCC_BWSHARE_SHIFT) &
 			 I40E_PRTDCB_RETSTCC_BWSHARE_MASK;
 		reg |= ((u32)mode[i] << I40E_PRTDCB_RETSTCC_UPINTC_MODE_SHIFT) &
Signature · 1 line
2.41.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Ivan Vecera

Mask used for clearing PRTDCB_RETSTCC register in function i40e_dcb_hw_rx_ets_bw_config() is incorrect as there is used define I40E_PRTDCB_RETSTCC_ETSTC_SHIFT instead of define I40E_PRTDCB_RETSTCC_ETSTC_MASK.

The PRTDCB_RETSTCC register is used to configure whether ETS or strict priority is used as TSA in Rx for particular TC.

In practice it means that once the register is set to use ETS as TSA then it is not possible to switch back to strict priority without CoreR reset.

Fix the value in the clearing mask.

Fixes 90bc8e003be2 ("i40e: Add hardware configuration for software based DCB")
---
  drivers/net/ethernet/intel/i40e/i40e_dcb.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_dcb.c +0 -0
index 68602fc375f6..073ffbfcbe8d 100644

drivers/net/ethernet/intel/i40e/i40e_dcb.c void i40e_dcb_hw_rx_ets_bw_config(struct i40e_hw *hw, u8 *bw_share, · line 1582

Quoted 8 lines
drivers/net/ethernet/intel/i40e/i40e_dcb.c +1 -1
@@ -1576,7 +1576,7 @@ void i40e_dcb_hw_rx_ets_bw_config(struct i40e_hw *hw, u8 *bw_share,
  		reg = rd32(hw, I40E_PRTDCB_RETSTCC(i));
  		reg &= ~(I40E_PRTDCB_RETSTCC_BWSHARE_MASK     |
  			 I40E_PRTDCB_RETSTCC_UPINTC_MODE_MASK |
-			 I40E_PRTDCB_RETSTCC_ETSTC_SHIFT);
+			 I40E_PRTDCB_RETSTCC_ETSTC_MASK);
  		reg |= ((u32)bw_share[i] << I40E_PRTDCB_RETSTCC_BWSHARE_SHIFT) &
  			 I40E_PRTDCB_RETSTCC_BWSHARE_MASK;
  		reg |= ((u32)mode[i] << I40E_PRTDCB_RETSTCC_UPINTC_MODE_SHIFT) &

Thank you!

reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Ivan Vecera
Quoted 8 lines · Ivan Vecera

Mask used for clearing PRTDCB_RETSTCC register in function i40e_dcb_hw_rx_ets_bw_config() is incorrect as there is used define I40E_PRTDCB_RETSTCC_ETSTC_SHIFT instead of define I40E_PRTDCB_RETSTCC_ETSTC_MASK.

The PRTDCB_RETSTCC register is used to configure whether ETS or strict priority is used as TSA in Rx for particular TC.

Quoted 8 lines

In practice it means that once the register is set to use ETS as TSA then it is not possible to switch back to strict priority without CoreR reset.

Fix the value in the clearing mask.

Fixes 90bc8e003be2 ("i40e: Add hardware configuration for software based DCB")
Tested-by on v1 1/1
#3 lore raw
In reply to Ivan Vecera
Quoted 19 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Ivan Vecera
Sent: Friday, December 1, 2023 1:02 AM
To: [email protected]
Cc: moderated list:INTEL ETHERNET DRIVERS <[email protected]>; Brandeburg, Jesse <[email protected]>; Kubalewski, Arkadiusz <[email protected]>; Loktionov, Aleksandr <[email protected]>; Eric Dumazet <[email protected]>; Nguyen, Anthony L <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; David S. Miller <[email protected]>; open list <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net] i40e: Fix wrong mask used during DCB config

Mask used for clearing PRTDCB_RETSTCC register in function i40e_dcb_hw_rx_ets_bw_config() is incorrect as there is used define I40E_PRTDCB_RETSTCC_ETSTC_SHIFT instead of define I40E_PRTDCB_RETSTCC_ETSTC_MASK.

The PRTDCB_RETSTCC register is used to configure whether ETS or strict priority is used as TSA in Rx for particular TC.

In practice it means that once the register is set to use ETS as TSA then it is not possible to switch back to strict priority without CoreR reset.

Quoted 8 lines

Fix the value in the clearing mask.

Fixes 90bc8e003be2 ("i40e: Add hardware configuration for software based DCB")
---
 drivers/net/ethernet/intel/i40e/i40e_dcb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)