net/bnxt: fix memory allocation for command response
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Sat, 20 Mar 2021 06:49:17 +0000 (12:19 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Mon, 22 Mar 2021 18:27:47 +0000 (19:27 +0100)
commit4f1d8fdc3f4234857c1e78af564fcfd92f602f70
tree075baf0b6b96d226dcef5212fa9cfac0c11f7b5d
parent29ce7059e8e7307ac27ff94e7a46035f38d3f97e
net/bnxt: fix memory allocation for command response

Driver re-allocates memory for the command response buffer
when the installed firmware version is newer (and has a larger
max response length) than the version of HWRM that was used to
build the PMD.

This change helps to avoid the re-allocation by allocating the
memory for the command response buffer with PAGE_SIZE.

Coverity issue: 366256, 366204, 366180
Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_hwrm.c