Skip to contentSkip to conversation

common/iavf: fix arq resource leak

PATCH Applied Qiming Chen 3 participants 6 messages Sep 10, 2021 – Sep 27, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/iavf: fix arq resource leak

In the iavf_init_arq function, if an exception occurs in the iavf_config_arq_regs function, and the previously applied arq bufs resource is released. This patch maintains the same modification as the iavf_init_asq function to roll back resources.

Fixes 87aca6d8d8a4 ("net/iavf/base: fix command buffer memory leak")
---
 drivers/common/iavf/iavf_adminq.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/common/iavf/iavf_adminq.c +5 -1
index 0bf5af0cbe..9c36e8908e 100644
@@ -417,7 +417,7 @@ enum iavf_status iavf_init_arq(struct iavf_hw *hw)
 	/* initialize base registers */
 	ret_code = iavf_config_arq_regs(hw);
 	if (ret_code != IAVF_SUCCESS)
-		goto init_adminq_free_rings;
+		goto init_config_regs;
 
 	/* success! */
 	hw->aq.arq.count = hw->aq.num_arq_entries;
@@ -425,6 +425,10 @@ enum iavf_status iavf_init_arq(struct iavf_hw *hw)
 
 init_adminq_free_rings:
 	iavf_free_adminq_arq(hw);
+	return ret_code;
+
+init_config_regs:
+	iavf_free_arq_bufs(hw);
 
 init_adminq_exit:
 	return ret_code;
Signature · 1 line
2.30.1.windows.1
#1 lore raw
Quoted 13 lines

-----Original Message-----
From: stable <[email protected]> On Behalf Of Qiming Chen
Sent: Friday, September 10, 2021 11:13
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>; Qiming Chen <[email protected]>; [email protected]
Subject: [dpdk-stable] [PATCH] common/iavf: fix arq resource leak

In the iavf_init_arq function, if an exception occurs in the iavf_config_arq_regs function, and the previously applied arq bufs resource is released. This patch maintains the same modification as the iavf_init_asq function to roll back resources.

Quoted 8 lines
Fixes 87aca6d8d8a4 ("net/iavf/base: fix command buffer memory leak")
---
 drivers/common/iavf/iavf_adminq.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Can't image that you ARE superman to cover ixgbe,ixgbevf, i40e, now iavf.

It MUST BE done by some code scan tool, I don't believe you have real time to read the whole code. Right ?

Sometimes, Defensive programming is good, but ... I prefer to the PMD can run well every time, if failed, it must have some bugs.

Quoted 2 lines

--
2.30.1.windows.1

#2 lore raw

Thanks your reply.

You are right. The resource leak is indeed scanned by tools, and then manually confirmed whether it is a problem. Our team has been developing and maintaining for many years. Because the company process is not perfect,
the bug has not been promoted to the community, resulting in a lot of accumulation. I am currently Complete these things step by step.

In the near future, I hope you will give more guidance and maintain the dpdk intel driver together.

#3 lore raw

Thanks for the tool.

Anyway, please setup your mail firstly.

Your mail reply is bad for community, you can see what it looks like:
http://patchwork.dpdk.org/project/dpdk/patch/[email protected]/

The right reply is as:
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/

I’ve told you before: REPLY WITH plain text format, and REPLY inline.

BR,
Haiyue

From: Qiming Chen <[email protected]>
Sent: Friday, September 10, 2021 14:27
To: Wang, Haiyue <[email protected]>
Cc: [email protected]; Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]
Subject: Re: [dpdk-stable] [PATCH] common/iavf: fix arq resource leak

Thanks your reply.

You are right. The resource leak is indeed scanned by tools, and then manually confirmed whether it is a problem. Our team has been developing and maintaining for many years. Because the company process is not perfect,
the bug has not been promoted to the community, resulting in a lot of accumulation. I am currently Complete these things step by step.

In the near future, I hope you will give more guidance and maintain the dpdk intel driver together.

#4 lore raw

Can you tell me how to set up email reply? I don’t quite understand what you said about inline replies, and the green text and ">" are automatically generated?

On 9/10/2021 14:35,Wang, Haiyue<[email protected]> wrote: Thanks for the tool.

Anyway, please setup your mail firstly.

Your mail reply is bad for community, you can see what it looks like:
http://patchwork.dpdk.org/project/dpdk/patch/[email protected]/

The right reply is as:
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/

I’ve told you before: REPLY WITH plain text format, and REPLY inline.

BR,
Haiyue

From: Qiming Chen <[email protected]>
Sent: Friday, September 10, 2021 14:27
To: Wang, Haiyue <[email protected]>
Cc: [email protected]; Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]
Subject: Re: [dpdk-stable] [PATCH] common/iavf: fix arq resource leak

Thanks your reply.

You are right. The resource leak is indeed scanned by tools, and then manually confirmed whether it is a problem. Our team has been developing and maintaining for many years. Because the company process is not perfect,
the bug has not been promoted to the community, resulting in a lot of accumulation. I am currently Complete these things step by step.

In the near future, I hope you will give more guidance and maintain the dpdk intel driver together.

Acked-by on v1 1/1 Applied
#5 lore raw
In reply to Qiming Chen
Quoted 15 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Qiming Chen
Sent: Friday, September 10, 2021 11:13 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>; Qiming Chen <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] common/iavf: fix arq resource leak

In the iavf_init_arq function, if an exception occurs in the iavf_config_arq_regs function, and the previously applied arq bufs resource is released. This patch maintains the same modification as the iavf_init_asq function to roll back resources.

Quoted 4 lines
Fixes 87aca6d8d8a4 ("net/iavf/base: fix command buffer memory leak")

Applied to dpdk-next-net-intel.

Thanks
Qi