summaryrefslogtreecommitdiff
path: root/drivers/mempool
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2018-01-23 17:57:03 +0530
committerThomas Monjalon <thomas@monjalon.net>2018-01-31 13:44:44 +0100
commitdf2a17124257255eb59004c787e590ae21e27345 (patch)
tree315d8cf549693234856b4473e3533520a849111f /drivers/mempool
parent29d5d6817ed4c2593c51b0bea0b757211d8ae00e (diff)
downloaddpdk-df2a17124257255eb59004c787e590ae21e27345.zip
dpdk-df2a17124257255eb59004c787e590ae21e27345.tar.gz
dpdk-df2a17124257255eb59004c787e590ae21e27345.tar.xz
mempool/dpaa: fix address translation optimization
Fixes: 83a4f267f2e3 ("mempool/dpaa: optimize phy to virt conversion") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Diffstat (limited to 'drivers/mempool')
-rw-r--r--drivers/mempool/dpaa/dpaa_mempool.c9
-rw-r--r--drivers/mempool/dpaa/dpaa_mempool.h4
2 files changed, 6 insertions, 7 deletions
diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index dc4bcc9..c880d4f 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -150,8 +150,8 @@ dpaa_mbuf_free_bulk(struct rte_mempool *pool,
uint64_t phy = rte_mempool_virt2iova(obj_table[i]);
if (unlikely(!bp_info->ptov_off)) {
- /* buffers are not from multiple memzones */
- if (!(bp_info->flags & DPAA_MPOOL_MULTI_MEMZONE)) {
+ /* buffers are from single mem segment */
+ if (bp_info->flags & DPAA_MPOOL_SINGLE_SEGMENT) {
bp_info->ptov_off
= (uint64_t)obj_table[i] - phy;
rte_dpaa_bpid_info[bp_info->bpid].ptov_off
@@ -282,9 +282,8 @@ dpaa_register_memory_area(const struct rte_mempool *mp,
len, total_elt_sz * mp->size);
/* Detect pool area has sufficient space for elements in this memzone */
- if (len < total_elt_sz * mp->size)
- /* Else, Memory will be allocated from multiple memzones */
- bp_info->flags |= DPAA_MPOOL_MULTI_MEMZONE;
+ if (len >= total_elt_sz * mp->size)
+ bp_info->flags |= DPAA_MPOOL_SINGLE_SEGMENT;
return 0;
}
diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 02aa513..9435dd2 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -28,8 +28,8 @@
/* Maximum release/acquire from BMAN */
#define DPAA_MBUF_MAX_ACQ_REL 8
-/* Buffers are allocated from multiple memzones i.e. non phys contiguous */
-#define DPAA_MPOOL_MULTI_MEMZONE 0x01
+/* Buffers are allocated from single mem segment i.e. phys contiguous */
+#define DPAA_MPOOL_SINGLE_SEGMENT 0x01
struct dpaa_bp_info {
struct rte_mempool *mp;