vfio: export some internal functions
[dpdk.git] / drivers / bus / dpaa / rte_dpaa_bus.h
index d9ade83..89aeac2 100644 (file)
@@ -17,6 +17,8 @@
 
 #define FSL_DPAA_BUS_NAME      "FSL_DPAA_BUS"
 
+#define DPAA_MEMPOOL_OPS_NAME  "dpaa"
+
 #define DEV_TO_DPAA_DEVICE(ptr)        \
                container_of(ptr, struct rte_dpaa_device, device)
 
@@ -31,6 +33,8 @@
 
 extern unsigned int dpaa_svr_family;
 
+extern RTE_DEFINE_PER_LCORE(bool, dpaa_io);
+
 struct rte_dpaa_device;
 struct rte_dpaa_driver;
 
@@ -94,17 +98,7 @@ struct dpaa_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].iova && paddr <
-                       memseg[i].iova + memseg[i].len)
-                       return (uint8_t *)(memseg[i].addr) +
-                              (paddr - memseg[i].iova);
-       }
-
-       return NULL;
+       return rte_mem_iova2virt(paddr);
 }
 
 /**
@@ -155,6 +149,20 @@ static void dpaainitfn_ ##nm(void) \
 } \
 RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
 
+/* Create storage for dqrr entries per lcore */
+#define DPAA_PORTAL_DEQUEUE_DEPTH      16
+struct dpaa_portal_dqrr {
+       void *mbuf[DPAA_PORTAL_DEQUEUE_DEPTH];
+       uint64_t dqrr_held;
+       uint8_t dqrr_size;
+};
+
+RTE_DECLARE_PER_LCORE(struct dpaa_portal_dqrr, held_bufs);
+
+#define DPAA_PER_LCORE_DQRR_SIZE       RTE_PER_LCORE(held_bufs).dqrr_size
+#define DPAA_PER_LCORE_DQRR_HELD       RTE_PER_LCORE(held_bufs).dqrr_held
+#define DPAA_PER_LCORE_DQRR_MBUF(i)    RTE_PER_LCORE(held_bufs).mbuf[i]
+
 #ifdef __cplusplus
 }
 #endif