From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1355045BAC; Wed, 23 Oct 2024 08:33:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 049FC40E27; Wed, 23 Oct 2024 08:33:04 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 8E0F540E27 for ; Wed, 23 Oct 2024 08:33:02 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4XYK1b4TPbz1T7qh; Wed, 23 Oct 2024 14:30:59 +0800 (CST) Received: from kwepemm600004.china.huawei.com (unknown [7.193.23.242]) by mail.maildlp.com (Postfix) with ESMTPS id 1208D140360; Wed, 23 Oct 2024 14:33:01 +0800 (CST) Received: from [10.67.121.59] (10.67.121.59) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 23 Oct 2024 14:33:00 +0800 Message-ID: Date: Wed, 23 Oct 2024 14:32:59 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v2 2/2] net/hns3: fix pointer offset To: Jie Hai , CC: , Chengwen Feng , , References: <20241021020040.24805-1-haijie1@huawei.com> <20241022040113.2746-1-haijie1@huawei.com> <20241022040113.2746-3-haijie1@huawei.com> From: "lihuisong (C)" In-Reply-To: <20241022040113.2746-3-haijie1@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.59] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600004.china.huawei.com (7.193.23.242) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Acked-by: Huisong Li 在 2024/10/22 12:01, Jie Hai 写道: > If the register values of multiple modules are obtained at a time, > the register values are incorrect because the data field to be filled > pointing to a wrong address. Update the pointer offset of data to > get the correct address. > > Fixes: dd4b8bba785f ("net/hns3: support reporting names of registers") > Cc: stable@dpdk.org > > Signed-off-by: Jie Hai > --- > drivers/net/hns3/hns3_regs.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c > index be6929738942..fef904a296c0 100644 > --- a/drivers/net/hns3/hns3_regs.c > +++ b/drivers/net/hns3/hns3_regs.c > @@ -1274,6 +1274,7 @@ hns3_get_dfx_regs(struct hns3_hw *hw, struct rte_dev_reg_info *regs, uint32_t mo > if (cmd_descs == NULL) > return -ENOMEM; > > + data += regs->length; > for (i = 0; i < opcode_num; i++) { > opcode = hns3_dfx_reg_opcode_list[i]; > bd_num = bd_num_list[i]; > @@ -1285,7 +1286,6 @@ hns3_get_dfx_regs(struct hns3_hw *hw, struct rte_dev_reg_info *regs, uint32_t mo > if (ret) > break; > > - data += regs->length; > regs_num = hns3_dfx_reg_fetch_data(cmd_descs, bd_num, data); > if (regs_num != hns3_reg_lists[i].entry_num) { > hns3_err(hw, "Query register number differ from the list for module %s!", > @@ -1294,6 +1294,7 @@ hns3_get_dfx_regs(struct hns3_hw *hw, struct rte_dev_reg_info *regs, uint32_t mo > } > hns3_fill_dfx_regs_name(hw, regs, hns3_reg_lists[i].reg_list, regs_num); > regs->length += regs_num; > + data += regs_num; > } > rte_free(cmd_descs); >