From: Chengchang Tang Date: Fri, 22 Nov 2019 12:06:22 +0000 (+0800) Subject: net/hns3: fix mailbox response length X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e4eae34a8cac4f8166f9a6c7d87d3b24b973d1fd;p=dpdk.git net/hns3: fix mailbox response length Remove the macro 'HNS3_REG_MSG_DATA_OFFSET' which is used to prevent access violation for response array by limiting the response data length to 4. But the limit value is too short to get some longer information such as 6 byte MAC address. This patch modifies the length of response data from mailbox to allow the response data length to be 8. So that the VF driver could get more data from PF driver by mailbox. Fixes: 463e748964f5 ("net/hns3: support mailbox") Cc: stable@dpdk.org Signed-off-by: Chengchang Tang Signed-off-by: Wei Hu (Xavier) --- diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c index 2bfd97415b..c1647af4bf 100644 --- a/drivers/net/hns3/hns3_mbx.c +++ b/drivers/net/hns3/hns3_mbx.c @@ -24,7 +24,6 @@ #include "hns3_logs.h" #include "hns3_intr.h" -#define HNS3_REG_MSG_DATA_OFFSET 4 #define HNS3_CMD_CODE_OFFSET 2 static const struct errno_respcode_map err_code_map[] = { @@ -320,8 +319,7 @@ hns3_dev_handle_mbx_msg(struct hns3_hw *hw) resp->resp_status = hns3_resp_to_errno(req->msg[3]); temp = (uint8_t *)&req->msg[4]; - for (i = 0; i < HNS3_MBX_MAX_RESP_DATA_SIZE && - i < HNS3_REG_MSG_DATA_OFFSET; i++) { + for (i = 0; i < HNS3_MBX_MAX_RESP_DATA_SIZE; i++) { resp->additional_info[i] = *temp; temp++; }