Skip to contentSkip to conversation

net/bnxt: fix completion metadata format type for Thor

PATCH Superseded Manish Kurup 1 participant 2 messages Oct 5 – Oct 20 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bnxt: fix completion metadata format type for Thor

From: Shuanglin Wang <[email protected]>

For Thor, the default RX completion record metadata format should be set to Type 1 instead of Type 3. Using the wrong type causes the driver to misinterpret completion records.

Fixes 0c036a1485b9 ("net/bnxt/tf_ulp: optimize with inline and prediction")
---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +6 -3
index a75da8aa19..70e5700833 100644
@@ -480,10 +480,13 @@ bnxt_ulp_port_init(struct bnxt *bp)
 	/* Make sure that custom header data is selected */
 	if (dev_id > BNXT_ULP_DEVICE_ID_WH_PLUS) {
 		struct bnxt_vnic_info *vnic = bp->vnic_info;
-		vnic->metadata_format = HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_3;
+		if (dev_id == BNXT_ULP_DEVICE_ID_THOR2)
+			vnic->metadata_format = HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_3;
+		else
+			vnic->metadata_format = HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_1;
 		rc = bnxt_hwrm_vnic_update(bp,
-					vnic,
-					HWRM_VNIC_UPDATE_INPUT_ENABLES_METADATA_FORMAT_TYPE_VALID);
+				vnic,
+				HWRM_VNIC_UPDATE_INPUT_ENABLES_METADATA_FORMAT_TYPE_VALID);
 		if (unlikely(rc)) {
 			BNXT_DRV_DBG(ERR, "Failed to set metadata format\n");
 			goto jump_to_error;
Signature · 1 line
2.31.1
#1 lore raw

PATCH v2 1/1 net/bnxt: fix completion metadata format type for Thor

From: Shuanglin Wang <[email protected]>

For Thor, the default RX completion record metadata format should be set to Type 1 instead of Type 3. Using the incorrect type causes the driver to misinterpret the completion records. Thor2 continues to use Type 3.

Fixes dd0191d5e70d ("net/bnxt/tf_ulp: support Thor2 ULP layer")

---
v2:
* Fix the Fixes: tag to point to the commit that introduced the issue (dd0191d5e70d).
* Restore original indentation of the unrelated bnxt_hwrm_vnic_update() arguments.
* Mention that Thor2 keeps Type 3 in the commit message.

 drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +4 -1
index a75da8aa19..99061f5c5e 100644
@@ -480,7 +480,10 @@ bnxt_ulp_port_init(struct bnxt *bp)
 	/* Make sure that custom header data is selected */
 	if (dev_id > BNXT_ULP_DEVICE_ID_WH_PLUS) {
 		struct bnxt_vnic_info *vnic = bp->vnic_info;
-		vnic->metadata_format = HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_3;
+		if (dev_id == BNXT_ULP_DEVICE_ID_THOR2)
+			vnic->metadata_format = HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_3;
+		else
+			vnic->metadata_format = HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_1;
 		rc = bnxt_hwrm_vnic_update(bp,
 					vnic,
 					HWRM_VNIC_UPDATE_INPUT_ENABLES_METADATA_FORMAT_TYPE_VALID);
Signature · 1 line
2.31.1