From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 09730A04C3; Fri, 22 Nov 2019 15:16:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 744902C30; Fri, 22 Nov 2019 15:15:59 +0100 (CET) Received: from smtp.tom.com (smtprz15.163.net [106.3.154.248]) by dpdk.org (Postfix) with ESMTP id 0366E2C28 for ; Fri, 22 Nov 2019 13:06:35 +0100 (CET) Received: from my-app01.tom.com (my-app01.tom.com [127.0.0.1]) by freemail01.tom.com (Postfix) with ESMTP id 341511C81A35 for ; Fri, 22 Nov 2019 20:06:39 +0800 (CST) Received: from my-app01.tom.com (HELO smtp.tom.com) ([127.0.0.1]) by my-app01 (TOM SMTP Server) with SMTP ID -1349614957 for ; Fri, 22 Nov 2019 20:06:39 +0800 (CST) Received: from antispam1.tom.com (unknown [172.25.16.55]) by freemail01.tom.com (Postfix) with ESMTP id 2FEAB1C81A1F for ; Fri, 22 Nov 2019 20:06:39 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tom.com; s=201807; t=1574424399; bh=AFMbcsaxDpXf5dmmWxXvPLa9tCdQDu8PXc5Jyfm5SMI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wk3gwpP7hZz3Tx1wZQwPIgp4PVbcatb1IXyShnHbWPKpJbDbBACKWqEIyzJhkBf5W bqWDw1BqKTu180hrcxUZQJNXw7rns6tDvHyxBOLrHEcbk7s0O0Xhq12R7cJgfdgl5a SjZmDU4mwXtIYMpy7oX1QXjScnLFlNnCpwcFyTvs= Received: from antispam1.tom.com (antispam1.tom.com [127.0.0.1]) by antispam1.tom.com (Postfix) with ESMTP id 3269310015E5 for ; Fri, 22 Nov 2019 20:06:10 +0800 (CST) X-Virus-Scanned: Debian amavisd-new at antispam1.tom.com Received: from antispam1.tom.com ([127.0.0.1]) by antispam1.tom.com (antispam1.tom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RHusw63Ekf4H for ; Fri, 22 Nov 2019 20:06:08 +0800 (CST) Received: from localhost.localdomain (unknown [203.160.91.226]) by antispam1.tom.com (Postfix) with ESMTPA id 417D91001825; Fri, 22 Nov 2019 20:06:08 +0800 (CST) From: "Wei Hu (Xavier)" To: dev@dpdk.org, stable@dpdk.org Cc: xavier_huwei@163.com, xavier.huwei@tom.com, huwei87@hisilicon.com Date: Fri, 22 Nov 2019 20:06:22 +0800 Message-Id: <20191122120624.4963-5-xavier.huwei@tom.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191122120624.4963-1-xavier.huwei@tom.com> References: <20191122120624.4963-1-xavier.huwei@tom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 22 Nov 2019 15:15:52 +0100 Subject: [dpdk-dev] [PATCH 4/6] net/hns3: fix the error length limit of maiblox response X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Chengchang Tang 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 Signed-off-by: Wei Hu (Xavier) --- 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