Initially, DPAA2 objects (except ETH and CRYPTO) were defined from VFIO
layer. This patch moves that into Bus definition.
This patch also realigns the object types with the new device types.
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
void *(*rte_mcp_ptr_list);
static uint32_t mcp_id;
static int is_dma_done;
void *(*rte_mcp_ptr_list);
static uint32_t mcp_id;
static int is_dma_done;
-static struct rte_fslmc_object_list fslmc_obj_list =
- TAILQ_HEAD_INITIALIZER(fslmc_obj_list);
+
+static struct rte_dpaa2_object_list dpaa2_obj_list =
+ TAILQ_HEAD_INITIALIZER(dpaa2_obj_list);
/*register a fslmc bus based dpaa2 driver */
void
/*register a fslmc bus based dpaa2 driver */
void
- TAILQ_INSERT_TAIL(&fslmc_obj_list, object, next);
+ TAILQ_INSERT_TAIL(&dpaa2_obj_list, object, next);
}
static int vfio_connect_container(void)
}
static int vfio_connect_container(void)
/* Parse all other objects */
struct rte_dpaa2_object *object;
/* Parse all other objects */
struct rte_dpaa2_object *object;
- TAILQ_FOREACH(object, &fslmc_obj_list, next) {
+ TAILQ_FOREACH(object, &dpaa2_obj_list, next) {
if (!strcmp(object_type, object->name))
if (!strcmp(object_type, object->name))
- object->create(vdev, &device_info,
+ object->create(dev_fd, &device_info,
object_id);
else
continue;
object_id);
else
continue;
struct fslmc_vfio_group *group;
} fslmc_vfio_container;
struct fslmc_vfio_group *group;
} fslmc_vfio_container;
-struct rte_dpaa2_object;
-
-TAILQ_HEAD(rte_fslmc_object_list, rte_dpaa2_object);
-
-typedef int (*rte_fslmc_obj_create_t)(struct fslmc_vfio_device *vdev,
- struct vfio_device_info *obj_info,
- int object_id);
-
-/**
- * A structure describing a DPAA2 driver.
- */
-struct rte_dpaa2_object {
- TAILQ_ENTRY(rte_dpaa2_object) next; /**< Next in list. */
- const char *name; /**< Name of Object. */
- uint16_t object_id; /**< DPAA2 Object ID */
- rte_fslmc_obj_create_t create;
-};
-
int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle,
uint32_t index);
int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle,
uint32_t index);
int fslmc_vfio_process_group(void);
int rte_fslmc_vfio_dmamap(void);
int fslmc_vfio_process_group(void);
int rte_fslmc_vfio_dmamap(void);
-/**
- * Register a DPAA2 MC Object driver.
- *
- * @param mc_object
- * A pointer to a rte_dpaa_object structure describing the mc object
- * to be registered.
- */
-void rte_fslmc_object_register(struct rte_dpaa2_object *object);
-
-/** Helper for DPAA2 object registration */
-#define RTE_PMD_REGISTER_DPAA2_OBJECT(nm, dpaa2_obj) \
-RTE_INIT(dpaa2objinitfn_ ##nm); \
-static void dpaa2objinitfn_ ##nm(void) \
-{\
- (dpaa2_obj).name = RTE_STR(nm);\
- rte_fslmc_object_register(&dpaa2_obj); \
-} \
-RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
-
#endif /* _FSLMC_VFIO_H_ */
#endif /* _FSLMC_VFIO_H_ */
#include <rte_ethdev.h>
#include <fslmc_logs.h>
#include <rte_ethdev.h>
#include <fslmc_logs.h>
#include <mc/fsl_dpbp.h>
#include "portal/dpaa2_hw_pvt.h"
#include "portal/dpaa2_hw_dpio.h"
#include <mc/fsl_dpbp.h>
#include "portal/dpaa2_hw_pvt.h"
#include "portal/dpaa2_hw_dpio.h"
= TAILQ_HEAD_INITIALIZER(dpbp_dev_list); /*!< DPBP device list */
static int
= TAILQ_HEAD_INITIALIZER(dpbp_dev_list); /*!< DPBP device list */
static int
-dpaa2_create_dpbp_device(struct fslmc_vfio_device *vdev __rte_unused,
+dpaa2_create_dpbp_device(int vdev_fd __rte_unused,
struct vfio_device_info *obj_info __rte_unused,
int dpbp_id)
{
struct vfio_device_info *obj_info __rte_unused,
int dpbp_id)
{
}
static struct rte_dpaa2_object rte_dpaa2_dpbp_obj = {
}
static struct rte_dpaa2_object rte_dpaa2_dpbp_obj = {
- .object_id = DPAA2_MC_DPBP_DEVID,
+ .dev_type = DPAA2_BPOOL,
.create = dpaa2_create_dpbp_device,
};
.create = dpaa2_create_dpbp_device,
};
#include <rte_ethdev.h>
#include <fslmc_logs.h>
#include <rte_ethdev.h>
#include <fslmc_logs.h>
#include <mc/fsl_dpci.h>
#include "portal/dpaa2_hw_pvt.h"
#include "portal/dpaa2_hw_dpio.h"
#include <mc/fsl_dpci.h>
#include "portal/dpaa2_hw_pvt.h"
#include "portal/dpaa2_hw_dpio.h"
= TAILQ_HEAD_INITIALIZER(dpci_dev_list); /*!< DPCI device list */
static int
= TAILQ_HEAD_INITIALIZER(dpci_dev_list); /*!< DPCI device list */
static int
-rte_dpaa2_create_dpci_device(struct fslmc_vfio_device *vdev __rte_unused,
+rte_dpaa2_create_dpci_device(int vdev_fd __rte_unused,
struct vfio_device_info *obj_info __rte_unused,
struct vfio_device_info *obj_info __rte_unused,
{
struct dpaa2_dpci_dev *dpci_node;
struct dpci_attr attr;
{
struct dpaa2_dpci_dev *dpci_node;
struct dpci_attr attr;
}
static struct rte_dpaa2_object rte_dpaa2_dpci_obj = {
}
static struct rte_dpaa2_object rte_dpaa2_dpci_obj = {
- .object_id = DPAA2_MC_DPCI_DEVID,
.create = rte_dpaa2_create_dpci_device,
};
.create = rte_dpaa2_create_dpci_device,
};
#include <fslmc_logs.h>
#include <fslmc_vfio.h>
#include <fslmc_logs.h>
#include <fslmc_vfio.h>
#include "dpaa2_hw_pvt.h"
#include "dpaa2_hw_dpio.h"
#include <mc/fsl_dpmng.h>
#include "dpaa2_hw_pvt.h"
#include "dpaa2_hw_dpio.h"
#include <mc/fsl_dpmng.h>
-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)
{
struct vfio_device_info *obj_info,
int object_id)
{
dpio_dev->dpio = NULL;
dpio_dev->hw_id = object_id;
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];
rte_atomic16_init(&dpio_dev->ref_count);
/* Using single portal for all devices */
dpio_dev->mc_portal = rte_mcp_ptr_list[MC_PORTAL_INDEX];
}
static struct rte_dpaa2_object rte_dpaa2_dpio_obj = {
}
static struct rte_dpaa2_object rte_dpaa2_dpio_obj = {
- .object_id = DPAA2_MC_DPIO_DEVID,
.create = dpaa2_create_dpio_device,
};
.create = dpaa2_create_dpio_device,
};
#include <sys/queue.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/queue.h>
#include <stdint.h>
#include <inttypes.h>
#include <rte_debug.h>
#include <rte_interrupts.h>
#include <rte_debug.h>
#include <rte_interrupts.h>
+TAILQ_HEAD(rte_dpaa2_object_list, rte_dpaa2_object);
+
+typedef int (*rte_dpaa2_obj_create_t)(int vdev_fd,
+ struct vfio_device_info *obj_info,
+ int object_id);
+
+/**
+ * A structure describing a DPAA2 object.
+ */
+struct rte_dpaa2_object {
+ TAILQ_ENTRY(rte_dpaa2_object) next; /**< Next in list. */
+ const char *name; /**< Name of Object. */
+ enum rte_dpaa2_dev_type dev_type; /**< Type of device */
+ rte_dpaa2_obj_create_t create;
+};
+
/**
* A structure describing a DPAA2 device.
*/
/**
* A structure describing a DPAA2 device.
*/
+/**
+ * Register a DPAA2 MC Object driver.
+ *
+ * @param mc_object
+ * A pointer to a rte_dpaa_object structure describing the mc object
+ * to be registered.
+ */
+void rte_fslmc_object_register(struct rte_dpaa2_object *object);
+
+/** Helper for DPAA2 object registration */
+#define RTE_PMD_REGISTER_DPAA2_OBJECT(nm, dpaa2_obj) \
+RTE_INIT(dpaa2objinitfn_ ##nm); \
+static void dpaa2objinitfn_ ##nm(void) \
+{\
+ (dpaa2_obj).name = RTE_STR(nm);\
+ rte_fslmc_object_register(&dpaa2_obj); \
+} \
+RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
+
#endif /* _RTE_FSLMC_H_ */
#endif /* _RTE_FSLMC_H_ */
#include <rte_dev.h>
#include <rte_ethdev.h>
#include <rte_dev.h>
#include <rte_ethdev.h>
#include <mc/fsl_dpcon.h>
#include <portal/dpaa2_hw_pvt.h>
#include "dpaa2_eventdev.h"
#include <mc/fsl_dpcon.h>
#include <portal/dpaa2_hw_pvt.h>
#include "dpaa2_eventdev.h"
= TAILQ_HEAD_INITIALIZER(dpcon_dev_list); /*!< DPCON device list */
static int
= TAILQ_HEAD_INITIALIZER(dpcon_dev_list); /*!< DPCON device list */
static int
-rte_dpaa2_create_dpcon_device(struct fslmc_vfio_device *vdev __rte_unused,
+rte_dpaa2_create_dpcon_device(int dev_fd __rte_unused,
struct vfio_device_info *obj_info __rte_unused,
struct vfio_device_info *obj_info __rte_unused,
{
struct dpaa2_dpcon_dev *dpcon_node;
struct dpcon_attr attr;
{
struct dpaa2_dpcon_dev *dpcon_node;
struct dpcon_attr attr;
}
static struct rte_dpaa2_object rte_dpaa2_dpcon_obj = {
}
static struct rte_dpaa2_object rte_dpaa2_dpcon_obj = {
- .object_id = DPAA2_MC_DPCON_DEVID,
.create = rte_dpaa2_create_dpcon_device,
};
.create = rte_dpaa2_create_dpcon_device,
};