DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/hns3: fix variable type
@ 2024-10-21  2:00 Jie Hai
  2024-10-22  4:01 ` [PATCH v2 0/2] net/hns3: bugfix on register dump Jie Hai
  0 siblings, 1 reply; 8+ messages in thread
From: Jie Hai @ 2024-10-21  2:00 UTC (permalink / raw)
  To: dev, thomas, ferruh.yigit, Yisen Zhuang, Chengwen Feng; +Cc: lihuisong, haijie1

The patch fixes variable type in case of data trunction.

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c
index e8bc7fbc66e1..be6929738942 100644
--- a/drivers/net/hns3/hns3_regs.c
+++ b/drivers/net/hns3/hns3_regs.c
@@ -1178,9 +1178,9 @@ hns3_direct_access_tqp_regs_help(struct hns3_hw *hw, struct rte_dev_reg_info *re
 				 uint32_t modules, enum hns3_reg_modules idx)
 {
 	const struct hns3_dirt_reg_entry *reg_list;
-	uint16_t tqp_num, reg_offset;
+	uint32_t reg_num, i, j, reg_offset;
 	uint32_t *data = regs->data;
-	uint32_t reg_num, i, j;
+	uint16_t tqp_num;
 
 	if ((modules & HNS3_MODULE_MASK(idx)) == 0)
 		return;
-- 
2.22.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 0/2] net/hns3: bugfix on register dump
  2024-10-21  2:00 [PATCH] net/hns3: fix variable type Jie Hai
@ 2024-10-22  4:01 ` Jie Hai
  2024-10-22  4:01   ` [PATCH v2 1/2] net/hns3: fix variable type Jie Hai
  2024-10-22  4:01   ` [PATCH v2 2/2] net/hns3: fix pointer offset Jie Hai
  0 siblings, 2 replies; 8+ messages in thread
From: Jie Hai @ 2024-10-22  4:01 UTC (permalink / raw)
  To: dev, thomas, ferruh.yigit; +Cc: lihuisong, fengchengwen, haijie1, huangdengdui



Jie Hai (2):
  net/hns3: fix variable type
  net/hns3: fix pointer offset

 drivers/net/hns3/hns3_regs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

-- 
2.22.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/2] net/hns3: fix variable type
  2024-10-22  4:01 ` [PATCH v2 0/2] net/hns3: bugfix on register dump Jie Hai
@ 2024-10-22  4:01   ` 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
  1 sibling, 2 replies; 8+ messages in thread
From: Jie Hai @ 2024-10-22  4:01 UTC (permalink / raw)
  To: dev, thomas, ferruh.yigit, Yisen Zhuang, Chengwen Feng
  Cc: lihuisong, haijie1, huangdengdui

The patch fixes variable type in case of data trunction.

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c
index e8bc7fbc66e1..be6929738942 100644
--- a/drivers/net/hns3/hns3_regs.c
+++ b/drivers/net/hns3/hns3_regs.c
@@ -1178,9 +1178,9 @@ hns3_direct_access_tqp_regs_help(struct hns3_hw *hw, struct rte_dev_reg_info *re
 				 uint32_t modules, enum hns3_reg_modules idx)
 {
 	const struct hns3_dirt_reg_entry *reg_list;
-	uint16_t tqp_num, reg_offset;
+	uint32_t reg_num, i, j, reg_offset;
 	uint32_t *data = regs->data;
-	uint32_t reg_num, i, j;
+	uint16_t tqp_num;
 
 	if ((modules & HNS3_MODULE_MASK(idx)) == 0)
 		return;
-- 
2.22.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] net/hns3: fix pointer offset
  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  4:01   ` Jie Hai
  2024-10-22  6:32     ` fengchengwen
  2024-10-23  6:32     ` lihuisong (C)
  1 sibling, 2 replies; 8+ messages in thread
From: Jie Hai @ 2024-10-22  4:01 UTC (permalink / raw)
  To: dev, thomas, ferruh.yigit, Yisen Zhuang, Chengwen Feng
  Cc: lihuisong, haijie1, huangdengdui

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);
 
-- 
2.22.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] net/hns3: fix variable type
  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)
  1 sibling, 0 replies; 8+ messages in thread
From: fengchengwen @ 2024-10-22  6:32 UTC (permalink / raw)
  To: Jie Hai, dev, thomas, ferruh.yigit, Yisen Zhuang; +Cc: lihuisong, huangdengdui

Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 2024/10/22 12:01, Jie Hai wrote:
> The patch fixes variable type in case of data trunction.
> 
> 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 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c
> index e8bc7fbc66e1..be6929738942 100644
> --- a/drivers/net/hns3/hns3_regs.c
> +++ b/drivers/net/hns3/hns3_regs.c
> @@ -1178,9 +1178,9 @@ hns3_direct_access_tqp_regs_help(struct hns3_hw *hw, struct rte_dev_reg_info *re
>  				 uint32_t modules, enum hns3_reg_modules idx)
>  {
>  	const struct hns3_dirt_reg_entry *reg_list;
> -	uint16_t tqp_num, reg_offset;
> +	uint32_t reg_num, i, j, reg_offset;
>  	uint32_t *data = regs->data;
> -	uint32_t reg_num, i, j;
> +	uint16_t tqp_num;
>  
>  	if ((modules & HNS3_MODULE_MASK(idx)) == 0)
>  		return;


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] net/hns3: fix pointer offset
  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)
  1 sibling, 0 replies; 8+ messages in thread
From: fengchengwen @ 2024-10-22  6:32 UTC (permalink / raw)
  To: Jie Hai, dev, thomas, ferruh.yigit, Yisen Zhuang; +Cc: lihuisong, huangdengdui

Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 2024/10/22 12:01, Jie Hai wrote:
> 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>
> ---


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] net/hns3: fix variable type
  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)
  1 sibling, 0 replies; 8+ messages in thread
From: lihuisong (C) @ 2024-10-23  6:32 UTC (permalink / raw)
  To: Jie Hai, dev; +Cc: huangdengdui, Chengwen Feng, ferruh.yigit, thomas

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

在 2024/10/22 12:01, Jie Hai 写道:
> The patch fixes variable type in case of data trunction.
>
> 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 | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c
> index e8bc7fbc66e1..be6929738942 100644
> --- a/drivers/net/hns3/hns3_regs.c
> +++ b/drivers/net/hns3/hns3_regs.c
> @@ -1178,9 +1178,9 @@ hns3_direct_access_tqp_regs_help(struct hns3_hw *hw, struct rte_dev_reg_info *re
>   				 uint32_t modules, enum hns3_reg_modules idx)
>   {
>   	const struct hns3_dirt_reg_entry *reg_list;
> -	uint16_t tqp_num, reg_offset;
> +	uint32_t reg_num, i, j, reg_offset;
>   	uint32_t *data = regs->data;
> -	uint32_t reg_num, i, j;
> +	uint16_t tqp_num;
>   
>   	if ((modules & HNS3_MODULE_MASK(idx)) == 0)
>   		return;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] net/hns3: fix pointer offset
  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)
  1 sibling, 0 replies; 8+ messages in thread
From: lihuisong (C) @ 2024-10-23  6:32 UTC (permalink / raw)
  To: Jie Hai, dev; +Cc: huangdengdui, Chengwen Feng, ferruh.yigit, thomas

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);
>   

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-10-23  6:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).