DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nipun Gupta <nipun.gupta@nxp.com>
To: <thomas@monjalon.net>
Cc: <dev@dpdk.org>, <hemant.agrawal@nxp.com>,
	<shreyansh.jain@nxp.com>, <stable@dpdk.org>
Subject: [dpdk-dev] [PATCH 3/7 v2] mempool/dpaa: fix the phy to virt optimization
Date: Tue, 23 Jan 2018 17:57:03 +0530	[thread overview]
Message-ID: <1516710427-22843-4-git-send-email-nipun.gupta@nxp.com> (raw)
In-Reply-To: <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com>

From: Hemant Agrawal <hemant.agrawal@nxp.com>

Fixes: 83a4f267f2e3 ("mempool/dpaa: optimize phy to virt conversion")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/mempool/dpaa/dpaa_mempool.c | 9 ++++-----
 drivers/mempool/dpaa/dpaa_mempool.h | 4 ++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index ddc4e47..fe22519 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -150,8 +150,8 @@
 		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 @@
 			   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;
-- 
1.9.1

  parent reply	other threads:[~2018-01-23 13:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23 12:31 [dpdk-dev] [PATCH 0/7] dpaa: fixes and performance improvement changes Nipun Gupta
2018-01-23 12:27 ` [dpdk-dev] [PATCH 0/7 v2] " Nipun Gupta
2018-01-23 12:27   ` [dpdk-dev] [PATCH 1/7 v2] bus/dpaa: check flag in qman multi enqueue Nipun Gupta
2018-01-24  5:24     ` Hemant Agrawal
2018-01-31 12:45       ` Thomas Monjalon
2018-01-23 12:27   ` [dpdk-dev] [PATCH 2/7 v2] bus/dpaa: allocate qman portals in thread safe manner Nipun Gupta
2018-01-23 12:27   ` Nipun Gupta [this message]
2018-01-23 12:27   ` [dpdk-dev] [PATCH 4/7 v2] bus/dpaa: fix port order shuffling Nipun Gupta
2018-01-23 12:27   ` [dpdk-dev] [PATCH 5/7 v2] net/dpaa: use phy to virt optimizations Nipun Gupta
2018-01-23 12:27   ` [dpdk-dev] [PATCH 6/7 v2] bus/dpaa: check portal presence in the caller API Nipun Gupta
2018-01-23 12:27   ` [dpdk-dev] [PATCH 7/7 v2] net/dpaa: further push mode optimizations Nipun Gupta
2018-01-23 12:31 ` [dpdk-dev] [PATCH 1/7] bus/dpaa: check flag in qman multi enqueue Nipun Gupta
2018-01-23 12:31 ` [dpdk-dev] [PATCH 2/7] bus/dpaa: allocate qman portals in thread safe manner Nipun Gupta
2018-01-23 12:31 ` [dpdk-dev] [PATCH 3/7] mempool/dpaa: fix the phy to virt optimization Nipun Gupta
2018-01-23 12:31 ` [dpdk-dev] [PATCH 4/7] bus/dpaa: fix port order shuffling Nipun Gupta
2018-01-23 12:31 ` [dpdk-dev] [PATCH 5/7] net/dpaa: use phy to virt optimizations Nipun Gupta
2018-01-23 12:31 ` [dpdk-dev] [PATCH 6/7] bus/dpaa: check portal presence in the caller API Nipun Gupta
2018-01-23 12:31 ` [dpdk-dev] [PATCH 7/7] net/dpaa: further push mode optimizations Nipun Gupta

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=1516710427-22843-4-git-send-email-nipun.gupta@nxp.com \
    --to=nipun.gupta@nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=stable@dpdk.org \
    --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).