Skip to contentSkip to conversation

ice: Fix DSCP PFC TLV creation

PATCH In review Karen Ostrowska 4 participants 4 messages Jan 25, 2023 – Jan 27, 2023

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

PATCH 1/1 ice: Fix DSCP PFC TLV creation

From: Dave Ertman <[email protected]>

When creating the TLV to send to the FW for configuring DSCP mode PFC, the PFCENABLE field was being masked with a 4 bit mask (0xF), but this is an 8 bit bitmask for enabled classes for PFC. This means that traffic classes 4-7 could not be enabled for PFC.

Remove the mask completely, as it is not necessary, as we are assigning 8bits to an 8 bit field.

Fixes 2a87bd73e50d("ice: Add DSCP support")
---
 drivers/net/ethernet/intel/ice/ice_dcb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_dcb.c +1 -1
index 6be02f9b0b8c..789b99963910 100644
@@ -1372,7 +1372,7 @@ ice_add_dscp_pfc_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
 	tlv->ouisubtype = htonl(ouisubtype);
 
 	buf[0] = dcbcfg->pfc.pfccap & 0xF;
-	buf[1] = dcbcfg->pfc.pfcena & 0xF;
+	buf[1] = dcbcfg->pfc.pfcena;
 }
 
 /**
Signature · 6 lines
2.31.1

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
maintainer
#1 lore raw
Quoted 8 lines · Karen Ostrowska

From: Dave Ertman<[email protected]>

When creating the TLV to send to the FW for configuring DSCP mode PFC, the PFCENABLE field was being masked with a 4 bit mask (0xF), but this is an 8 bit bitmask for enabled classes for PFC. This means that traffic classes 4-7 could not be enabled for PFC.

Quoted 4 lines

Remove the mask completely, as it is not necessary, as we are assigning 8bits to an 8 bit field.

Fixes 2a87bd73e50d("ice: Add DSCP support")

Fixes tag: Fixes: 2a87bd73e50d("ice: Add DSCP support")

Has these problem(s):

- missing space between the SHA1 and the subject

Quoted 11 lines
---
  drivers/net/ethernet/intel/ice/ice_dcb.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_dcb.c +0 -0
index 6be02f9b0b8c..789b99963910 100644

drivers/net/ethernet/intel/ice/ice_dcb.c ice_add_dscp_pfc_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg) · line 1375

Quoted 5 lines
drivers/net/ethernet/intel/ice/ice_dcb.c +1 -1
@@ -1372,7 +1372,7 @@ ice_add_dscp_pfc_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
  	tlv->ouisubtype = htonl(ouisubtype);
 
  	buf[0] = dcbcfg->pfc.pfccap & 0xF;
-	buf[1] = dcbcfg->pfc.pfcena & 0xF;
+	buf[1] = dcbcfg->pfc.pfcena;

Also, I don't believe I saw a response to Michal's question:

What about pfc.pfccap? Shouldn't we also remove the mask?

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#2 lore raw
Quoted 4 lines

From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, January 25, 2023 3:36 PM
To: Ostrowska, Karen <[email protected]>; [email protected]; [email protected]
Subject: Re: [Intel-wired-lan] [PATCH net v1] ice: Fix DSCP PFC TLV creation

...

Quoted 5 lines

drivers/net/ethernet/intel/ice/ice_dcb.c ice_add_dscp_pfc_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg) · line 1375

Quoted 3 lines
	buf[0] = dcbcfg->pfc.pfccap & 0xF;
drivers/net/ethernet/intel/ice/ice_dcb.c +1 -1
-	buf[1] = dcbcfg->pfc.pfcena & 0xF;
+	buf[1] = dcbcfg->pfc.pfcena;

Also, I don't believe I saw a response to Michal's question:
What about pfc.pfccap? Shouldn't we also remove the mask?

pfc.pfccap is not a bitmap like pfc.pfcena is. pfc.pfccap is a count value 0-8, so any value in the upper 4 bits is not desirable.

DaveE
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#3 lore raw
In reply to Karen Ostrowska

Dear Karen,

Thank you for the patch.

Am 25.01.23 um 17:01 schrieb Karen Ostrowska:

Quoted 10 lines

From: Dave Ertman <[email protected]>

When creating the TLV to send to the FW for configuring DSCP mode PFC, the PFCENABLE field was being masked with a 4 bit mask (0xF), but this is an 8 bit bitmask for enabled classes for PFC. This means that traffic classes 4-7 could not be enabled for PFC.

Remove the mask completely, as it is not necessary, as we are assigning 8bits to an 8 bit field.

Please reflow the text to use the full 75 characters of allowed text width.

Please add a space in “8 bits”.

Quoted 1 line
Fixes 2a87bd73e50d("ice: Add DSCP support")

Please add a space after the commit hash before the (.

Quoted 11 lines
---
  drivers/net/ethernet/intel/ice/ice_dcb.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_dcb.c +0 -0
index 6be02f9b0b8c..789b99963910 100644

drivers/net/ethernet/intel/ice/ice_dcb.c ice_add_dscp_pfc_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg) · line 1378

Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_dcb.c +1 -1
@@ -1372,7 +1372,7 @@ ice_add_dscp_pfc_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
  	tlv->ouisubtype = htonl(ouisubtype);
 
  	buf[0] = dcbcfg->pfc.pfccap & 0xF;
-	buf[1] = dcbcfg->pfc.pfcena & 0xF;
+	buf[1] = dcbcfg->pfc.pfcena;
  }
 
  /**

Kind regards,

Paul
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan