DPDK patches and discussions
 help / color / mirror / Atom feed
From: "lihuisong (C)" <lihuisong@huawei.com>
To: Jie Hai <haijie1@huawei.com>, <dev@dpdk.org>
Cc: <huangdengdui@huawei.com>,
	Chengwen Feng <fengchengwen@huawei.com>, <ferruh.yigit@amd.com>,
	<thomas@monjalon.net>
Subject: Re: [PATCH v2 2/2] net/hns3: fix pointer offset
Date: Wed, 23 Oct 2024 14:32:59 +0800	[thread overview]
Message-ID: <e742f4d3-1250-df0e-087a-a2b34d8bf368@huawei.com> (raw)
In-Reply-To: <20241022040113.2746-3-haijie1@huawei.com>

Acked-by: Huisong Li <lihuisong@huawei.com>

在 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 <haijie1@huawei.com>
> ---
>   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);
>   

      parent reply	other threads:[~2024-10-23  6:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  2:00 [PATCH] net/hns3: fix variable type Jie Hai
2024-10-22  4:01 ` [PATCH v2 0/2] net/hns3: bugfix on register dump Jie Hai
2024-10-22  4:01   ` [PATCH v2 1/2] net/hns3: fix variable type Jie Hai
2024-10-22  6:32     ` fengchengwen
2024-10-23  6:32     ` lihuisong (C)
2024-10-22  4:01   ` [PATCH v2 2/2] net/hns3: fix pointer offset Jie Hai
2024-10-22  6:32     ` fengchengwen
2024-10-23  6:32     ` lihuisong (C) [this message]

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=e742f4d3-1250-df0e-087a-a2b34d8bf368@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=ferruh.yigit@amd.com \
    --cc=haijie1@huawei.com \
    --cc=huangdengdui@huawei.com \
    --cc=thomas@monjalon.net \
    /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).