[dpdk-dev,22/38] net/dpaa: add NXP DPAA PMD driver skeleton

Message ID 1497591668-3320-23-git-send-email-shreyansh.jain@nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Shreyansh Jain June 16, 2017, 5:40 a.m. UTC
  A skeleton which would be called after bus device scan. It currently
fails to identify the device.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 MAINTAINERS                               |   1 +
 drivers/net/dpaa/Makefile                 |  64 +++++++++
 drivers/net/dpaa/dpaa_ethdev.c            | 222 ++++++++++++++++++++++++++++++
 drivers/net/dpaa/dpaa_ethdev.h            | 128 +++++++++++++++++
 drivers/net/dpaa/rte_pmd_dpaa_version.map |   4 +
 5 files changed, 419 insertions(+)
 create mode 100644 drivers/net/dpaa/Makefile
 create mode 100644 drivers/net/dpaa/dpaa_ethdev.c
 create mode 100644 drivers/net/dpaa/dpaa_ethdev.h
 create mode 100644 drivers/net/dpaa/rte_pmd_dpaa_version.map
  

Comments

Ferruh Yigit June 28, 2017, 3:41 p.m. UTC | #1
On 6/16/2017 6:40 AM, Shreyansh Jain wrote:
> A skeleton which would be called after bus device scan. It currently
> fails to identify the device>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>

<...>

> +
> +/* Initialise a network interface */
> +static int dpaa_eth_dev_init(struct rte_eth_dev *eth_dev __rte_unused)

__rte_unused can be removed

<...>

> +
> +static int
> +rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
> +			   struct rte_dpaa_device *dpaa_dev)
> +{
> +	int diag;
> +	int ret;
> +	struct rte_eth_dev *eth_dev;
> +	char ethdev_name[RTE_ETH_NAME_MAX_LEN];
> +
> +	PMD_INIT_FUNC_TRACE();
> +
> +	if (!is_global_init) {
> +		/* One time load of Qman/Bman drivers */
> +		ret = qman_global_init();
> +		if (ret) {
> +			PMD_DRV_LOG(ERR, "QMAN initialization failed: %d",
> +				    ret);
> +			return ret;
> +		}
> +		ret = bman_global_init();
> +		if (ret) {
> +			PMD_DRV_LOG(ERR, "BMAN initialization failed: %d",
> +				    ret);
> +			return ret;
> +		}
> +
> +		is_global_init = 1;
> +	}
> +
> +	sprintf(ethdev_name, "%s", dpaa_dev->name);

snprintf can be preferred

> +
> +	ret = rte_dpaa_portal_init((void *)1);
> +	if (ret) {
> +		PMD_DRV_LOG(ERR, "Unable to initialize portal");
> +		return ret;
> +	}
> +
> +	eth_dev = rte_eth_dev_allocate(ethdev_name);

If this is done without RTE_PROC_PRIMARY check, this will cause
secondary to memset all device data.

I am adding this because of below check, it multi process support is
intended, this also be protected.

> +	if (eth_dev == NULL)
> +		return -ENOMEM;
> +
> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> +		eth_dev->data->dev_private = rte_zmalloc(
> +						"ethdev private structure",
> +						sizeof(struct dpaa_if),
> +						RTE_CACHE_LINE_SIZE);
> +		if (!eth_dev->data->dev_private) {
> +			PMD_INIT_LOG(CRIT, "Cannot allocate memzone for"
> +				     " private port data\n");
> +			rte_eth_dev_release_port(eth_dev);
> +			return -ENOMEM;
> +		}
> +	}
> +
> +	eth_dev->device = &dpaa_dev->device;
> +	dpaa_dev->eth_dev = eth_dev;

I thought "struct rte_dpaa_device" is bus device, like "struct
rte_pci_device", if so why it has link to the eth_dev?

> +	eth_dev->data->rx_mbuf_alloc_failed = 0;

not required, data already memset via rte_eth_dev_allocate()

> +
> +	/* Invoke PMD device initialization function */
> +	diag = dpaa_eth_dev_init(eth_dev);
> +	if (diag) {
> +		PMD_DRV_LOG(ERR, "Eth dev initialization failed: %d", ret);
> +		return diag;
> +	}
> +
> +	PMD_DRV_LOG(DEBUG, "Eth dev initialized: %d\n", diag);
> +
> +	return 0;
> +}
> +
> +static int
> +rte_dpaa_remove(struct rte_dpaa_device *dpaa_dev)
> +{
> +	struct rte_eth_dev *eth_dev;
> +
> +	PMD_INIT_FUNC_TRACE();
> +
> +	eth_dev = dpaa_dev->eth_dev;

can be:
eth_dev = rte_eth_dev_allocated(dpaa_dev->device.name);

> +
> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
> +		rte_free(eth_dev->data->dev_private);
> +

no pmd uninit() ?

> +	rte_eth_dev_release_port(eth_dev);
> +
> +	return 0;
> +}

<...>
  
Shreyansh Jain June 29, 2017, 2:29 p.m. UTC | #2
Hello Ferruh,

I was almost wondering if this series has been forgotten. Thanks for
the comprehensive review.

My comments inline (and in some other mails):

On Wednesday 28 June 2017 09:11 PM, Ferruh Yigit wrote:
> On 6/16/2017 6:40 AM, Shreyansh Jain wrote:
>> A skeleton which would be called after bus device scan. It currently
>> fails to identify the device>
>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> 
> <...>
> 
>> +
>> +/* Initialise a network interface */
>> +static int dpaa_eth_dev_init(struct rte_eth_dev *eth_dev __rte_unused)
> 
> __rte_unused can be removed

I will correct this.


> 
> <...>
> 
>> +
>> +static int
>> +rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
>> +			   struct rte_dpaa_device *dpaa_dev)
>> +{
>> +	int diag;
>> +	int ret;
>> +	struct rte_eth_dev *eth_dev;
>> +	char ethdev_name[RTE_ETH_NAME_MAX_LEN];
>> +
>> +	PMD_INIT_FUNC_TRACE();
>> +
>> +	if (!is_global_init) {
>> +		/* One time load of Qman/Bman drivers */
>> +		ret = qman_global_init();
>> +		if (ret) {
>> +			PMD_DRV_LOG(ERR, "QMAN initialization failed: %d",
>> +				    ret);
>> +			return ret;
>> +		}
>> +		ret = bman_global_init();
>> +		if (ret) {
>> +			PMD_DRV_LOG(ERR, "BMAN initialization failed: %d",
>> +				    ret);
>> +			return ret;
>> +		}
>> +
>> +		is_global_init = 1;
>> +	}
>> +
>> +	sprintf(ethdev_name, "%s", dpaa_dev->name);
> 
> snprintf can be preferred

Ok. Will fix this.

> 
>> +
>> +	ret = rte_dpaa_portal_init((void *)1);
>> +	if (ret) {
>> +		PMD_DRV_LOG(ERR, "Unable to initialize portal");
>> +		return ret;
>> +	}
>> +
>> +	eth_dev = rte_eth_dev_allocate(ethdev_name);
> 
> If this is done without RTE_PROC_PRIMARY check, this will cause
> secondary to memset all device data.

Agree. I will correct this.

> 
> I am adding this because of below check, it multi process support is
> intended, this also be protected.
> 
>> +	if (eth_dev == NULL)
>> +		return -ENOMEM;
>> +
>> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
>> +		eth_dev->data->dev_private = rte_zmalloc(
>> +						"ethdev private structure",
>> +						sizeof(struct dpaa_if),
>> +						RTE_CACHE_LINE_SIZE);
>> +		if (!eth_dev->data->dev_private) {
>> +			PMD_INIT_LOG(CRIT, "Cannot allocate memzone for"
>> +				     " private port data\n");
>> +			rte_eth_dev_release_port(eth_dev);
>> +			return -ENOMEM;
>> +		}
>> +	}
>> +
>> +	eth_dev->device = &dpaa_dev->device;
>> +	dpaa_dev->eth_dev = eth_dev;
> 
> I thought "struct rte_dpaa_device" is bus device, like "struct
> rte_pci_device", if so why it has link to the eth_dev?

Yes, rte_dpaa_device ~ rte_pci_device.
This is used to extract the eth_dev back while de-initializing
the device.

  driver->remove = rte_dpaa_remove(rte_dpaa_device)
  // fetch rte_eth_dev from rte_dpaa_device
   `-> .eth_dev_stop(eth_dev)

So, essentially reusing the internal eth_ops for cleaning up the
device.

> 
>> +	eth_dev->data->rx_mbuf_alloc_failed = 0;
> 
> not required, data already memset via rte_eth_dev_allocate()

Ok. I will remove this.

> 
>> +
>> +	/* Invoke PMD device initialization function */
>> +	diag = dpaa_eth_dev_init(eth_dev);
>> +	if (diag) {
>> +		PMD_DRV_LOG(ERR, "Eth dev initialization failed: %d", ret);
>> +		return diag;
>> +	}
>> +
>> +	PMD_DRV_LOG(DEBUG, "Eth dev initialized: %d\n", diag);
>> +
>> +	return 0;
>> +}
>> +
>> +static int
>> +rte_dpaa_remove(struct rte_dpaa_device *dpaa_dev)
>> +{
>> +	struct rte_eth_dev *eth_dev;
>> +
>> +	PMD_INIT_FUNC_TRACE();
>> +
>> +	eth_dev = dpaa_dev->eth_dev;
> 
> can be:
> eth_dev = rte_eth_dev_allocated(dpaa_dev->device.name);

Hmm, ok, now I understand why you are inquiring about
eth_dev being assigned in rte_dpaa_device. I will have a
relook at this and fix if required.

> 
>> +
>> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
>> +		rte_free(eth_dev->data->dev_private);
>> +
> 
> no pmd uninit() ?

I will fix this. There is an internal commit that we had very
recently (a miss in previous series).

> 
>> +	rte_eth_dev_release_port(eth_dev);
>> +
>> +	return 0;
>> +}
> 
> <...>
> 
>
  
Shreyansh Jain July 2, 2017, 6:47 a.m. UTC | #3
On Thursday 29 June 2017 07:59 PM, Shreyansh Jain wrote:
> Hello Ferruh,
> 
[...]
> 
>>
>>> +
>>> +    if (rte_eal_process_type() == RTE_PROC_PRIMARY)
>>> +        rte_free(eth_dev->data->dev_private);
>>> +
>>
>> no pmd uninit() ?

Just to clarify, were you asking about uninit of the driver?

There is no such call from within normal flow - that is probably left to the application to perform. (rte_dpaa_driver_unregister)
I just cross checked, this is not being done even for the PCI functions (rte_pci_unregister) - probably because we never see a case (for sample applications) where driver is unregistered.

Am I missing something here?

> 
> I will fix this. There is an internal commit that we had very
> recently (a miss in previous series).

There was some device/queue cleanup which was missing which I have added and will push in the next version. I mixed that up with 'PMD uninit' comment when I was replying to your previous email.

> 
>>

-
Shreyansh
  

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index ec5eb00..02cc4c0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -393,6 +393,7 @@  M: Hemant Agrawal <hemant.agrawal@nxp.com>
 M: Shreyansh Jain <shreyansh.jain@nxp.com>
 F: drivers/bus/dpaa/
 F: drivers/mempool/dpaa/
+F: drivers/net/dpaa/
 F: doc/guides/nics/dpaa.rst
 F: doc/guides/nics/features/dpaa.ini
 
diff --git a/drivers/net/dpaa/Makefile b/drivers/net/dpaa/Makefile
new file mode 100644
index 0000000..8fcde26
--- /dev/null
+++ b/drivers/net/dpaa/Makefile
@@ -0,0 +1,64 @@ 
+#   BSD LICENSE
+#
+#   Copyright 2017 NXP.
+#   All rights reserved.
+#
+#   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 Freescale Semiconductor, Inc 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_SDK_DPAA=$(RTE_SDK)/drivers/net/dpaa
+
+#
+# library name
+#
+LIB = librte_pmd_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_SDK_DPAA)/
+CFLAGS += -I$(RTE_SDK_DPAA)/include
+CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa
+CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/
+CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
+CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal/include
+
+EXPORT_MAP := rte_pmd_dpaa_version.map
+
+LIBABIVER := 1
+
+# Interfaces with DPDK
+SRCS-$(CONFIG_RTE_LIBRTE_DPAA_PMD) += dpaa_ethdev.c
+
+LDLIBS += -lrte_bus_dpaa
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
new file mode 100644
index 0000000..2401058
--- /dev/null
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -0,0 +1,222 @@ 
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright 2016 Freescale Semiconductor, Inc. All rights reserved.
+ *   Copyright 2017 NXP. All rights reserved.
+ *
+ *   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  Freescale Semiconductor, Inc 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_dpaa_bus.h>
+#include <rte_dpaa_logs.h>
+
+#include <dpaa_ethdev.h>
+
+/* Keep track of whether QMAN and BMAN have been globally initialized */
+static int is_global_init;
+
+static int
+dpaa_eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
+{
+	PMD_INIT_FUNC_TRACE();
+
+	return 0;
+}
+
+
+static int dpaa_eth_dev_start(struct rte_eth_dev *dev)
+{
+	PMD_INIT_FUNC_TRACE();
+
+	/* Change tx callback to the real one */
+	dev->tx_pkt_burst = NULL;
+
+	return 0;
+}
+
+static void dpaa_eth_dev_stop(struct rte_eth_dev *dev)
+{
+	dev->tx_pkt_burst = NULL;
+}
+
+static void dpaa_eth_dev_close(struct rte_eth_dev *dev __rte_unused)
+{
+	PMD_INIT_FUNC_TRACE();
+}
+
+static struct eth_dev_ops dpaa_devops = {
+	.dev_configure		  = dpaa_eth_dev_configure,
+	.dev_start		  = dpaa_eth_dev_start,
+	.dev_stop		  = dpaa_eth_dev_stop,
+	.dev_close		  = dpaa_eth_dev_close,
+};
+
+/* Initialise a network interface */
+static int dpaa_eth_dev_init(struct rte_eth_dev *eth_dev __rte_unused)
+{
+	int dev_id;
+	struct rte_dpaa_device *dpaa_device;
+	struct dpaa_if *dpaa_intf;
+
+	PMD_INIT_FUNC_TRACE();
+
+	dpaa_device = DEV_TO_DPAA_DEVICE(eth_dev->device);
+	dev_id = dpaa_device->id.dev_id;
+	dpaa_intf = eth_dev->data->dev_private;
+
+	dpaa_intf->name = dpaa_device->name;
+
+	dpaa_intf->ifid = dev_id;
+
+	eth_dev->dev_ops = &dpaa_devops;
+
+	return -1;
+}
+
+static int
+rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
+			   struct rte_dpaa_device *dpaa_dev)
+{
+	int diag;
+	int ret;
+	struct rte_eth_dev *eth_dev;
+	char ethdev_name[RTE_ETH_NAME_MAX_LEN];
+
+	PMD_INIT_FUNC_TRACE();
+
+	if (!is_global_init) {
+		/* One time load of Qman/Bman drivers */
+		ret = qman_global_init();
+		if (ret) {
+			PMD_DRV_LOG(ERR, "QMAN initialization failed: %d",
+				    ret);
+			return ret;
+		}
+		ret = bman_global_init();
+		if (ret) {
+			PMD_DRV_LOG(ERR, "BMAN initialization failed: %d",
+				    ret);
+			return ret;
+		}
+
+		is_global_init = 1;
+	}
+
+	sprintf(ethdev_name, "%s", dpaa_dev->name);
+
+	ret = rte_dpaa_portal_init((void *)1);
+	if (ret) {
+		PMD_DRV_LOG(ERR, "Unable to initialize portal");
+		return ret;
+	}
+
+	eth_dev = rte_eth_dev_allocate(ethdev_name);
+	if (eth_dev == NULL)
+		return -ENOMEM;
+
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+		eth_dev->data->dev_private = rte_zmalloc(
+						"ethdev private structure",
+						sizeof(struct dpaa_if),
+						RTE_CACHE_LINE_SIZE);
+		if (!eth_dev->data->dev_private) {
+			PMD_INIT_LOG(CRIT, "Cannot allocate memzone for"
+				     " private port data\n");
+			rte_eth_dev_release_port(eth_dev);
+			return -ENOMEM;
+		}
+	}
+
+	eth_dev->device = &dpaa_dev->device;
+	dpaa_dev->eth_dev = eth_dev;
+	eth_dev->data->rx_mbuf_alloc_failed = 0;
+
+	/* Invoke PMD device initialization function */
+	diag = dpaa_eth_dev_init(eth_dev);
+	if (diag) {
+		PMD_DRV_LOG(ERR, "Eth dev initialization failed: %d", ret);
+		return diag;
+	}
+
+	PMD_DRV_LOG(DEBUG, "Eth dev initialized: %d\n", diag);
+
+	return 0;
+}
+
+static int
+rte_dpaa_remove(struct rte_dpaa_device *dpaa_dev)
+{
+	struct rte_eth_dev *eth_dev;
+
+	PMD_INIT_FUNC_TRACE();
+
+	eth_dev = dpaa_dev->eth_dev;
+
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+		rte_free(eth_dev->data->dev_private);
+
+	rte_eth_dev_release_port(eth_dev);
+
+	return 0;
+}
+
+static struct rte_dpaa_driver rte_dpaa_pmd = {
+	.driver_type = FSL_DPAA_ETH,
+	.probe = rte_dpaa_probe,
+	.remove = rte_dpaa_remove,
+};
+
+RTE_PMD_REGISTER_DPAA(net_dpaa, rte_dpaa_pmd);
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
new file mode 100644
index 0000000..8aeaebf
--- /dev/null
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -0,0 +1,128 @@ 
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright (c) 2014-2016 Freescale Semiconductor, Inc. All rights reserved.
+ *   Copyright 2017 NXP. All rights reserved.
+ *
+ *   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  Freescale Semiconductor, Inc 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_ETHDEV_H__
+#define __DPAA_ETHDEV_H__
+
+/* System headers */
+#include <stdbool.h>
+#include <rte_ethdev.h>
+
+#include <rte_dpaa_logs.h>
+
+
+#define DPAA_MBUF_HW_ANNOTATION		64
+#define DPAA_FD_PTA_SIZE		64
+
+#if (DPAA_MBUF_HW_ANNOTATION + DPAA_FD_PTA_SIZE) > RTE_PKTMBUF_HEADROOM
+#error "Annotation requirement is more than RTE_PKTMBUF_HEADROOM"
+#endif
+
+/* we will re-use the HEADROOM for annotation in RX */
+#define DPAA_HW_BUF_RESERVE	0
+#define DPAA_PACKET_LAYOUT_ALIGN	64
+
+/* Alignment to use for cpu-local structs to avoid coherency problems. */
+#define MAX_CACHELINE			64
+
+#define DPAA_MIN_RX_BUF_SIZE 512
+#define DPAA_MAX_RX_PKT_LEN  10240
+
+/* RX queue tail drop threshold
+ * currently considering 32 KB packets.
+ */
+#define CONG_THRESHOLD_RX_Q  (32 * 1024)
+
+/*max mac filter for memac(8) including primary mac addr*/
+#define DPAA_MAX_MAC_FILTER (MEMAC_NUM_OF_PADDRS + 1)
+
+/*Maximum number of slots available in TX ring*/
+#define MAX_TX_RING_SLOTS	8
+
+/* PCD frame queues */
+#define DPAA_PCD_FQID_START		0x400
+#define DPAA_PCD_FQID_MULTIPLIER	0x100
+#define DPAA_DEFAULT_NUM_PCD_QUEUES	1
+
+#define DPAA_IF_TX_PRIORITY		3
+#define DPAA_IF_RX_PRIORITY		4
+#define DPAA_IF_DEBUG_PRIORITY		7
+
+#define DPAA_IF_RX_ANNOTATION_STASH	1
+#define DPAA_IF_RX_DATA_STASH		1
+#define DPAA_IF_RX_CONTEXT_STASH		0
+
+/* Each "debug" FQ is represented by one of these */
+#define DPAA_DEBUG_FQ_RX_ERROR   0
+#define DPAA_DEBUG_FQ_TX_ERROR   1
+
+#define DPAA_TX_CKSUM_OFFLOAD_MASK (             \
+		PKT_TX_IP_CKSUM |                \
+		PKT_TX_TCP_CKSUM |               \
+		PKT_TX_UDP_CKSUM)
+
+
+/* DPAA Frame descriptor macros */
+
+#define DPAA_FD_CMD_FCO			0x80000000
+/**< Frame queue Context Override */
+#define DPAA_FD_CMD_RPD			0x40000000
+/**< Read Prepended Data */
+#define DPAA_FD_CMD_UPD			0x20000000
+/**< Update Prepended Data */
+#define DPAA_FD_CMD_DTC			0x10000000
+/**< Do IP/TCP/UDP Checksum */
+#define DPAA_FD_CMD_DCL4C		0x10000000
+/**< Didn't calculate L4 Checksum */
+#define DPAA_FD_CMD_CFQ			0x00ffffff
+/**< Confirmation Frame Queue */
+
+/* Configuration variables exported from DPAA bus */
+extern struct netcfg_info *dpaa_netcfg;
+
+/* Each network interface is represented by one of these */
+struct dpaa_if {
+	int valid;
+	char *name;
+	const struct fm_eth_port_cfg *cfg;
+	struct qman_fq *rx_queues;
+	struct qman_fq *tx_queues;
+	struct qman_fq debug_queues[2];
+	uint16_t nb_rx_queues;
+	uint16_t nb_tx_queues;
+	uint32_t ifid;
+	struct fman_if *fif;
+	struct pool_info_entry *bp_info;
+	struct rte_eth_fc_conf *fc_conf;
+};
+
+#endif
diff --git a/drivers/net/dpaa/rte_pmd_dpaa_version.map b/drivers/net/dpaa/rte_pmd_dpaa_version.map
new file mode 100644
index 0000000..b6d2840
--- /dev/null
+++ b/drivers/net/dpaa/rte_pmd_dpaa_version.map
@@ -0,0 +1,4 @@ 
+DPDK_17.08 {
+
+	local: *;
+};