From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: patrick.fu@intel.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] fbarray: fix fbarray destruction
Date: Tue, 9 Jul 2019 15:00:27 +0100 [thread overview]
Message-ID: <a7678616c14055fb2ed3d51aa48f25f1201ce930.1562680812.git.anatoly.burakov@intel.com> (raw)
Currently, when fbarray is destroyed, the fbarray structure is not
zeroed out, which leads to stale data being there and confusing
secondary process init in legacy mem mode. Fix it by always
memsetting the fbarray to zero when destroying it.
Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
lib/librte_eal/common/eal_common_fbarray.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c
index b7ddb66e9..1312f936b 100644
--- a/lib/librte_eal/common/eal_common_fbarray.c
+++ b/lib/librte_eal/common/eal_common_fbarray.c
@@ -1055,6 +1055,9 @@ rte_fbarray_destroy(struct rte_fbarray *arr)
TAILQ_REMOVE(&mem_area_tailq, tmp, next);
free(tmp);
ret = 0;
+
+ /* reset the fbarray structure */
+ memset(arr, 0, sizeof(*arr));
out:
rte_spinlock_unlock(&mem_area_lock);
return ret;
--
2.17.1
next reply other threads:[~2019-07-09 14:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-09 14:00 Anatoly Burakov [this message]
2019-07-10 21:26 ` Thomas Monjalon
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=a7678616c14055fb2ed3d51aa48f25f1201ce930.1562680812.git.anatoly.burakov@intel.com \
--to=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=patrick.fu@intel.com \
--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
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).