summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChengchang Tang <tangchengchang@hisilicon.com>2019-11-22 20:06:22 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-11-26 18:05:15 +0100
commite4eae34a8cac4f8166f9a6c7d87d3b24b973d1fd (patch)
tree4e57d8a84ae4098b211bc972a4d72eced499c20a
parentde620754a10974f810b878f637b1ed9f77ebd7d8 (diff)
downloaddpdk-next-net-intel-e4eae34a8cac4f8166f9a6c7d87d3b24b973d1fd.zip
dpdk-next-net-intel-e4eae34a8cac4f8166f9a6c7d87d3b24b973d1fd.tar.gz
dpdk-next-net-intel-e4eae34a8cac4f8166f9a6c7d87d3b24b973d1fd.tar.xz
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 <tangchengchang@hisilicon.com> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
-rw-r--r--drivers/net/hns3/hns3_mbx.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c
index 2bfd974..c1647af 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++;
}