DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem
@ 2021-08-21  8:14 chenqiming_huawei
  2021-09-06  1:47 ` Zhang, Qi Z
  2021-09-15  1:27 ` Zhang, Qi Z
  0 siblings, 2 replies; 4+ messages in thread
From: chenqiming_huawei @ 2021-08-21  8:14 UTC (permalink / raw)
  To: dev; +Cc: beilei.xing, Qiming Chen, stable

From: Qiming Chen <chenqiming_huawei@163.com>

In the i40evf_dev_init function, when the MAC memory alloc fails, the
previously initialized vf resource is not released, resulting in leakage.
The patch calls the i40evf_uninit_vf function in the abnormal branch to
release resources.

Fixes: 5c9222058df7 ("i40e: move to drivers/net/")
Cc: stable@dpdk.org

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 003d41373b..f64db72e9a 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1622,6 +1622,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
 		PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to"
 				" store MAC addresses",
 				RTE_ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX);
+		(void)i40evf_uninit_vf(eth_dev);
 		return -ENOMEM;
 	}
 	rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
-- 
2.30.1.windows.1


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

* Re: [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem
  2021-08-21  8:14 [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem chenqiming_huawei
@ 2021-09-06  1:47 ` Zhang, Qi Z
  2021-09-15  1:27 ` Zhang, Qi Z
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2021-09-06  1:47 UTC (permalink / raw)
  To: chenqiming_huawei, dev; +Cc: Xing, Beilei, stable



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of
> chenqiming_huawei@163.com
> Sent: Saturday, August 21, 2021 4:14 PM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Qiming Chen
> <chenqiming_huawei@163.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem
> 
> From: Qiming Chen <chenqiming_huawei@163.com>
> 
> In the i40evf_dev_init function, when the MAC memory alloc fails, the
> previously initialized vf resource is not released, resulting in leakage.
> The patch calls the i40evf_uninit_vf function in the abnormal branch to release
> resources.
> 
> Fixes: 5c9222058df7 ("i40e: move to drivers/net/")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> b/drivers/net/i40e/i40e_ethdev_vf.c
> index 003d41373b..f64db72e9a 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1622,6 +1622,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
>  		PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to"
>  				" store MAC addresses",
>  				RTE_ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX);
> +		(void)i40evf_uninit_vf(eth_dev);
>  		return -ENOMEM;
>  	}
>  	rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
> --
> 2.30.1.windows.1

The patch is not applied for main repo as i40evf will be removed, you can submit a fix to dpdk-stable directly.


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

* Re: [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem
  2021-08-21  8:14 [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem chenqiming_huawei
  2021-09-06  1:47 ` Zhang, Qi Z
@ 2021-09-15  1:27 ` Zhang, Qi Z
  2021-09-15  8:25   ` Zhang, Qi Z
  1 sibling, 1 reply; 4+ messages in thread
From: Zhang, Qi Z @ 2021-09-15  1:27 UTC (permalink / raw)
  To: chenqiming_huawei, dev; +Cc: Xing, Beilei, stable



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of
> chenqiming_huawei@163.com
> Sent: Saturday, August 21, 2021 4:14 PM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Qiming Chen
> <chenqiming_huawei@163.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem
> 
> From: Qiming Chen <chenqiming_huawei@163.com>
> 
> In the i40evf_dev_init function, when the MAC memory alloc fails, the
> previously initialized vf resource is not released, resulting in leakage.
> The patch calls the i40evf_uninit_vf function in the abnormal branch to release
> resources.
> 
> Fixes: 5c9222058df7 ("i40e: move to drivers/net/")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi


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

* Re: [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem
  2021-09-15  1:27 ` Zhang, Qi Z
@ 2021-09-15  8:25   ` Zhang, Qi Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2021-09-15  8:25 UTC (permalink / raw)
  To: chenqiming_huawei, dev; +Cc: Xing, Beilei, stable



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Wednesday, September 15, 2021 9:27 AM
> To: 'chenqiming_huawei@163.com' <chenqiming_huawei@163.com>;
> dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem
> 
> 
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of
> > chenqiming_huawei@163.com
> > Sent: Saturday, August 21, 2021 4:14 PM
> > To: dev@dpdk.org
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Qiming Chen
> > <chenqiming_huawei@163.com>; stable@dpdk.org
> > Subject: [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem
> >
> > From: Qiming Chen <chenqiming_huawei@163.com>
> >
> > In the i40evf_dev_init function, when the MAC memory alloc fails, the
> > previously initialized vf resource is not released, resulting in leakage.
> > The patch calls the i40evf_uninit_vf function in the abnormal branch
> > to release resources.
> >
> > Fixes: 5c9222058df7 ("i40e: move to drivers/net/")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> Applied to dpdk-next-net-intel.

Sorry, I acked on wrong patch , this patch will not be applied as i40evf will be removed in this release, is should be submitted to LTS directly.

> 
> Thanks
> Qi


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

end of thread, other threads:[~2021-09-15  8:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-21  8:14 [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem chenqiming_huawei
2021-09-06  1:47 ` Zhang, Qi Z
2021-09-15  1:27 ` Zhang, Qi Z
2021-09-15  8:25   ` Zhang, Qi Z

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