All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: ferruh.yigit@intel.com
Cc: anatoly.burakov@intel.com, dev@dpdk.org,
	Shreyansh Jain <shreyansh.jain@nxp.com>
Subject: [PATCH v2 4/5] dpaa: enable dpaax library
Date: Tue,  9 Oct 2018 16:55:47 +0530	[thread overview]
Message-ID: <20181009112548.7025-5-shreyansh.jain@nxp.com> (raw)
In-Reply-To: <20181009112548.7025-1-shreyansh.jain@nxp.com>

With this patch, dpaa bus and ethernet devices on this bus
would start using the physical-virtual library interfaces.

This patch impacts mempool/dpaa, event/dpaa and net/dpaa as
they are dependent on the bus/dpaa and thus impact linkage of
libraries.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/bus/dpaa/Makefile           | 1 +
 drivers/bus/dpaa/dpaa_bus.c         | 4 ++++
 drivers/bus/dpaa/meson.build        | 2 +-
 drivers/bus/dpaa/rte_dpaa_bus.h     | 6 ++++++
 drivers/crypto/dpaa_sec/Makefile    | 1 +
 drivers/crypto/dpaa_sec/dpaa_sec.c  | 6 ++++++
 drivers/event/dpaa/Makefile         | 1 +
 drivers/mempool/dpaa/Makefile       | 1 +
 drivers/mempool/dpaa/dpaa_mempool.c | 4 ++++
 drivers/mempool/dpaa/dpaa_mempool.h | 4 +---
 drivers/net/dpaa/Makefile           | 1 +
 mk/rte.app.mk                       | 1 +
 12 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/dpaa/Makefile b/drivers/bus/dpaa/Makefile
index bffaa9d92..5eb7c24db 100644
--- a/drivers/bus/dpaa/Makefile
+++ b/drivers/bus/dpaa/Makefile
@@ -48,5 +48,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \
 LDLIBS += -lpthread
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev
+LDLIBS += -lrte_common_dpaax
 
 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 49cd04dbb..b373742e7 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -34,6 +34,7 @@
 
 #include <rte_dpaa_bus.h>
 #include <rte_dpaa_logs.h>
+#include <dpaax_iova_table.h>
 
 #include <fsl_usd.h>
 #include <fsl_qman.h>
@@ -546,6 +547,9 @@ rte_dpaa_bus_probe(void)
 		fclose(svr_file);
 	}
 
+	/* And initialize the PA->VA translation table */
+	dpaax_iova_table_populate();
+
 	/* For each registered driver, and device, call the driver->probe */
 	TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {
 		TAILQ_FOREACH(drv, &rte_dpaa_bus.driver_list, next) {
diff --git a/drivers/bus/dpaa/meson.build b/drivers/bus/dpaa/meson.build
index d10b62c03..42676fbc5 100644
--- a/drivers/bus/dpaa/meson.build
+++ b/drivers/bus/dpaa/meson.build
@@ -5,7 +5,7 @@ if host_machine.system() != 'linux'
         build = false
 endif
 
-deps += ['eventdev']
+deps += ['common_dpaax', 'eventdev']
 sources = files('base/fman/fman.c',
 		'base/fman/fman_hw.c',
 		'base/fman/netcfg_layer.c',
diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h
index 15dc6a4ac..1d580a000 100644
--- a/drivers/bus/dpaa/rte_dpaa_bus.h
+++ b/drivers/bus/dpaa/rte_dpaa_bus.h
@@ -8,6 +8,7 @@
 
 #include <rte_bus.h>
 #include <rte_mempool.h>
+#include <dpaax_iova_table.h>
 
 #include <fsl_usd.h>
 #include <fsl_qman.h>
@@ -110,6 +111,11 @@ extern struct dpaa_memseg_list rte_dpaa_memsegs;
 static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr)
 {
 	struct dpaa_memseg *ms;
+	void *va;
+
+	va = dpaax_iova_table_get_va(paddr);
+	if (likely(va != NULL))
+		return va;
 
 	/* Check if the address is already part of the memseg list internally
 	 * maintained by the dpaa driver.
diff --git a/drivers/crypto/dpaa_sec/Makefile b/drivers/crypto/dpaa_sec/Makefile
index 9be447041..674a7a398 100644
--- a/drivers/crypto/dpaa_sec/Makefile
+++ b/drivers/crypto/dpaa_sec/Makefile
@@ -38,5 +38,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_DPAA_SEC) += dpaa_sec.c
 
 LDLIBS += -lrte_bus_dpaa
 LDLIBS += -lrte_mempool_dpaa
+LDLIBS += -lrte_common_dpaax
 
 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 7c0459f9f..54f1913f2 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -107,6 +107,12 @@ dpaa_mem_vtop(void *vaddr)
 static inline void *
 dpaa_mem_ptov(rte_iova_t paddr)
 {
+	void *va;
+
+	va = (void *)dpaax_iova_table_get_va(paddr);
+	if (likely(va))
+		return va;
+
 	return rte_mem_iova2virt(paddr);
 }
 
diff --git a/drivers/event/dpaa/Makefile b/drivers/event/dpaa/Makefile
index ddd855227..6f93e7f40 100644
--- a/drivers/event/dpaa/Makefile
+++ b/drivers/event/dpaa/Makefile
@@ -34,5 +34,6 @@ LDLIBS += -lrte_mempool_dpaa
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
 LDLIBS += -lrte_eventdev -lrte_pmd_dpaa -lrte_bus_vdev
+LDLIBS += -lrte_common_dpaax
 
 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/mempool/dpaa/Makefile b/drivers/mempool/dpaa/Makefile
index da8da1e90..9cf36856c 100644
--- a/drivers/mempool/dpaa/Makefile
+++ b/drivers/mempool/dpaa/Makefile
@@ -31,5 +31,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_MEMPOOL) += dpaa_mempool.c
 
 LDLIBS += -lrte_bus_dpaa
 LDLIBS += -lrte_eal -lrte_mempool -lrte_ring
+LDLIBS += -lrte_common_dpaax
 
 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index 1c121223b..b05fb7b9d 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -26,6 +26,7 @@
 #include <rte_ring.h>
 
 #include <dpaa_mempool.h>
+#include <dpaax_iova_table.h>
 
 /* List of all the memseg information locally maintained in dpaa driver. This
  * is to optimize the PA_to_VA searches until a better mechanism (algo) is
@@ -285,6 +286,9 @@ dpaa_populate(struct rte_mempool *mp, unsigned int max_objs,
 		return 0;
 	}
 
+	/* Update the PA-VA Table */
+	dpaax_iova_table_update(paddr, vaddr, len);
+
 	bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp);
 	total_elt_sz = mp->header_size + mp->elt_size + mp->trailer_size;
 
diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 092f326cb..533e1c6e2 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -43,10 +43,8 @@ struct dpaa_bp_info {
 };
 
 static inline void *
-DPAA_MEMPOOL_PTOV(struct dpaa_bp_info *bp_info, uint64_t addr)
+DPAA_MEMPOOL_PTOV(struct dpaa_bp_info *bp_info __rte_unused, uint64_t addr)
 {
-	if (bp_info->ptov_off)
-		return ((void *) (size_t)(addr + bp_info->ptov_off));
 	return rte_dpaa_mem_ptov(addr);
 }
 
diff --git a/drivers/net/dpaa/Makefile b/drivers/net/dpaa/Makefile
index d7a0a50c5..1c4f7d914 100644
--- a/drivers/net/dpaa/Makefile
+++ b/drivers/net/dpaa/Makefile
@@ -38,6 +38,7 @@ LDLIBS += -lrte_bus_dpaa
 LDLIBS += -lrte_mempool_dpaa
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
+LDLIBS += -lrte_common_dpaax
 
 # install this header file
 SYMLINK-$(CONFIG_RTE_LIBRTE_DPAA_PMD)-include := rte_pmd_dpaa.h
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 32579e4b7..15097995e 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -115,6 +115,7 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
 _LDLIBS-$(CONFIG_RTE_DRIVER_MEMPOOL_BUCKET) += -lrte_mempool_bucket
 _LDLIBS-$(CONFIG_RTE_DRIVER_MEMPOOL_STACK)  += -lrte_mempool_stack
 ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_COMMON_DPAAX)   += -lrte_common_dpaax
 _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA_MEMPOOL)   += -lrte_mempool_dpaa
 endif
 ifeq ($(CONFIG_RTE_EAL_VFIO)$(CONFIG_RTE_LIBRTE_FSLMC_BUS),yy)
-- 
2.17.1

  parent reply	other threads:[~2018-10-09 11:26 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 12:54 [PATCH 0/5] Add a PA-VA Translation table for DPAAx Shreyansh Jain
2018-09-25 12:54 ` [PATCH 1/5] bus/fslmc: fix physical addressing check Shreyansh Jain
2018-09-25 12:54 ` [PATCH 2/5] drivers: common as dependency for bus Shreyansh Jain
2018-09-25 12:54 ` [PATCH 3/5] common/dpaax: add library for PA VA translation table Shreyansh Jain
2018-09-25 13:28   ` Burakov, Anatoly
2018-09-25 13:39     ` Shreyansh Jain
2018-09-25 13:51       ` Burakov, Anatoly
2018-09-25 14:00         ` Shreyansh Jain
2018-09-25 14:08           ` Burakov, Anatoly
2018-09-26 10:16             ` Burakov, Anatoly
2018-10-09 10:45       ` Shreyansh Jain
2018-10-11  9:03         ` Burakov, Anatoly
2018-10-11 10:02           ` Shreyansh Jain
2018-10-11 10:07             ` Shreyansh Jain
2018-10-11 10:13               ` Burakov, Anatoly
2018-10-11 10:39                 ` Shreyansh Jain
2018-10-11 10:46                   ` Burakov, Anatoly
2018-10-11 10:09             ` Burakov, Anatoly
2018-09-25 12:54 ` [PATCH 4/5] dpaa: enable dpaax library Shreyansh Jain
2018-09-25 12:54 ` [PATCH 5/5] fslmc: " Shreyansh Jain
2018-10-09 11:25 ` [PATCH v2 0/5] Add a PA-VA Translation table for DPAAx Shreyansh Jain
2018-10-09 11:25   ` [PATCH v2 1/5] bus/fslmc: fix physical addressing check Shreyansh Jain
2018-10-12  9:01     ` Pavan Nikhilesh
2018-10-12 10:44       ` Shreyansh Jain
2018-10-12 16:29         ` Pavan Nikhilesh
2018-10-09 11:25   ` [PATCH v2 2/5] drivers: common as dependency for bus Shreyansh Jain
2018-10-09 11:25   ` [PATCH v2 3/5] common/dpaax: add library for PA VA translation table Shreyansh Jain
2018-10-09 11:25   ` Shreyansh Jain [this message]
2018-10-09 11:25   ` [PATCH v2 5/5] fslmc: enable dpaax library Shreyansh Jain
2018-10-13 12:21   ` [PATCH v3 0/5] Add a PA-VA Translation table for DPAAx Shreyansh Jain
2018-10-13 12:21     ` [PATCH v3 1/5] bus/fslmc: fix physical addressing check Shreyansh Jain
2018-10-13 16:08       ` Pavan Nikhilesh
2018-10-15  6:36         ` Shreyansh Jain
2018-10-13 12:21     ` [PATCH v3 2/5] drivers: common as dependency for bus Shreyansh Jain
2018-10-13 12:21     ` [PATCH v3 3/5] common/dpaax: add library for PA VA translation table Shreyansh Jain
2018-10-13 12:21     ` [PATCH v3 4/5] dpaa: enable dpaax library Shreyansh Jain
2018-10-13 12:21     ` [PATCH v3 5/5] fslmc: " Shreyansh Jain
2018-10-15  6:41     ` [PATCH v4 0/5] Add a PA-VA Translation table for DPAAx Shreyansh Jain
2018-10-15  6:41       ` [PATCH v4 1/5] bus/fslmc: fix physical addressing check Shreyansh Jain
2018-10-15  6:41       ` [PATCH v4 2/5] drivers: common as dependency for bus Shreyansh Jain
2018-10-15  6:42       ` [PATCH v4 3/5] common/dpaax: add library for PA VA translation table Shreyansh Jain
2018-10-15  6:42       ` [PATCH v4 4/5] dpaa: enable dpaax library Shreyansh Jain
2018-10-15  6:42       ` [PATCH v4 5/5] fslmc: " Shreyansh Jain
2018-10-15 12:01       ` [PATCH v5 0/5] Shreyansh Jain
2018-10-15 12:01         ` [PATCH v5 1/5] bus/fslmc: fix physical addressing check Shreyansh Jain
2018-10-16 10:02           ` Thomas Monjalon
2018-10-15 12:01         ` [PATCH v5 2/5] drivers: common as dependency for bus Shreyansh Jain
2018-10-15 12:01         ` [PATCH v5 3/5] common/dpaax: add library for PA VA translation table Shreyansh Jain
2018-10-15 23:17           ` Thomas Monjalon
2018-10-15 12:01         ` [PATCH v5 4/5] dpaa: enable dpaax library Shreyansh Jain
2018-10-15 12:01         ` [PATCH v5 5/5] fslmc: " Shreyansh Jain
2018-10-16 10:18         ` [PATCH v5 0/5] 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=20181009112548.7025-5-shreyansh.jain@nxp.com \
    --to=shreyansh.jain@nxp.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.