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>
Subject: [dpdk-dev] [PATCH 5/7 v2] net/dpaa: use phy to virt optimizations
Date: Tue, 23 Jan 2018 17:57:05 +0530	[thread overview]
Message-ID: <1516710427-22843-6-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>

Use the optimized routine for phy to virt conversion,
when the mempool is allocated from physical contiguous memory.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_rxtx.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index ab23352..b889d03 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -309,7 +309,7 @@ struct rte_mbuf *
 
 	DPAA_DP_LOG(DEBUG, "Received an SG frame");
 
-	vaddr = rte_dpaa_mem_ptov(qm_fd_addr(fd));
+	vaddr = DPAA_MEMPOOL_PTOV(bp_info, qm_fd_addr(fd));
 	if (!vaddr) {
 		DPAA_PMD_ERR("unable to convert physical address");
 		return NULL;
@@ -318,7 +318,7 @@ struct rte_mbuf *
 	sg_temp = &sgt[i++];
 	hw_sg_to_cpu(sg_temp);
 	temp = (struct rte_mbuf *)((char *)vaddr - bp_info->meta_data_size);
-	sg_vaddr = rte_dpaa_mem_ptov(qm_sg_entry_get64(sg_temp));
+	sg_vaddr = DPAA_MEMPOOL_PTOV(bp_info, qm_sg_entry_get64(sg_temp));
 
 	first_seg = (struct rte_mbuf *)((char *)sg_vaddr -
 						bp_info->meta_data_size);
@@ -334,7 +334,8 @@ struct rte_mbuf *
 	while (i < DPAA_SGT_MAX_ENTRIES) {
 		sg_temp = &sgt[i++];
 		hw_sg_to_cpu(sg_temp);
-		sg_vaddr = rte_dpaa_mem_ptov(qm_sg_entry_get64(sg_temp));
+		sg_vaddr = DPAA_MEMPOOL_PTOV(bp_info,
+					     qm_sg_entry_get64(sg_temp));
 		cur_seg = (struct rte_mbuf *)((char *)sg_vaddr -
 						      bp_info->meta_data_size);
 		cur_seg->data_off = sg_temp->offset;
@@ -361,7 +362,7 @@ struct rte_mbuf *
 {
 	struct rte_mbuf *mbuf;
 	struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid);
-	void *ptr = rte_dpaa_mem_ptov(qm_fd_addr(fd));
+	void *ptr;
 	uint8_t format =
 		(fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT;
 	uint16_t offset;
@@ -372,6 +373,8 @@ struct rte_mbuf *
 	if (unlikely(format == qm_fd_sg))
 		return dpaa_eth_sg_to_mbuf(fd, ifid);
 
+	ptr = DPAA_MEMPOOL_PTOV(bp_info, qm_fd_addr(fd));
+
 	rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF));
 
 	offset = (fd->opaque & DPAA_FD_OFFSET_MASK) >> DPAA_FD_OFFSET_SHIFT;
@@ -537,7 +540,8 @@ static void *dpaa_get_pktbuf(struct dpaa_bp_info *bp_info)
 	DPAA_DP_LOG(DEBUG, "got buffer 0x%lx from pool %d",
 		    (uint64_t)bufs.addr, bufs.bpid);
 
-	buf = (uint64_t)rte_dpaa_mem_ptov(bufs.addr) - bp_info->meta_data_size;
+	buf = (uint64_t)DPAA_MEMPOOL_PTOV(bp_info, bufs.addr)
+				- bp_info->meta_data_size;
 	if (!buf)
 		goto out;
 
-- 
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   ` [dpdk-dev] [PATCH 3/7 v2] mempool/dpaa: fix the phy to virt optimization Nipun Gupta
2018-01-23 12:27   ` [dpdk-dev] [PATCH 4/7 v2] bus/dpaa: fix port order shuffling Nipun Gupta
2018-01-23 12:27   ` Nipun Gupta [this message]
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-6-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=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).