DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, Nipun Gupta <nipun.gupta@nxp.com>
Subject: [dpdk-dev] [PATCH v2 16/16] net/dpaa2: do not prefetch annotaion for physical mode
Date: Fri,  6 Mar 2020 15:27:42 +0530	[thread overview]
Message-ID: <20200306095742.18080-17-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20200306095742.18080-1-hemant.agrawal@nxp.com>

From: Nipun Gupta <nipun.gupta@nxp.com>

When IOVA is physical address do not prefetch the annotation
of the next frame, as there is a cost involved there to convert
the physical address to virtual address.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  6 ++--
 drivers/net/dpaa2/dpaa2_rxtx.c          | 40 +++++++++++++++----------
 2 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index bde1441f4..6b07b628a 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2016-2019 NXP
+ *   Copyright 2016-2020 NXP
  *
  */
 
@@ -403,8 +403,8 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
 #else	/* RTE_LIBRTE_DPAA2_USE_PHYS_IOVA */
 
 #define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_addr)
-#define DPAA2_VADDR_TO_IOVA(_vaddr) (_vaddr)
-#define DPAA2_IOVA_TO_VADDR(_iova) (_iova)
+#define DPAA2_VADDR_TO_IOVA(_vaddr) (phys_addr_t)(_vaddr)
+#define DPAA2_IOVA_TO_VADDR(_iova) (void *)(_iova)
 #define DPAA2_MODIFY_IOVA_TO_VADDR(_mem, _type)
 
 #endif /* RTE_LIBRTE_DPAA2_USE_PHYS_IOVA */
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index d809e0f4b..4d024a85f 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2016-2019 NXP
+ *   Copyright 2016-2020 NXP
  *
  */
 
@@ -324,8 +324,8 @@ static inline struct rte_mbuf *__attribute__((hot))
 eth_fd_to_mbuf(const struct qbman_fd *fd,
 	       int port_id)
 {
-	struct rte_mbuf *mbuf = DPAA2_INLINE_MBUF_FROM_BUF(
-		DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)),
+	void *iova_addr = DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd));
+	struct rte_mbuf *mbuf = DPAA2_INLINE_MBUF_FROM_BUF(iova_addr,
 		     rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size);
 
 	/* need to repopulated some of the fields,
@@ -350,8 +350,7 @@ eth_fd_to_mbuf(const struct qbman_fd *fd,
 		dpaa2_dev_rx_parse_new(mbuf, fd);
 	else
 		mbuf->packet_type = dpaa2_dev_rx_parse(mbuf,
-			(void *)((size_t)DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd))
-			 + DPAA2_FD_PTA_SIZE));
+			(void *)((size_t)iova_addr + DPAA2_FD_PTA_SIZE));
 
 	DPAA2_PMD_DP_DEBUG("to mbuf - mbuf =%p, mbuf->buf_addr =%p, off = %d,"
 		"fd_off=%d fd =%" PRIx64 ", meta = %d  bpid =%d, len=%d\n",
@@ -518,7 +517,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	int ret, num_rx = 0, pull_size;
 	uint8_t pending, status;
 	struct qbman_swp *swp;
-	const struct qbman_fd *fd, *next_fd;
+	const struct qbman_fd *fd;
 	struct qbman_pull_desc pulldesc;
 	struct queue_storage_info_t *q_storage = dpaa2_q->q_storage;
 	struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;
@@ -617,12 +616,15 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		}
 		fd = qbman_result_DQ_fd(dq_storage);
 
+#ifndef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
 		if (dpaa2_svr_family != SVR_LX2160A) {
-			next_fd = qbman_result_DQ_fd(dq_storage + 1);
+			const struct qbman_fd *next_fd =
+				qbman_result_DQ_fd(dq_storage + 1);
 			/* Prefetch Annotation address for the parse results */
-			rte_prefetch0((void *)(size_t)(DPAA2_GET_FD_ADDR(
-				      next_fd) + DPAA2_FD_PTA_SIZE + 16));
+			rte_prefetch0(DPAA2_IOVA_TO_VADDR((DPAA2_GET_FD_ADDR(
+				next_fd) + DPAA2_FD_PTA_SIZE + 16)));
 		}
+#endif
 
 		if (unlikely(DPAA2_FD_GET_FORMAT(fd) == qbman_fd_sg))
 			bufs[num_rx] = eth_sg_fd_to_mbuf(fd, eth_data->port_id);
@@ -753,7 +755,7 @@ dpaa2_dev_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	int ret, num_rx = 0, next_pull = nb_pkts, num_pulled;
 	uint8_t pending, status;
 	struct qbman_swp *swp;
-	const struct qbman_fd *fd, *next_fd;
+	const struct qbman_fd *fd;
 	struct qbman_pull_desc pulldesc;
 	struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;
 
@@ -821,11 +823,19 @@ dpaa2_dev_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			}
 			fd = qbman_result_DQ_fd(dq_storage);
 
-			next_fd = qbman_result_DQ_fd(dq_storage + 1);
-			/* Prefetch Annotation address for the parse results */
-			rte_prefetch0(
-				(void *)(size_t)(DPAA2_GET_FD_ADDR(next_fd)
-					+ DPAA2_FD_PTA_SIZE + 16));
+#ifndef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
+			if (dpaa2_svr_family != SVR_LX2160A) {
+				const struct qbman_fd *next_fd =
+					qbman_result_DQ_fd(dq_storage + 1);
+
+				/* Prefetch Annotation address for the parse
+				 * results.
+				 */
+				rte_prefetch0((DPAA2_IOVA_TO_VADDR(
+					DPAA2_GET_FD_ADDR(next_fd) +
+					DPAA2_FD_PTA_SIZE + 16)));
+			}
+#endif
 
 			if (unlikely(DPAA2_FD_GET_FORMAT(fd) == qbman_fd_sg))
 				bufs[num_rx] = eth_sg_fd_to_mbuf(fd,
-- 
2.17.1


  parent reply	other threads:[~2020-03-06 10:02 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02 14:58 [dpdk-dev] [PATCH 00/16] NXP DPAAx fixes and enhancements Hemant Agrawal
2020-03-02 13:01 ` David Marchand
2020-03-05  9:06   ` Hemant Agrawal (OSS)
2020-03-05  9:09     ` David Marchand
2020-03-05  9:19       ` Hemant Agrawal (OSS)
2020-03-06 10:12         ` David Marchand
2020-03-10 10:36           ` Dodji Seketeli
2020-04-07 10:25             ` Hemant Agrawal
2020-04-07 12:20               ` Thomas Monjalon
2020-04-08  7:20               ` Dodji Seketeli
2020-04-08  7:52                 ` Dodji Seketeli
2020-04-08 12:35                   ` Thomas Monjalon
2020-03-02 14:58 ` [dpdk-dev] [PATCH 01/16] net/dpaa2: fix 10g port negotiation issue Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 02/16] bus/fslmc: fix dereferencing null pointer Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 03/16] bus/fslmc: combine thread specific variables Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 04/16] bus/fslmc: rework portal allocation to a per thread basis Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 05/16] bus/fslmc: support handle portal alloc failure Hemant Agrawal
2020-03-09 17:00   ` Ferruh Yigit
2020-03-09 17:04     ` Ferruh Yigit
2020-03-02 14:58 ` [dpdk-dev] [PATCH 06/16] bus/fslmc: limit pthread destructor called for dpaa2 only Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 07/16] bus/fslmc: support portal migration Hemant Agrawal
2020-03-03 17:43   ` Ferruh Yigit
2020-03-02 14:58 ` [dpdk-dev] [PATCH 08/16] drivers: enhance portal allocation failure log Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 09/16] bus/fslmc: rename the cinh read functions used for ls1088 Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 10/16] net/dpaa: return error on multiple mp config Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 11/16] net/dpaa: enable Tx queue taildrop Hemant Agrawal
2020-03-03 16:59   ` Ferruh Yigit
2020-03-04  8:43     ` Hemant Agrawal (OSS)
2020-03-04  8:49     ` David Marchand
2020-03-03 17:02   ` Ferruh Yigit
2020-03-05  6:49     ` Gagandeep Singh
2020-03-05 14:14       ` Ferruh Yigit
2020-03-02 14:58 ` [dpdk-dev] [PATCH 12/16] net/dpaa: add 2.5G support Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 13/16] net/dpaa: update process specific device info Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 14/16] bus/dpaa: enable link state interrupt Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 15/16] bus/dpaa: enable set link status Hemant Agrawal
2020-03-02 14:58 ` [dpdk-dev] [PATCH 16/16] net/dpaa2: do not prefetch annotaion for physical mode Hemant Agrawal
2020-03-06  9:57 ` [dpdk-dev] [PATCH v2 00/16] NXP DPAAx fixes and enhancements Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 01/16] net/dpaa2: fix 10g port negotiation issue Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 02/16] bus/fslmc: fix dereferencing null pointer Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 03/16] bus/fslmc: combine thread specific variables Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 04/16] bus/fslmc: rework portal allocation to a per thread basis Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 05/16] bus/fslmc: support handle portal alloc failure Hemant Agrawal
2020-03-13 16:20     ` Ferruh Yigit
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 06/16] bus/fslmc: limit pthread destructor called for dpaa2 only Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 07/16] bus/fslmc: support portal migration Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 08/16] drivers: enhance portal allocation failure log Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 09/16] bus/fslmc: rename the cinh read functions used for ls1088 Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 10/16] net/dpaa: return error on multiple mp config Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 11/16] net/dpaa: enable Tx queue taildrop Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 12/16] net/dpaa: add 2.5G support Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 13/16] net/dpaa: update process specific device info Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 14/16] bus/dpaa: enable link state interrupt Hemant Agrawal
2020-03-06  9:57   ` [dpdk-dev] [PATCH v2 15/16] bus/dpaa: enable set link status Hemant Agrawal
2020-03-06  9:57   ` Hemant Agrawal [this message]
2020-05-04 12:41   ` [dpdk-dev] [PATCH v3 0/8] NXP DPAAx fixes and enhancements Hemant Agrawal
2020-05-04 12:41     ` [dpdk-dev] [PATCH v3 1/8] bus/fslmc: fix dereferencing null pointer Hemant Agrawal
2020-05-06 21:08       ` Ferruh Yigit
2020-05-06 21:09         ` Ferruh Yigit
2020-05-06 21:14       ` Ferruh Yigit
2020-05-04 12:41     ` [dpdk-dev] [PATCH v3 2/8] net/dpaa2: fix 10g port negotiation issue Hemant Agrawal
2020-05-04 12:41     ` [dpdk-dev] [PATCH v3 3/8] net/dpaa2: do not prefetch annotaion for physical mode Hemant Agrawal
2020-05-04 12:41     ` [dpdk-dev] [PATCH v3 4/8] net/dpaa2: add default Rx params in devinfo Hemant Agrawal
2020-05-06 21:29       ` Ferruh Yigit
2020-05-07  5:35         ` Hemant Agrawal (OSS)
2020-05-04 12:41     ` [dpdk-dev] [PATCH v3 5/8] drivers: dpaa2 enhance portal alloc failure log Hemant Agrawal
2020-05-04 12:41     ` [dpdk-dev] [PATCH v3 6/8] net/dpaa2: support UDP dst port based muxing Hemant Agrawal
2020-05-04 12:41     ` [dpdk-dev] [PATCH v3 7/8] net/dpaa2: reduce prints in queue count functions Hemant Agrawal
2020-05-04 12:41     ` [dpdk-dev] [PATCH v3 8/8] net/dpaa2: use cong group id for multiple tcs Hemant Agrawal
2020-05-06 21:38       ` Ferruh Yigit
2020-05-07  5:37         ` Hemant Agrawal (OSS)
2020-05-07 10:46     ` [dpdk-dev] [PATCH v4 0/9] NXP DPAAx fixes and enhancements Hemant Agrawal
2020-05-07 10:46       ` [dpdk-dev] [PATCH v4 1/9] bus/fslmc: fix dereferencing null pointer Hemant Agrawal
2020-05-07 10:46       ` [dpdk-dev] [PATCH v4 2/9] net/dpaa2: fix 10g port negotiation issue Hemant Agrawal
2020-05-07 14:36         ` Ferruh Yigit
2020-05-07 10:46       ` [dpdk-dev] [PATCH v4 3/9] net/dpaa2: do not prefetch annotaion for physical mode Hemant Agrawal
2020-05-07 10:46       ` [dpdk-dev] [PATCH v4 4/9] net/dpaa2: add default values for Rx params in info Hemant Agrawal
2020-05-07 14:30         ` Ferruh Yigit
2020-05-07 10:46       ` [dpdk-dev] [PATCH v4 5/9] drivers: dpaa2 enhance portal alloc failure log Hemant Agrawal
2020-05-07 14:31         ` Ferruh Yigit
2020-05-07 10:46       ` [dpdk-dev] [PATCH v4 6/9] net/dpaa2: support UDP dst port based muxing Hemant Agrawal
2020-05-07 10:46       ` [dpdk-dev] [PATCH v4 7/9] net/dpaa2: reduce prints in queue count functions Hemant Agrawal
2020-05-07 10:46       ` [dpdk-dev] [PATCH v4 8/9] net/dpaa2: fix cong group id for multiple tcs Hemant Agrawal
2020-05-07 14:33         ` Ferruh Yigit
2020-05-07 10:46       ` [dpdk-dev] [PATCH v4 9/9] bus/fslmc: fix the size of qman fq desc Hemant Agrawal
2020-05-08 12:59       ` [dpdk-dev] [PATCH v5 0/9] NXP DPAAx fixes and enhancements Hemant Agrawal
2020-05-08 12:59         ` [dpdk-dev] [PATCH v5 1/9] net/dpaa2: fix 10G port negotiation issue Hemant Agrawal
2020-05-08 12:59         ` [dpdk-dev] [PATCH v5 2/9] net/dpaa2: do not prefetch annotaion for physical mode Hemant Agrawal
2020-05-08 12:59         ` [dpdk-dev] [PATCH v5 3/9] net/dpaa2: add default values for Rx params in info Hemant Agrawal
2020-05-08 12:59         ` [dpdk-dev] [PATCH v5 4/9] drivers: dpaa2 enhance portal alloc failure log Hemant Agrawal
2020-05-08 12:59         ` [dpdk-dev] [PATCH v5 5/9] net/dpaa2: support UDP dst port based muxing Hemant Agrawal
2020-05-08 12:59         ` [dpdk-dev] [PATCH v5 6/9] net/dpaa2: reduce prints in queue count functions Hemant Agrawal
2020-05-08 12:59         ` [dpdk-dev] [PATCH v5 7/9] net/dpaa2: fix cong group id for multiple tcs Hemant Agrawal
2020-05-08 12:59         ` [dpdk-dev] [PATCH v5 8/9] bus/fslmc: fix the size of qman fq desc Hemant Agrawal
2020-05-08 12:59         ` [dpdk-dev] [PATCH v5 9/9] net/dpaa2: add the support for additional link speeds Hemant Agrawal
2020-05-08 13:02       ` [dpdk-dev] [PATCH v6 00/10] NXP DPAAx fixes and enhancement Hemant Agrawal
2020-05-08 13:02         ` [dpdk-dev] [PATCH v6 01/10] bus/fslmc: fix dereferencing null pointer Hemant Agrawal
2020-05-08 13:02         ` [dpdk-dev] [PATCH v6 02/10] net/dpaa2: fix 10G port negotiation issue Hemant Agrawal
2020-05-08 13:02         ` [dpdk-dev] [PATCH v6 03/10] net/dpaa2: do not prefetch annotaion for physical mode Hemant Agrawal
2020-05-08 13:02         ` [dpdk-dev] [PATCH v6 04/10] net/dpaa2: add default values for Rx params in info Hemant Agrawal
2020-05-08 13:02         ` [dpdk-dev] [PATCH v6 05/10] drivers: dpaa2 enhance portal alloc failure log Hemant Agrawal
2020-05-08 16:07           ` Ferruh Yigit
2020-05-08 13:02         ` [dpdk-dev] [PATCH v6 06/10] net/dpaa2: support UDP dst port based muxing Hemant Agrawal
2020-05-08 13:02         ` [dpdk-dev] [PATCH v6 07/10] net/dpaa2: reduce prints in queue count functions Hemant Agrawal
2020-05-08 13:02         ` [dpdk-dev] [PATCH v6 08/10] net/dpaa2: fix cong group id for multiple tcs Hemant Agrawal
2020-05-08 13:02         ` [dpdk-dev] [PATCH v6 09/10] bus/fslmc: fix the size of qman fq desc Hemant Agrawal
2020-05-08 13:02         ` [dpdk-dev] [PATCH v6 10/10] net/dpaa2: add the support for additional link speeds Hemant Agrawal
2020-05-08 13:08         ` [dpdk-dev] [PATCH v6 00/10] NXP DPAAx fixes and enhancement Hemant Agrawal (OSS)
2020-05-08 19:32           ` Ferruh Yigit

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=20200306095742.18080-17-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=nipun.gupta@nxp.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).