DPDK patches and discussions
 help / color / mirror / Atom feed
From: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
To: dev@dpdk.org
Cc: james.r.harris@intel.com, changpeng.liu@intel.com,
	Darek Stojaczyk <dariusz.stojaczyk@intel.com>,
	anatoly.burakov@intel.com, thomas@monjalon.net
Subject: [dpdk-dev] [PATCH] fbarray: fix attach deadlock
Date: Fri, 29 Mar 2019 06:09:51 +0100	[thread overview]
Message-ID: <20190329050951.153202-1-dariusz.stojaczyk@intel.com> (raw)

rte_fbarray_attach() currently locks its internal
spinlock, but never releases it. Secondary processes
won't even start if there is more than one fbarray
to be attached to - the second rte_fbarray_attach()
would be just stuck.

Fix it by releasing the lock at the end of
rte_fbarray_attach(). I believe this was the original
intention.

Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas")
Cc: anatoly.burakov@intel.com
Cc: thomas@monjalon.net

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
---
 lib/librte_eal/common/eal_common_fbarray.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c
index 0e7366e5e..5ca8d6f0e 100644
--- a/lib/librte_eal/common/eal_common_fbarray.c
+++ b/lib/librte_eal/common/eal_common_fbarray.c
@@ -906,6 +906,7 @@ rte_fbarray_attach(struct rte_fbarray *arr)
 
 	/* we're done */
 
+	rte_spinlock_unlock(&mem_area_lock);
 	return 0;
 fail:
 	if (data)
@@ -913,6 +914,7 @@ rte_fbarray_attach(struct rte_fbarray *arr)
 	if (fd >= 0)
 		close(fd);
 	free(ma);
+	rte_spinlock_unlock(&mem_area_lock);
 	return -1;
 }
 
-- 
2.17.1

             reply	other threads:[~2019-03-29  5:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29  5:09 Darek Stojaczyk [this message]
2019-03-29  5:09 ` Darek Stojaczyk
2019-03-29  8:53 ` Gavin Hu (Arm Technology China)
2019-03-29  8:53   ` Gavin Hu (Arm Technology China)
2019-03-29  9:52 ` [dpdk-dev] [PATCH v2] " Darek Stojaczyk
2019-03-29  9:52   ` Darek Stojaczyk
2019-03-29 10:42   ` Burakov, Anatoly
2019-03-29 10:42     ` Burakov, Anatoly
2019-03-29 11:15     ` Thomas Monjalon
2019-03-29 11:15       ` 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=20190329050951.153202-1-dariusz.stojaczyk@intel.com \
    --to=dariusz.stojaczyk@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=changpeng.liu@intel.com \
    --cc=dev@dpdk.org \
    --cc=james.r.harris@intel.com \
    --cc=thomas@monjalon.net \
    /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).