DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Singh, Jasvinder" <jasvinder.singh@intel.com>
To: "Yu, DapengX" <dapengx.yu@intel.com>,
	"Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] net/softnic: fix memory leak of meter policy
Date: Tue, 19 Oct 2021 14:01:02 +0000
Message-ID: <BN9PR11MB5258EB797B068DBC732B67D0E0BD9@BN9PR11MB5258.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20211014021208.361162-1-dapengx.yu@intel.com>



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


  reply	other threads:[~2021-10-19 14:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30  8:34 [dpdk-dev] [PATCH] " dapengx.yu
2021-10-14  2:12 ` [dpdk-dev] [PATCH v2] " dapengx.yu
2021-10-19 14:01   ` Singh, Jasvinder [this message]
2021-10-19 20:46     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN9PR11MB5258EB797B068DBC732B67D0E0BD9@BN9PR11MB5258.namprd11.prod.outlook.com \
    --to=jasvinder.singh@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dapengx.yu@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git