[dpdk-dev,v4,02/41] bus/dpaa: introduce NXP DPAA Bus driver skeleton

Message ID 20170909112132.13936-3-shreyansh.jain@nxp.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

Shreyansh Jain Sept. 9, 2017, 11:20 a.m. UTC
  Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 MAINTAINERS                               |   5 +
 config/common_base                        |   3 +
 config/defconfig_arm64-dpaa-linuxapp-gcc  |   6 +
 drivers/bus/Makefile                      |   3 +
 drivers/bus/dpaa/Makefile                 |  62 +++++++++
 drivers/bus/dpaa/dpaa_bus.c               | 207 ++++++++++++++++++++++++++++++
 drivers/bus/dpaa/rte_bus_dpaa_version.map |   7 +
 drivers/bus/dpaa/rte_dpaa_bus.h           | 164 +++++++++++++++++++++++
 drivers/bus/dpaa/rte_dpaa_logs.h          |  66 ++++++++++
 9 files changed, 523 insertions(+)
 create mode 100644 drivers/bus/dpaa/Makefile
 create mode 100644 drivers/bus/dpaa/dpaa_bus.c
 create mode 100644 drivers/bus/dpaa/rte_bus_dpaa_version.map
 create mode 100644 drivers/bus/dpaa/rte_dpaa_bus.h
 create mode 100644 drivers/bus/dpaa/rte_dpaa_logs.h
  

Comments

Ferruh Yigit Sept. 18, 2017, 2:47 p.m. UTC | #1
On 9/9/2017 12:20 PM, Shreyansh Jain wrote:
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

<...>

> diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
> new file mode 100644
> index 0000000..d97a009
> --- /dev/null
> +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
> @@ -0,0 +1,7 @@
> +DPDK_17.11 {
> +	global:
> +
> +	rte_dpaa_driver_register;
> +	rte_dpaa_driver_unregister;

"local *;" ?

<...>

> +struct rte_dpaa_device {
> +	TAILQ_ENTRY(rte_dpaa_device) next;
> +	struct rte_device device;
> +	union {
> +		struct rte_eth_dev *eth_dev;
> +		struct rte_cryptodev *crypto_dev;
> +	};

Bus struct should be independt from functionality, this has been done in
PCI, can same thing be done for dpaa bus too?

<...>

> + * @return
> + *	0 in case of success, error otherwise
> + */
> +int rte_dpaa_portal_init(void *arg);

Definition is not in this patch.

> +
> +/**
> + * Cleanup a DPAA Portal
> + */
> +void dpaa_portal_finish(void *arg);

Definition is not in this patch.

<...>
  
Shreyansh Jain Sept. 19, 2017, 1:14 p.m. UTC | #2
Hello Ferruh,

On Monday 18 September 2017 08:17 PM, Ferruh Yigit wrote:
> On 9/9/2017 12:20 PM, Shreyansh Jain wrote:
>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> 
> <...>
> 
>> diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
>> new file mode 100644
>> index 0000000..d97a009
>> --- /dev/null
>> +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
>> @@ -0,0 +1,7 @@
>> +DPDK_17.11 {
>> +	global:
>> +
>> +	rte_dpaa_driver_register;
>> +	rte_dpaa_driver_unregister;
> 
> "local *;" ?

Agree. I will change this.
Currently rte_dpaa_driver_* functions are being used locally within 
bus/dpaa.

> 
> <...>
> 
>> +struct rte_dpaa_device {
>> +	TAILQ_ENTRY(rte_dpaa_device) next;
>> +	struct rte_device device;
>> +	union {
>> +		struct rte_eth_dev *eth_dev;
>> +		struct rte_cryptodev *crypto_dev;
>> +	};
> 
> Bus struct should be independt from functionality, this has been done in
> PCI, can same thing be done for dpaa bus too?

Sorry, I didn't get your point. This is the rte_dpaa_bus structure:

struct rte_dpaa_bus {
         struct rte_bus bus;
         struct rte_dpaa_device_list device_list;
         struct rte_dpaa_driver_list driver_list;
         int device_count;
};

If you are referring to unlinking eth/crypto functionality from 
rte_dpaa_device - that is something which needs investigation. I have 
seen patches on PCI from Gaetan. Can that be an incremental change over 
this?

> 
> <...>
> 
>> + * @return
>> + *	0 in case of success, error otherwise
>> + */
>> +int rte_dpaa_portal_init(void *arg);
> 
> Definition is not in this patch.
> 
>> +
>> +/**
>> + * Cleanup a DPAA Portal
>> + */
>> +void dpaa_portal_finish(void *arg);
> 
> Definition is not in this patch.
> 
> <...>
> 

Yes, this is my mistake. I will fix this.
  
Ferruh Yigit Sept. 19, 2017, 1:33 p.m. UTC | #3
On 9/19/2017 2:14 PM, Shreyansh Jain wrote:
> Hello Ferruh,
> 
> On Monday 18 September 2017 08:17 PM, Ferruh Yigit wrote:
>> On 9/9/2017 12:20 PM, Shreyansh Jain wrote:
>>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

<...>

>>> +struct rte_dpaa_device {
>>> +	TAILQ_ENTRY(rte_dpaa_device) next;
>>> +	struct rte_device device;
>>> +	union {
>>> +		struct rte_eth_dev *eth_dev;
>>> +		struct rte_cryptodev *crypto_dev;
>>> +	};
>>
>> Bus struct should be independt from functionality, this has been done in
>> PCI, can same thing be done for dpaa bus too?
> 
> Sorry, I didn't get your point. This is the rte_dpaa_bus structure:
> 
> struct rte_dpaa_bus {
>          struct rte_bus bus;
>          struct rte_dpaa_device_list device_list;
>          struct rte_dpaa_driver_list driver_list;
>          int device_count;
> };
> 
> If you are referring to unlinking eth/crypto functionality from 
> rte_dpaa_device - that is something which needs investigation. I have 
> seen patches on PCI from Gaetan. Can that be an incremental change over 
> this?

Yes, I was refereeing this. I am OK doing this incremental.

<...>
  
Shreyansh Jain Sept. 25, 2017, 2:32 p.m. UTC | #4
On Tuesday 19 September 2017 06:44 PM, Shreyansh Jain wrote:
> Hello Ferruh,
> 
> On Monday 18 September 2017 08:17 PM, Ferruh Yigit wrote:
>> On 9/9/2017 12:20 PM, Shreyansh Jain wrote:
>>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>>
>> <...>
>>
>>> diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map 
>>> b/drivers/bus/dpaa/rte_bus_dpaa_version.map
>>> new file mode 100644
>>> index 0000000..d97a009
>>> --- /dev/null
>>> +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
>>> @@ -0,0 +1,7 @@
>>> +DPDK_17.11 {
>>> +    global:
>>> +
>>> +    rte_dpaa_driver_register;
>>> +    rte_dpaa_driver_unregister;
>>
>> "local *;" ?
> 
> Agree. I will change this.
> Currently rte_dpaa_driver_* functions are being used locally within 
> bus/dpaa.
> 

Even though I agree earlier that I will change this (append 'local *:' 
to the file), probably I will have to skip this.
Further in the patch series, there are some symbols which are added 
which are required by the mempool and net drivers (and crypto, in 
future). Shared compilation fails for them if I add 'local: *;' here.
  
Ferruh Yigit Sept. 25, 2017, 3:11 p.m. UTC | #5
On 9/25/2017 3:32 PM, Shreyansh Jain wrote:
> On Tuesday 19 September 2017 06:44 PM, Shreyansh Jain wrote:
>> Hello Ferruh,
>>
>> On Monday 18 September 2017 08:17 PM, Ferruh Yigit wrote:
>>> On 9/9/2017 12:20 PM, Shreyansh Jain wrote:
>>>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>>>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>>>
>>> <...>
>>>
>>>> diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map 
>>>> b/drivers/bus/dpaa/rte_bus_dpaa_version.map
>>>> new file mode 100644
>>>> index 0000000..d97a009
>>>> --- /dev/null
>>>> +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
>>>> @@ -0,0 +1,7 @@
>>>> +DPDK_17.11 {
>>>> +    global:
>>>> +
>>>> +    rte_dpaa_driver_register;
>>>> +    rte_dpaa_driver_unregister;
>>>
>>> "local *;" ?
>>
>> Agree. I will change this.
>> Currently rte_dpaa_driver_* functions are being used locally within 
>> bus/dpaa.
>>
> 
> Even though I agree earlier that I will change this (append 'local *:' 
> to the file), probably I will have to skip this.
> Further in the patch series, there are some symbols which are added 
> which are required by the mempool and net drivers (and crypto, in 
> future). Shared compilation fails for them if I add 'local: *;' here.

It should be OK if this is last item in the first group.

Technically I believe it will be OK to remove that line, but not quite sure.

Lets be consistent with exiting usage and keep it, there are many sample
map files.
  
Shreyansh Jain Sept. 26, 2017, 11:26 a.m. UTC | #6
On Monday 25 September 2017 08:41 PM, Ferruh Yigit wrote:
> On 9/25/2017 3:32 PM, Shreyansh Jain wrote:
>> On Tuesday 19 September 2017 06:44 PM, Shreyansh Jain wrote:
>>> Hello Ferruh,
>>>
>>> On Monday 18 September 2017 08:17 PM, Ferruh Yigit wrote:
>>>> On 9/9/2017 12:20 PM, Shreyansh Jain wrote:
>>>>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>>>>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>>>>
>>>> <...>
>>>>
>>>>> diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map
>>>>> b/drivers/bus/dpaa/rte_bus_dpaa_version.map
>>>>> new file mode 100644
>>>>> index 0000000..d97a009
>>>>> --- /dev/null
>>>>> +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
>>>>> @@ -0,0 +1,7 @@
>>>>> +DPDK_17.11 {
>>>>> +    global:
>>>>> +
>>>>> +    rte_dpaa_driver_register;
>>>>> +    rte_dpaa_driver_unregister;
>>>>
>>>> "local *;" ?
>>>
>>> Agree. I will change this.
>>> Currently rte_dpaa_driver_* functions are being used locally within
>>> bus/dpaa.
>>>
>>
>> Even though I agree earlier that I will change this (append 'local *:'
>> to the file), probably I will have to skip this.
>> Further in the patch series, there are some symbols which are added
>> which are required by the mempool and net drivers (and crypto, in
>> future). Shared compilation fails for them if I add 'local: *;' here.
> 
> It should be OK if this is last item in the first group.
> 
> Technically I believe it will be OK to remove that line, but not quite sure.
> 
> Lets be consistent with exiting usage and keep it, there are many sample
> map files.

I understand your point. Let me try - it is possible that I am doing 
something incorrect.
Thanks.
  
Shreyansh Jain Sept. 27, 2017, 9:30 a.m. UTC | #7
On Monday 25 September 2017 08:41 PM, Ferruh Yigit wrote:
> On 9/25/2017 3:32 PM, Shreyansh Jain wrote:
>> On Tuesday 19 September 2017 06:44 PM, Shreyansh Jain wrote:
>>> Hello Ferruh,
>>>
>>> On Monday 18 September 2017 08:17 PM, Ferruh Yigit wrote:
>>>> On 9/9/2017 12:20 PM, Shreyansh Jain wrote:
>>>>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>>>>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>>>>
>>>> <...>
>>>>
>>>>> diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map
>>>>> b/drivers/bus/dpaa/rte_bus_dpaa_version.map
>>>>> new file mode 100644
>>>>> index 0000000..d97a009
>>>>> --- /dev/null
>>>>> +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
>>>>> @@ -0,0 +1,7 @@
>>>>> +DPDK_17.11 {
>>>>> +    global:
>>>>> +
>>>>> +    rte_dpaa_driver_register;
>>>>> +    rte_dpaa_driver_unregister;
>>>>
>>>> "local *;" ?
>>>
>>> Agree. I will change this.
>>> Currently rte_dpaa_driver_* functions are being used locally within
>>> bus/dpaa.
>>>
>>
>> Even though I agree earlier that I will change this (append 'local *:'
>> to the file), probably I will have to skip this.
>> Further in the patch series, there are some symbols which are added
>> which are required by the mempool and net drivers (and crypto, in
>> future). Shared compilation fails for them if I add 'local: *;' here.
> 
> It should be OK if this is last item in the first group.
> 
> Technically I believe it will be OK to remove that line, but not quite sure.
> 
> Lets be consistent with exiting usage and keep it, there are many sample
> map files.
> 

I had a look at the various map files in code. There is a mixed usage.
Most don't have 'local' tag in their last blocks which exposes symbols. 
Some, like octeonx, bnxt have both.

I am not very sure of how this changes the scope of variables. So, as of 
now I have made DPAA to have both - global and local in its 17.11 symbol 
block.
  

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index a0cd75e..6ee20ce 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -405,6 +405,11 @@  F: drivers/net/nfp/
 F: doc/guides/nics/nfp.rst
 F: doc/guides/nics/features/nfp.ini
 
+NXP dpaa
+M: Hemant Agrawal <hemant.agrawal@nxp.com>
+M: Shreyansh Jain <shreyansh.jain@nxp.com>
+F: drivers/bus/dpaa/
+
 NXP dpaa2
 M: Hemant Agrawal <hemant.agrawal@nxp.com>
 M: Shreyansh Jain <shreyansh.jain@nxp.com>
diff --git a/config/common_base b/config/common_base
index 5e97a08..2bb2269 100644
--- a/config/common_base
+++ b/config/common_base
@@ -303,6 +303,9 @@  CONFIG_RTE_LIBRTE_LIO_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_LIO_DEBUG_MBOX=n
 CONFIG_RTE_LIBRTE_LIO_DEBUG_REGS=n
 
+# NXP DPAA Bus
+CONFIG_RTE_LIBRTE_DPAA_BUS=n
+
 #
 # Compile NXP DPAA2 FSL-MC Bus
 #
diff --git a/config/defconfig_arm64-dpaa-linuxapp-gcc b/config/defconfig_arm64-dpaa-linuxapp-gcc
index 0815026..110042c 100644
--- a/config/defconfig_arm64-dpaa-linuxapp-gcc
+++ b/config/defconfig_arm64-dpaa-linuxapp-gcc
@@ -37,3 +37,9 @@  CONFIG_RTE_MACHINE="dpaa"
 CONFIG_RTE_ARCH_ARM_TUNE="cortex-a72"
 CONFIG_RTE_LIBRTE_VHOST_NUMA=n
 CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n
+
+# NXP DPAA Bus
+CONFIG_RTE_LIBRTE_DPAA_BUS=y
+CONFIG_RTE_LIBRTE_DPAA_DEBUG_BUS=n
+CONFIG_RTE_LIBRTE_DPAA_DEBUG_INIT=n
+CONFIG_RTE_LIBRTE_DPAA_DEBUG_DRIVER=n
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index 0224214..6cb6466 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -32,6 +32,9 @@  include $(RTE_SDK)/mk/rte.vars.mk
 
 core-libs := librte_eal librte_mbuf librte_mempool librte_ring librte_ether
 
+DIRS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += dpaa
+DEPDIRS-dpaa = $(core-libs)
+
 DIRS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc
 DEPDIRS-fslmc = $(core-libs)
 
diff --git a/drivers/bus/dpaa/Makefile b/drivers/bus/dpaa/Makefile
new file mode 100644
index 0000000..ef508d3
--- /dev/null
+++ b/drivers/bus/dpaa/Makefile
@@ -0,0 +1,62 @@ 
+#   BSD LICENSE
+#
+#   Copyright 2016 NXP.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of NXP nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+RTE_BUS_DPAA=$(RTE_SDK)/drivers/bus/dpaa
+
+#
+# library name
+#
+LIB = librte_bus_dpaa.a
+
+ifeq ($(CONFIG_RTE_LIBRTE_DPAA_DEBUG_INIT),y)
+CFLAGS += -O0 -g
+CFLAGS += "-Wno-error"
+else
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+endif
+
+CFLAGS += -I$(RTE_BUS_DPAA)/
+CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal
+CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
+
+# versioning export map
+EXPORT_MAP := rte_bus_dpaa_version.map
+
+LIBABIVER := 1
+
+# all source are stored in SRCS-y
+#
+SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \
+	dpaa_bus.c
+
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
new file mode 100644
index 0000000..cc343b3
--- /dev/null
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -0,0 +1,207 @@ 
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright 2017 NXP.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of NXP nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/* System headers */
+#include <stdio.h>
+#include <inttypes.h>
+#include <unistd.h>
+#include <limits.h>
+#include <sched.h>
+#include <signal.h>
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#include <rte_config.h>
+#include <rte_byteorder.h>
+#include <rte_common.h>
+#include <rte_interrupts.h>
+#include <rte_log.h>
+#include <rte_debug.h>
+#include <rte_pci.h>
+#include <rte_atomic.h>
+#include <rte_branch_prediction.h>
+#include <rte_memory.h>
+#include <rte_memzone.h>
+#include <rte_tailq.h>
+#include <rte_eal.h>
+#include <rte_alarm.h>
+#include <rte_ether.h>
+#include <rte_ethdev.h>
+#include <rte_malloc.h>
+#include <rte_ring.h>
+#include <rte_bus.h>
+
+#include <rte_dpaa_bus.h>
+#include <rte_dpaa_logs.h>
+
+int dpaa_logtype_bus;
+
+struct rte_dpaa_bus rte_dpaa_bus;
+
+static inline void
+dpaa_add_to_device_list(struct rte_dpaa_device *dev)
+{
+	TAILQ_INSERT_TAIL(&rte_dpaa_bus.device_list, dev, next);
+}
+
+static inline void
+dpaa_remove_from_device_list(struct rte_dpaa_device *dev)
+{
+	TAILQ_INSERT_TAIL(&rte_dpaa_bus.device_list, dev, next);
+}
+
+static int
+rte_dpaa_bus_scan(void)
+{
+	BUS_INIT_FUNC_TRACE();
+
+	return 0;
+}
+
+/* register a dpaa bus based dpaa driver */
+void
+rte_dpaa_driver_register(struct rte_dpaa_driver *driver)
+{
+	RTE_VERIFY(driver);
+
+	BUS_INIT_FUNC_TRACE();
+
+	TAILQ_INSERT_TAIL(&rte_dpaa_bus.driver_list, driver, next);
+	/* Update Bus references */
+	driver->dpaa_bus = &rte_dpaa_bus;
+}
+
+/* un-register a dpaa bus based dpaa driver */
+void
+rte_dpaa_driver_unregister(struct rte_dpaa_driver *driver)
+{
+	struct rte_dpaa_bus *dpaa_bus;
+
+	BUS_INIT_FUNC_TRACE();
+
+	dpaa_bus = driver->dpaa_bus;
+
+	TAILQ_REMOVE(&dpaa_bus->driver_list, driver, next);
+	/* Update Bus references */
+	driver->dpaa_bus = NULL;
+}
+
+static int
+rte_dpaa_device_match(struct rte_dpaa_driver *drv,
+		      struct rte_dpaa_device *dev)
+{
+	int ret = -1;
+
+	BUS_INIT_FUNC_TRACE();
+
+	if (!drv || !dev) {
+		DPAA_BUS_DEBUG("Invalid drv or dev received.");
+		return ret;
+	}
+
+	if (drv->drv_type == dev->device_type) {
+		DPAA_BUS_INFO("Device: %s matches for driver: %s",
+			      dev->name, drv->driver.name);
+		ret = 0; /* Found a match */
+	}
+
+	return ret;
+}
+
+static int
+rte_dpaa_bus_probe(void)
+{
+	int ret = -1;
+	struct rte_dpaa_device *dev;
+	struct rte_dpaa_driver *drv;
+
+	BUS_INIT_FUNC_TRACE();
+
+	/* 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) {
+			ret = rte_dpaa_device_match(drv, dev);
+			if (ret)
+				continue;
+
+			if (!drv->probe)
+				continue;
+
+			ret = drv->probe(drv, dev);
+			if (ret)
+				DPAA_BUS_ERR("Unable to probe.\n");
+			break;
+		}
+	}
+	return 0;
+}
+
+static struct rte_device *
+rte_dpaa_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
+		     const void *data)
+{
+	struct rte_dpaa_device *dev;
+
+	TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {
+		if (start && &dev->device == start) {
+			start = NULL;  /* starting point found */
+			continue;
+		}
+
+		if (cmp(&dev->device, data) == 0)
+			return &dev->device;
+	}
+
+	return NULL;
+}
+
+struct rte_dpaa_bus rte_dpaa_bus = {
+	.bus = {
+		.scan = rte_dpaa_bus_scan,
+		.probe = rte_dpaa_bus_probe,
+		.find_device = rte_dpaa_find_device,
+	},
+	.device_list = TAILQ_HEAD_INITIALIZER(rte_dpaa_bus.device_list),
+	.driver_list = TAILQ_HEAD_INITIALIZER(rte_dpaa_bus.driver_list),
+	.device_count = 0,
+};
+
+RTE_REGISTER_BUS(FSL_DPAA_BUS_NAME, rte_dpaa_bus.bus);
+
+RTE_INIT(dpaa_init_log);
+static void
+dpaa_init_log(void)
+{
+	dpaa_logtype_bus = rte_log_register("bus.dpaa");
+	if (dpaa_logtype_bus >= 0)
+		rte_log_set_level(dpaa_logtype_bus, RTE_LOG_NOTICE);
+}
diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
new file mode 100644
index 0000000..d97a009
--- /dev/null
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -0,0 +1,7 @@ 
+DPDK_17.11 {
+	global:
+
+	rte_dpaa_driver_register;
+	rte_dpaa_driver_unregister;
+
+};
diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h
new file mode 100644
index 0000000..8a1e192
--- /dev/null
+++ b/drivers/bus/dpaa/rte_dpaa_bus.h
@@ -0,0 +1,164 @@ 
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright 2017 NXP.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of NXP nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef __RTE_DPAA_BUS_H__
+#define __RTE_DPAA_BUS_H__
+
+#include <rte_bus.h>
+#include <rte_mempool.h>
+
+#define FSL_DPAA_BUS_NAME	"FSL_DPAA_BUS"
+
+#define DEV_TO_DPAA_DEVICE(ptr)	\
+		container_of(ptr, struct rte_dpaa_device, device)
+
+struct rte_dpaa_device;
+struct rte_dpaa_driver;
+
+/* DPAA Device and Driver lists for DPAA bus */
+TAILQ_HEAD(rte_dpaa_device_list, rte_dpaa_device);
+TAILQ_HEAD(rte_dpaa_driver_list, rte_dpaa_driver);
+
+enum rte_dpaa_type {
+	FSL_DPAA_ETH = 1,
+	FSL_DPAA_CRYPTO,
+};
+
+struct rte_dpaa_bus {
+	struct rte_bus bus;
+	struct rte_dpaa_device_list device_list;
+	struct rte_dpaa_driver_list driver_list;
+	int device_count;
+};
+
+struct dpaa_device_id {
+	uint8_t fman_id; /**< Fman interface ID, for ETH type device */
+	uint8_t mac_id; /**< Fman MAC interface ID, for ETH type device */
+	uint16_t dev_id; /**< Device Identifier from DPDK */
+};
+
+struct rte_dpaa_device {
+	TAILQ_ENTRY(rte_dpaa_device) next;
+	struct rte_device device;
+	union {
+		struct rte_eth_dev *eth_dev;
+		struct rte_cryptodev *crypto_dev;
+	};
+	struct rte_dpaa_driver *driver;
+	struct dpaa_device_id id;
+	enum rte_dpaa_type device_type; /**< Ethernet or crypto type device */
+	char name[RTE_ETH_NAME_MAX_LEN];
+};
+
+typedef int (*rte_dpaa_probe_t)(struct rte_dpaa_driver *dpaa_drv,
+				struct rte_dpaa_device *dpaa_dev);
+typedef int (*rte_dpaa_remove_t)(struct rte_dpaa_device *dpaa_dev);
+
+struct rte_dpaa_driver {
+	TAILQ_ENTRY(rte_dpaa_driver) next;
+	struct rte_driver driver;
+	struct rte_dpaa_bus *dpaa_bus;
+	enum rte_dpaa_type drv_type;
+	rte_dpaa_probe_t probe;
+	rte_dpaa_remove_t remove;
+};
+
+struct dpaa_portal {
+	uint32_t bman_idx; /**< BMAN Portal ID*/
+	uint32_t qman_idx; /**< QMAN Portal ID*/
+	uint64_t tid;/**< Parent Thread id for this portal */
+};
+
+/* TODO - this is costly, need to write a fast coversion routine */
+static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr)
+{
+	const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
+	int i;
+
+	for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr != NULL; i++) {
+		if (paddr >= memseg[i].phys_addr && paddr <
+			memseg[i].phys_addr + memseg[i].len)
+			return (uint8_t *)(memseg[i].addr) +
+			       (paddr - memseg[i].phys_addr);
+	}
+
+	return NULL;
+}
+
+/**
+ * Register a DPAA driver.
+ *
+ * @param driver
+ *   A pointer to a rte_dpaa_driver structure describing the driver
+ *   to be registered.
+ */
+void rte_dpaa_driver_register(struct rte_dpaa_driver *driver);
+
+/**
+ * Unregister a DPAA driver.
+ *
+ * @param driver
+ *	A pointer to a rte_dpaa_driver structure describing the driver
+ *	to be unregistered.
+ */
+void rte_dpaa_driver_unregister(struct rte_dpaa_driver *driver);
+
+/**
+ * Initialize a DPAA portal
+ *
+ * @param arg
+ *	Per thread ID
+ *
+ * @return
+ *	0 in case of success, error otherwise
+ */
+int rte_dpaa_portal_init(void *arg);
+
+/**
+ * Cleanup a DPAA Portal
+ */
+void dpaa_portal_finish(void *arg);
+
+/** Helper for DPAA device registration from driver (eth, crypto) instance */
+#define RTE_PMD_REGISTER_DPAA(nm, dpaa_drv) \
+RTE_INIT(dpaainitfn_ ##nm); \
+static void dpaainitfn_ ##nm(void) \
+{\
+	(dpaa_drv).driver.name = RTE_STR(nm);\
+	rte_dpaa_driver_register(&dpaa_drv); \
+} \
+RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __RTE_DPAA_BUS_H__ */
diff --git a/drivers/bus/dpaa/rte_dpaa_logs.h b/drivers/bus/dpaa/rte_dpaa_logs.h
new file mode 100644
index 0000000..3ca3f9b
--- /dev/null
+++ b/drivers/bus/dpaa/rte_dpaa_logs.h
@@ -0,0 +1,66 @@ 
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright 2017 NXP.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of NXP nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _DPAA_LOGS_H_
+#define _DPAA_LOGS_H_
+
+#include <rte_log.h>
+
+extern int dpaa_logtype_bus;
+
+#define DPAA_BUS_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "%s(): " fmt "\n", \
+		__func__, ##args)
+
+#define BUS_INIT_FUNC_TRACE() DPAA_BUS_LOG(DEBUG, " >>")
+
+#ifdef RTE_LIBRTE_DPAA_DEBUG_BUS
+#define DPAA_BUS_HWWARN(cond, fmt, args...) \
+	do {\
+		if (cond) \
+			DPAA_BUS_LOG(DEBUG, "WARN: " fmt, ##args); \
+	} while (0)
+#define DPAA_BUS_DEBUG(fmt, args...) \
+	DPAA_BUS_LOG(DEBUG, fmt, ## args)
+#else
+#define DPAA_BUS_HWWARN(cond, fmt, args...) do { } while (0)
+#define DPAA_BUS_DEBUG(fmt, args...) do { } while (0)
+#endif
+
+#define DPAA_BUS_INFO(fmt, args...) \
+	DPAA_BUS_LOG(INFO, fmt, ## args)
+#define DPAA_BUS_ERR(fmt, args...) \
+	DPAA_BUS_LOG(ERR, fmt, ## args)
+#define DPAA_BUS_WARN(fmt, args...) \
+	DPAA_BUS_LOG(WARNING, fmt, ## args)
+
+#endif /* _DPAA_LOGS_H_ */