From: "Wei Hu (Xavier)" <xavier.huwei@tom.com>
To: dev@dpdk.org, stable@dpdk.org
Cc: xavier_huwei@163.com, xavier.huwei@tom.com, huwei87@hisilicon.com
Subject: [dpdk-dev] [PATCH 4/6] net/hns3: fix the error length limit of maiblox response
Date: Fri, 22 Nov 2019 20:06:22 +0800 [thread overview]
Message-ID: <20191122120624.4963-5-xavier.huwei@tom.com> (raw)
In-Reply-To: <20191122120624.4963-1-xavier.huwei@tom.com>
From: Chengchang Tang <tangchengchang@hisilicon.com>
This patch removes the macro 'HNS3_REG_MSG_DATA_OFFSET' which is used to
prevent the array from accessing violation and it limits the response data
length to be 4. but the limit value is too short to get some longer
information such as 6 byte MAC address.
This patch modify the length of response data from mailbox to allows the
response data length to be 8. So that the VF driver could get more data
from PF drvier 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>
---
drivers/net/hns3/hns3_mbx.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c
index 2bfd97415..c1647af4b 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++;
}
--
2.23.0
next prev parent reply other threads:[~2019-11-22 14:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 12:06 [dpdk-dev] [PATCH 0/6] Fixes for hns3 PMD driver Wei Hu (Xavier)
2019-11-22 12:06 ` [dpdk-dev] [PATCH 1/6] net/hns3: fix RSS hardware configuration restore failure Wei Hu (Xavier)
2019-11-22 12:06 ` [dpdk-dev] [PATCH 2/6] net/hns3: fix VF configuration table entries " Wei Hu (Xavier)
2019-11-22 15:42 ` Ferruh Yigit
2019-11-22 12:06 ` [dpdk-dev] [PATCH 3/6] net/hns3: fix the failure sending packets less than 60 bytes Wei Hu (Xavier)
2019-11-22 12:06 ` Wei Hu (Xavier) [this message]
2019-11-22 12:06 ` [dpdk-dev] [PATCH 5/6] net/hns3: fix the strategy of getting link status for VF Wei Hu (Xavier)
2019-11-22 12:06 ` [dpdk-dev] [PATCH 6/6] net/hns3: fix duplicate VLAN Wei Hu (Xavier)
2019-11-22 16:31 ` [dpdk-dev] [PATCH 0/6] Fixes for hns3 PMD driver Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191122120624.4963-5-xavier.huwei@tom.com \
--to=xavier.huwei@tom.com \
--cc=dev@dpdk.org \
--cc=huwei87@hisilicon.com \
--cc=stable@dpdk.org \
--cc=xavier_huwei@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).