[dpdk-dev] [PATCH 1/2] net/bnxt: fix resource qcap list handling

Ajit Khaparde ajit.khaparde at broadcom.com
Fri Jul 30 07:36:11 CEST 2021


From: Jay Ding <jay.ding at broadcom.com>

The size of resource qcap list could be different when FW
and application are not match. Application should be able
to handle it when the FW is older and the size of qcap is
smaller.

This patch is needed for backward compatibility on older
firmware versions.

Fixes: 873661aa641a1 ("net/bnxt: support shared session")
Cc: stable at dpdk.org
Signed-off-by: Jay Ding <jay.ding at broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher at broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/tf_core/tf_msg.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bnxt/tf_core/tf_msg.c b/drivers/net/bnxt/tf_core/tf_msg.c
index 6717710dbd..e07d9168be 100644
--- a/drivers/net/bnxt/tf_core/tf_msg.c
+++ b/drivers/net/bnxt/tf_core/tf_msg.c
@@ -440,18 +440,18 @@ tf_msg_session_resc_qcaps(struct tf *tfp,
 	 * Should always get expected number of entries
 	 */
 	if (tfp_le_to_cpu_32(resp.size) != size) {
-		TFP_DRV_LOG(ERR,
-			    "%s: QCAPS message size error, rc:%s\n",
+		TFP_DRV_LOG(WARNING,
+			    "%s: QCAPS message size error, rc:%s, request %d vs response %d\n",
 			    tf_dir_2_str(dir),
-			    strerror(EINVAL));
-		rc = -EINVAL;
-		goto cleanup;
+			    strerror(EINVAL),
+			    size,
+			    resp.size);
 	}
 
 	/* Post process the response */
 	data = (struct tf_rm_resc_req_entry *)qcaps_buf.va_addr;
 
-	for (i = 0; i < size; i++) {
+	for (i = 0; i < resp.size; i++) {
 		query[i].type = tfp_le_to_cpu_32(data[i].type);
 		query[i].min = tfp_le_to_cpu_16(data[i].min);
 		query[i].max = tfp_le_to_cpu_16(data[i].max);
-- 
2.21.1 (Apple Git-122.3)



More information about the dev mailing list