From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
To: santosh.shukla@caviumnetworks.com, olivier.matz@6wind.com
Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>,
stable@dpdk.org
Subject: [dpdk-stable] [dpdk-dev] [PATCH v3 1/2] mempool: fix first memory area notification
Date: Sun, 24 Dec 2017 18:17:55 +0530 [thread overview]
Message-ID: <20171224124756.12160-1-pbhagavatula@caviumnetworks.com> (raw)
In-Reply-To: <20171215160031.11354-1-pbhagavatula@caviumnetworks.com>
Mempool creation needs to be completed first before notifying mempool to
register the mempool area.
Fixes: 12b8cc1a7e86 ("mempool: notify memory area to pool")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
v3 Changes:
- Redo commit title as fix.
v2 Changes:
- Redo commit log.
lib/librte_mempool/rte_mempool.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index d50dba493..6d1702252 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -367,11 +367,6 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
struct rte_mempool_memhdr *memhdr;
int ret;
- /* Notify memory area to mempool */
- ret = rte_mempool_ops_register_memory_area(mp, vaddr, iova, len);
- if (ret != -ENOTSUP && ret < 0)
- return ret;
-
/* create the internal ring if not already done */
if ((mp->flags & MEMPOOL_F_POOL_CREATED) == 0) {
ret = rte_mempool_ops_alloc(mp);
@@ -380,6 +375,11 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
mp->flags |= MEMPOOL_F_POOL_CREATED;
}
+ /* Notify memory area to mempool */
+ ret = rte_mempool_ops_register_memory_area(mp, vaddr, iova, len);
+ if (ret != -ENOTSUP && ret < 0)
+ return ret;
+
/* mempool is already populated */
if (mp->populated_size >= mp->size)
return -ENOSPC;
--
2.14.1
next parent reply other threads:[~2017-12-24 12:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171215160031.11354-1-pbhagavatula@caviumnetworks.com>
2017-12-24 12:47 ` Pavan Nikhilesh [this message]
2017-12-24 12:47 ` [dpdk-stable] [dpdk-dev] [PATCH v3 2/2] mempool/octeontx: fix memory area registration Pavan Nikhilesh
2018-01-12 17:36 ` [dpdk-stable] [dpdk-dev] [PATCH v3 1/2] mempool: fix first memory area notification 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=20171224124756.12160-1-pbhagavatula@caviumnetworks.com \
--to=pbhagavatula@caviumnetworks.com \
--cc=dev@dpdk.org \
--cc=olivier.matz@6wind.com \
--cc=santosh.shukla@caviumnetworks.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).