* [dpdk-dev] [PATCH] net/softnic: fix memory leak of meter policy
@ 2021-09-30 8:34 dapengx.yu
2021-10-14 2:12 ` [dpdk-dev] [PATCH v2] " dapengx.yu
0 siblings, 1 reply; 4+ messages in thread
From: dapengx.yu @ 2021-09-30 8:34 UTC (permalink / raw)
To: Jasvinder Singh, Cristian Dumitrescu; +Cc: dev, Dapeng Yu, stable
From: Dapeng Yu <dapengx.yu@intel.com>
After the meter policies are created, they are not freed on device
close.
This patch fixes it.
Fixes: 5f0d54f372f0 ("ethdev: add pre-defined meter policy API")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
---
drivers/net/softnic/rte_eth_softnic_meter.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/softnic/rte_eth_softnic_meter.c b/drivers/net/softnic/rte_eth_softnic_meter.c
index 5831892a39..6b02f43e31 100644
--- a/drivers/net/softnic/rte_eth_softnic_meter.c
+++ b/drivers/net/softnic/rte_eth_softnic_meter.c
@@ -52,6 +52,18 @@ softnic_mtr_free(struct pmd_internals *p)
TAILQ_REMOVE(&p->mtr.meter_profiles, mp, node);
free(mp);
}
+
+ /* Remove meter policies */
+ for ( ; ; ) {
+ struct softnic_mtr_meter_policy *mp;
+
+ mp = TAILQ_FIRST(&p->mtr.meter_policies);
+ if (mp == NULL)
+ break;
+
+ TAILQ_REMOVE(&p->mtr.meter_policies, mp, node);
+ free(mp);
+ }
}
struct softnic_mtr_meter_profile *
--
2.27.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH v2] net/softnic: fix memory leak of meter policy
2021-09-30 8:34 [dpdk-dev] [PATCH] net/softnic: fix memory leak of meter policy dapengx.yu
@ 2021-10-14 2:12 ` dapengx.yu
2021-10-19 14:01 ` Singh, Jasvinder
0 siblings, 1 reply; 4+ messages in thread
From: dapengx.yu @ 2021-10-14 2:12 UTC (permalink / raw)
To: Jasvinder Singh, Cristian Dumitrescu; +Cc: dev, Dapeng Yu, stable
From: Dapeng Yu <dapengx.yu@intel.com>
After the meter policies are created, they are not freed on device
close.
This patch fixes it.
Fixes: 5f0d54f372f0 ("ethdev: add pre-defined meter policy API")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
---
V2:
* Rebase on top of main branch
---
drivers/net/softnic/rte_eth_softnic_meter.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/softnic/rte_eth_softnic_meter.c b/drivers/net/softnic/rte_eth_softnic_meter.c
index 5831892a39..6b02f43e31 100644
--- a/drivers/net/softnic/rte_eth_softnic_meter.c
+++ b/drivers/net/softnic/rte_eth_softnic_meter.c
@@ -52,6 +52,18 @@ softnic_mtr_free(struct pmd_internals *p)
TAILQ_REMOVE(&p->mtr.meter_profiles, mp, node);
free(mp);
}
+
+ /* Remove meter policies */
+ for ( ; ; ) {
+ struct softnic_mtr_meter_policy *mp;
+
+ mp = TAILQ_FIRST(&p->mtr.meter_policies);
+ if (mp == NULL)
+ break;
+
+ TAILQ_REMOVE(&p->mtr.meter_policies, mp, node);
+ free(mp);
+ }
}
struct softnic_mtr_meter_profile *
--
2.27.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/softnic: fix memory leak of meter policy
2021-10-14 2:12 ` [dpdk-dev] [PATCH v2] " dapengx.yu
@ 2021-10-19 14:01 ` Singh, Jasvinder
2021-10-19 20:46 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
0 siblings, 1 reply; 4+ messages in thread
From: Singh, Jasvinder @ 2021-10-19 14:01 UTC (permalink / raw)
To: Yu, DapengX, Dumitrescu, Cristian; +Cc: dev, stable
> -----Original Message-----
> From: Yu, DapengX <dapengx.yu@intel.com>
> Sent: Thursday, October 14, 2021 3:12 AM
> To: Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org; Yu, DapengX <dapengx.yu@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/softnic: fix memory leak of meter policy
>
> From: Dapeng Yu <dapengx.yu@intel.com>
>
> After the meter policies are created, they are not freed on device close.
>
> This patch fixes it.
>
> Fixes: 5f0d54f372f0 ("ethdev: add pre-defined meter policy API")
> Cc: stable@dpdk.org
>
> Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
> ---
> V2:
> * Rebase on top of main branch
> ---
> drivers/net/softnic/rte_eth_softnic_meter.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/softnic/rte_eth_softnic_meter.c
> b/drivers/net/softnic/rte_eth_softnic_meter.c
> index 5831892a39..6b02f43e31 100644
> --- a/drivers/net/softnic/rte_eth_softnic_meter.c
> +++ b/drivers/net/softnic/rte_eth_softnic_meter.c
> @@ -52,6 +52,18 @@ softnic_mtr_free(struct pmd_internals *p)
> TAILQ_REMOVE(&p->mtr.meter_profiles, mp, node);
> free(mp);
> }
> +
> + /* Remove meter policies */
> + for ( ; ; ) {
> + struct softnic_mtr_meter_policy *mp;
> +
> + mp = TAILQ_FIRST(&p->mtr.meter_policies);
> + if (mp == NULL)
> + break;
> +
> + TAILQ_REMOVE(&p->mtr.meter_policies, mp, node);
> + free(mp);
> + }
> }
>
> struct softnic_mtr_meter_profile *
> --
> 2.27.0
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] net/softnic: fix memory leak of meter policy
2021-10-19 14:01 ` Singh, Jasvinder
@ 2021-10-19 20:46 ` Ferruh Yigit
0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2021-10-19 20:46 UTC (permalink / raw)
To: Singh, Jasvinder, Yu, DapengX, Dumitrescu, Cristian; +Cc: dev, stable
On 10/19/2021 3:01 PM, Singh, Jasvinder wrote:
>
>
>> -----Original Message-----
>> From: Yu, DapengX <dapengx.yu@intel.com>
>> Sent: Thursday, October 14, 2021 3:12 AM
>> To: Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian
>> <cristian.dumitrescu@intel.com>
>> Cc: dev@dpdk.org; Yu, DapengX <dapengx.yu@intel.com>; stable@dpdk.org
>> Subject: [PATCH v2] net/softnic: fix memory leak of meter policy
>>
>> From: Dapeng Yu <dapengx.yu@intel.com>
>>
>> After the meter policies are created, they are not freed on device close.
>>
>> This patch fixes it.
>>
>> Fixes: 5f0d54f372f0 ("ethdev: add pre-defined meter policy API")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
>
> Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-10-19 20:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 8:34 [dpdk-dev] [PATCH] net/softnic: fix memory leak of meter policy dapengx.yu
2021-10-14 2:12 ` [dpdk-dev] [PATCH v2] " dapengx.yu
2021-10-19 14:01 ` Singh, Jasvinder
2021-10-19 20:46 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
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).