From: Yuanhan Liu <yliu@fridaylinux.org>
To: Yuanhan Liu <yuanhanl@mellanox.com>
Cc: Dahir Osman <dahir.osman@windriver.com>,
Matt Peters <matt.peters@windriver.com>,
Allain Legacy <allain.legacy@windriver.com>,
Konstantin Ananyev <konstantin.ananyev@intel.com>,
dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-stable] patch 'ip_frag: free mbufs on reassembly table destroy' has been queued to stable release 17.05.2
Date: Wed, 30 Aug 2017 18:30:58 +0800 [thread overview]
Message-ID: <20170830103058.GK9736@yliu-home> (raw)
In-Reply-To: <1503305065-23998-1-git-send-email-yuanhanl@mellanox.com>
On Mon, Aug 21, 2017 at 04:42:30PM +0800, Yuanhan Liu wrote:
> Hi,
>
> FYI, your patch has been queued to stable release 17.05.2
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/24/17. So please
> shout if anyone has objections.
This commit exports an inlined function to a public API: the map file
references DPDK 17.08. I think it's better to not put it in a stable
release. Thus, it's been reverted.
--yliu
> ---
> >From 4aa29d2e55301e887a15c2a79f68507b7f65db84 Mon Sep 17 00:00:00 2001
> From: Dahir Osman <dahir.osman@windriver.com>
> Date: Mon, 5 Jun 2017 11:49:01 -0400
> Subject: [PATCH] ip_frag: free mbufs on reassembly table destroy
>
> [ upstream commit 95908f52393da36c47905a777f64c0650585c12b ]
>
> The rte_ip_frag_table_destroy procedure simply releases the memory for the
> table without freeing the packet buffers that may be referenced in the hash
> table for in-flight or incomplete packet reassembly operations. To prevent
> leaked mbufs go through the list of fragments and free each one
> individually.
>
> Fixes: 416707812c03 ("ip_frag: refactor reassembly code into a proper library")
>
> Reported-by: Matt Peters <matt.peters@windriver.com>
> Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> ---
> lib/librte_ip_frag/ip_frag_common.h | 20 ++++++++++++++++++++
> lib/librte_ip_frag/rte_ip_frag.h | 7 ++-----
> lib/librte_ip_frag/rte_ip_frag_common.c | 13 +++++++++++++
> lib/librte_ip_frag/rte_ipfrag_version.map | 7 +++++++
> 4 files changed, 42 insertions(+), 5 deletions(-)
>
> diff --git a/lib/librte_ip_frag/ip_frag_common.h b/lib/librte_ip_frag/ip_frag_common.h
> index 835e4f9..9f56196 100644
> --- a/lib/librte_ip_frag/ip_frag_common.h
> +++ b/lib/librte_ip_frag/ip_frag_common.h
> @@ -130,6 +130,26 @@ ip_frag_free(struct ip_frag_pkt *fp, struct rte_ip_frag_death_row *dr)
> dr->cnt = k;
> }
>
> +/* delete fragment's mbufs immediately instead of using death row */
> +static inline void
> +ip_frag_free_immediate(struct ip_frag_pkt *fp)
> +{
> + uint32_t i;
> +
> + for (i = 0; i < fp->last_idx; i++) {
> + if (fp->frags[i].mb != NULL) {
> + IP_FRAG_LOG(DEBUG, "%s:%d\n"
> + "mbuf: %p, tms: %" PRIu64", key: <%" PRIx64 ", %#x>\n",
> + __func__, __LINE__, fp->frags[i].mb, fp->start,
> + fp->key.src_dst[0], fp->key.id);
> + rte_pktmbuf_free(fp->frags[i].mb);
> + fp->frags[i].mb = NULL;
> + }
> + }
> +
> + fp->last_idx = 0;
> +}
> +
> /* if key is empty, mark key as in use */
> static inline void
> ip_frag_inuse(struct rte_ip_frag_tbl *tbl, const struct ip_frag_pkt *fp)
> diff --git a/lib/librte_ip_frag/rte_ip_frag.h b/lib/librte_ip_frag/rte_ip_frag.h
> index 6708906..ff16f4c 100644
> --- a/lib/librte_ip_frag/rte_ip_frag.h
> +++ b/lib/librte_ip_frag/rte_ip_frag.h
> @@ -180,11 +180,8 @@ struct rte_ip_frag_tbl * rte_ip_frag_table_create(uint32_t bucket_num,
> * @param tbl
> * Fragmentation table to free.
> */
> -static inline void
> -rte_ip_frag_table_destroy(struct rte_ip_frag_tbl *tbl)
> -{
> - rte_free(tbl);
> -}
> +void
> +rte_ip_frag_table_destroy(struct rte_ip_frag_tbl *tbl);
>
> /**
> * This function implements the fragmentation of IPv6 packets.
> diff --git a/lib/librte_ip_frag/rte_ip_frag_common.c b/lib/librte_ip_frag/rte_ip_frag_common.c
> index 6176ff4..8460f8e 100644
> --- a/lib/librte_ip_frag/rte_ip_frag_common.c
> +++ b/lib/librte_ip_frag/rte_ip_frag_common.c
> @@ -109,6 +109,19 @@ rte_ip_frag_table_create(uint32_t bucket_num, uint32_t bucket_entries,
> return tbl;
> }
>
> +/* delete fragmentation table */
> +void
> +rte_ip_frag_table_destroy(struct rte_ip_frag_tbl *tbl)
> +{
> + struct ip_frag_pkt *fp;
> +
> + TAILQ_FOREACH(fp, &tbl->lru, lru) {
> + ip_frag_free_immediate(fp);
> + }
> +
> + rte_free(tbl);
> +}
> +
> /* dump frag table statistics to file */
> void
> rte_ip_frag_table_statistics_dump(FILE *f, const struct rte_ip_frag_tbl *tbl)
> diff --git a/lib/librte_ip_frag/rte_ipfrag_version.map b/lib/librte_ip_frag/rte_ipfrag_version.map
> index 354fa08..d1acf07 100644
> --- a/lib/librte_ip_frag/rte_ipfrag_version.map
> +++ b/lib/librte_ip_frag/rte_ipfrag_version.map
> @@ -11,3 +11,10 @@ DPDK_2.0 {
>
> local: *;
> };
> +
> +DPDK_17.08 {
> + global:
> +
> + rte_ip_frag_table_destroy;
> +
> +} DPDK_2.0;
> --
> 2.7.4
parent reply other threads:[~2017-08-30 10:31 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1503305065-23998-1-git-send-email-yuanhanl@mellanox.com>]
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=20170830103058.GK9736@yliu-home \
--to=yliu@fridaylinux.org \
--cc=allain.legacy@windriver.com \
--cc=dahir.osman@windriver.com \
--cc=konstantin.ananyev@intel.com \
--cc=matt.peters@windriver.com \
--cc=stable@dpdk.org \
--cc=yuanhanl@mellanox.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).