DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org, wei.dai@intel.com
Cc: sergio.gonzalez.monroy@intel.com, jianfeng.tan@intel.com,
	thomas.monjalon@6wind.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2] mempool: fix search of maximum contiguous pages
Date: Tue, 25 Oct 2016 17:01:11 +0200	[thread overview]
Message-ID: <1477407671-21019-1-git-send-email-olivier.matz@6wind.com> (raw)
In-Reply-To: <1476351445-18102-1-git-send-email-wei.dai@intel.com>

From: Wei Dai <wei.dai@intel.com>

paddr[i] + pg_sz always points to the start physical address of the
2nd page after pddr[i], so only up to 2 pages can be combinded to
be used. With this revision, more than 2 pages can be used.

Fixes: 84121f197187 ("mempool: store memory chunks in a list")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_mempool/rte_mempool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 71017e1..e94e56f 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -428,7 +428,7 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
 
 		/* populate with the largest group of contiguous pages */
 		for (n = 1; (i + n) < pg_num &&
-			     paddr[i] + pg_sz == paddr[i+n]; n++)
+			     paddr[i + n - 1] + pg_sz == paddr[i + n]; n++)
 			;
 
 		ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
-- 
2.8.1

  parent reply	other threads:[~2016-10-25 15:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13  9:37 [dpdk-dev] [PATCH] " Wei Dai
2016-10-13  9:46 ` Sergio Gonzalez Monroy
2016-10-13  9:53 ` Ananyev, Konstantin
2016-10-13  9:59   ` Ananyev, Konstantin
2016-10-13 11:52     ` Dai, Wei
2016-10-13 12:31       ` Ananyev, Konstantin
2016-10-13 15:05         ` Olivier MATZ
2016-10-25 14:37           ` Thomas Monjalon
2016-10-25 14:56             ` Olivier Matz
2016-10-25 15:01 ` Olivier Matz [this message]
2016-10-25 21:23   ` [dpdk-dev] [dpdk-stable] [PATCH v2] " 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=1477407671-21019-1-git-send-email-olivier.matz@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=sergio.gonzalez.monroy@intel.com \
    --cc=stable@dpdk.org \
    --cc=thomas.monjalon@6wind.com \
    --cc=wei.dai@intel.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).