net/bnxt: fix initialization with old firmware

Fix the resource qcap list handling to use size based on
FW response.
The size of resource qcap list could be different when FW
and application are not matching. Application should be able
to handle this scenario when the FW is older and the size of
qcap is smaller. Failure to do this causes initialization failure.

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

Fixes: 873661aa64 ("net/bnxt: support shared session")
Cc: stable@dpdk.org

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
Jay Ding 2021-07-20 14:40:27 +00:00 committed by Ajit Khaparde
parent 6922655cad
commit c18b1b1f99

View File

@ -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);