drivers: refactor DPAA2 object definition
[dpdk.git] / drivers / bus / fslmc / portal / dpaa2_hw_dpio.c
index 5cf5cfe..da41849 100644 (file)
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 
 #include <fslmc_logs.h>
 #include <fslmc_vfio.h>
+#include <rte_fslmc.h>
 #include "dpaa2_hw_pvt.h"
 #include "dpaa2_hw_dpio.h"
 #include <mc/fsl_dpmng.h>
@@ -429,7 +429,7 @@ dpaa2_affine_qbman_swp_sec(void)
 }
 
 static int
-dpaa2_create_dpio_device(struct fslmc_vfio_device *vdev,
+dpaa2_create_dpio_device(int vdev_fd,
                         struct vfio_device_info *obj_info,
                         int object_id)
 {
@@ -452,7 +452,7 @@ dpaa2_create_dpio_device(struct fslmc_vfio_device *vdev,
 
        dpio_dev->dpio = NULL;
        dpio_dev->hw_id = object_id;
-       dpio_dev->intr_handle.vfio_dev_fd = vdev->fd;
+       dpio_dev->intr_handle.vfio_dev_fd = vdev_fd;
        rte_atomic16_init(&dpio_dev->ref_count);
        /* Using single portal  for all devices */
        dpio_dev->mc_portal = rte_mcp_ptr_list[MC_PORTAL_INDEX];
@@ -470,16 +470,6 @@ dpaa2_create_dpio_device(struct fslmc_vfio_device *vdev,
                                PROT_WRITE | PROT_READ, MAP_SHARED,
                                vfio_dev_fd, reg_info.offset);
 
-       /* Create Mapping for QBMan Cache Enabled area. This is a fix for
-        * SMMU fault for DQRR statshing transaction.
-        */
-       if (vfio_dmamap_mem_region(dpio_dev->qbman_portal_ce_paddr,
-                                  reg_info.offset, reg_info.size)) {
-               PMD_INIT_LOG(ERR, "DMAMAP for Portal CE area failed.\n");
-               rte_free(dpio_dev);
-               return -1;
-       }
-
        reg_info.index = 1;
        if (ioctl(vfio_dev_fd, VFIO_DEVICE_GET_REGION_INFO, &reg_info)) {
                PMD_INIT_LOG(ERR, "vfio: error getting region info\n");
@@ -503,7 +493,7 @@ dpaa2_create_dpio_device(struct fslmc_vfio_device *vdev,
        io_space_count++;
        dpio_dev->index = io_space_count;
        TAILQ_INSERT_TAIL(&dpio_dev_list, dpio_dev, next);
-       PMD_INIT_LOG(DEBUG, "DPAA2: Added [dpio-%d]", object_id);
+       PMD_INIT_LOG(DEBUG, "DPAA2: Added [dpio.%d]", object_id);
 
        return 0;
 }
@@ -540,7 +530,7 @@ fail:
 }
 
 static struct rte_dpaa2_object rte_dpaa2_dpio_obj = {
-       .object_id = DPAA2_MC_DPIO_DEVID,
+       .dev_type = DPAA2_IO,
        .create = dpaa2_create_dpio_device,
 };