mbuf: rename physical address to IOVA
[dpdk.git] / drivers / bus / fslmc / portal / dpaa2_hw_pvt.h
index c88bc9f..c1b842f 100644 (file)
@@ -2,7 +2,7 @@
  *   BSD LICENSE
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright (c) 2016 NXP. All rights reserved.
+ *   Copyright 2016 NXP.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -34,6 +34,8 @@
 #ifndef _DPAA2_HW_PVT_H_
 #define _DPAA2_HW_PVT_H_
 
+#include <rte_eventdev.h>
+
 #include <mc/fsl_mc_sys.h>
 #include <fsl_qbman_portal.h>
 
@@ -49,6 +51,7 @@
 #define SVR_LS1080A             0x87030000
 #define SVR_LS2080A             0x87010000
 #define SVR_LS2088A             0x87090000
+#define SVR_LX2160A             0x87360000
 
 #ifndef ETH_VLAN_HLEN
 #define ETH_VLAN_HLEN   4 /** < Vlan Header Length */
@@ -79,6 +82,8 @@
 #define DPAA2_HW_BUF_RESERVE   0
 #define DPAA2_PACKET_LAYOUT_ALIGN      64 /*changing from 256 */
 
+#define DPAA2_DPCI_MAX_QUEUES 2
+
 struct dpaa2_dpio_dev {
        TAILQ_ENTRY(dpaa2_dpio_dev) next;
                /**< Pointer to Next device instance */
@@ -97,8 +102,11 @@ struct dpaa2_dpio_dev {
        uintptr_t qbman_portal_ci_paddr;
                /**< Physical address of Cache Inhibit Area */
        uintptr_t ci_size; /**< Size of the CI region */
-       int32_t vfio_fd; /**< File descriptor received via VFIO */
+       struct rte_intr_handle intr_handle; /* Interrupt related info */
+       int32_t epoll_fd; /**< File descriptor created for interrupt polling */
        int32_t hw_id; /**< An unique ID of this DPIO device instance */
+       uint64_t dqrr_held;
+       uint8_t dqrr_size;
 };
 
 struct dpaa2_dpbp_dev {
@@ -117,6 +125,14 @@ struct queue_storage_info_t {
        int toggle;
 };
 
+struct dpaa2_queue;
+
+typedef void (dpaa2_queue_cb_dqrr_t)(struct qbman_swp *swp,
+               const struct qbman_fd *fd,
+               const struct qbman_result *dq,
+               struct dpaa2_queue *rxq,
+               struct rte_event *ev);
+
 struct dpaa2_queue {
        struct rte_mempool *mb_pool; /**< mbuf pool to populate RX ring. */
        void *dev;
@@ -131,6 +147,8 @@ struct dpaa2_queue {
                struct queue_storage_info_t *q_storage;
                struct qbman_result *cscn;
        };
+       struct rte_event ev;
+       dpaa2_queue_cb_dqrr_t *cb;
 };
 
 struct swp_active_dqs {
@@ -142,6 +160,16 @@ struct swp_active_dqs {
 
 extern struct swp_active_dqs rte_global_active_dqs_list[NUM_MAX_SWP];
 
+struct dpaa2_dpci_dev {
+       TAILQ_ENTRY(dpaa2_dpci_dev) next;
+               /**< Pointer to Next device instance */
+       struct fsl_mc_io dpci;  /** handle to DPCI portal object */
+       uint16_t token;
+       rte_atomic16_t in_use;
+       uint32_t dpci_id; /*HW ID for DPCI object */
+       struct dpaa2_queue queue[DPAA2_DPCI_MAX_QUEUES];
+};
+
 /*! Global MCP list */
 extern void *(*rte_mcp_ptr_list);
 
@@ -286,7 +314,7 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
  * These routines are called with help of below MACRO's
  */
 
-#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_physaddr)
+#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_iova)
 #define DPAA2_OP_VADDR_TO_IOVA(op) (op->phys_addr)
 
 /**
@@ -342,5 +370,9 @@ void set_swp_active_dqs(uint16_t dpio_index, struct qbman_result *dqs)
 }
 struct dpaa2_dpbp_dev *dpaa2_alloc_dpbp_dev(void);
 void dpaa2_free_dpbp_dev(struct dpaa2_dpbp_dev *dpbp);
+int dpaa2_dpbp_supported(void);
+
+struct dpaa2_dpci_dev *rte_dpaa2_alloc_dpci_dev(void);
+void rte_dpaa2_free_dpci_dev(struct dpaa2_dpci_dev *dpci);
 
 #endif