net/softnic: fix memory leak of meter policy
PATCH 1/1 net/softnic: fix memory leak of meter policy
From: Dapeng Yu <[email protected]>
After the meter policies are created, they are not freed on device close.
This patch fixes it.
--- drivers/net/softnic/rte_eth_softnic_meter.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/softnic/rte_eth_softnic_meter.c +12 -0
@@ -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 *
Signature · 1 line
2.27.0
PATCH v2 1/1 net/softnic: fix memory leak of meter policy
From: Dapeng Yu <[email protected]>
After the meter policies are created, they are not freed on device close.
This patch fixes it.
---
V2:
* Rebase on top of main branch
--- drivers/net/softnic/rte_eth_softnic_meter.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/softnic/rte_eth_softnic_meter.c +12 -0
@@ -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 *
Signature · 1 line
2.27.0
Quoted 52 lines
-----Original Message-----
From: Yu, DapengX <[email protected]>
Sent: Thursday, October 14, 2021 3:12 AM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: [email protected]; Yu, DapengX <[email protected]>; [email protected]
Subject: [PATCH v2] net/softnic: fix memory leak of meter policyFrom: Dapeng Yu <[email protected]>
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")Signed-off-by Dapeng Yu <[email protected]>---
V2:
* Rebase on top of main branch--- drivers/net/softnic/rte_eth_softnic_meter.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)drivers/net/softnic/rte_eth_softnic_meter.c +12
-1@@ -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 * --
Quoted 1 line
2.27.0
Ferruh Yigit
AppliedQuoted 14 lines · Jasvinder
Quoted 14 lines
-----Original Message-----
From: Yu, DapengX <[email protected]>
Sent: Thursday, October 14, 2021 3:12 AM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: [email protected]; Yu, DapengX <[email protected]>; [email protected]
Subject: [PATCH v2] net/softnic: fix memory leak of meter policyFrom: Dapeng Yu <[email protected]>
After the meter policies are created, they are not freed on device close.
Quoted 9 lines
Quoted 6 lines
This patch fixes it.
Fixes 5f0d54f372f0 ("ethdev: add pre-defined meter policy API")Signed-off-by Dapeng Yu <[email protected]>Acked-by Jasvinder Singh <[email protected]>
Applied to dpdk-next-net/main, thanks.