net/virtio: add Rx free threshold setting
[dpdk.git] / drivers / bus / dpaa / rte_dpaa_bus.h
index 9601aeb..373aca9 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- *   Copyright 2017 NXP
+ *   Copyright 2017-2019 NXP
  *
  */
 #ifndef __RTE_DPAA_BUS_H__
 #include <rte_mempool.h>
 #include <dpaax_iova_table.h>
 
+#include <dpaa_of.h>
 #include <fsl_usd.h>
 #include <fsl_qman.h>
 #include <fsl_bman.h>
-#include <of.h>
 #include <netcfg.h>
 
 #define DPAA_MEMPOOL_OPS_NAME  "dpaa"
@@ -132,7 +132,23 @@ static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr)
        }
 
        /* If not, Fallback to full memseg list searching */
-       return rte_mem_iova2virt(paddr);
+       va = rte_mem_iova2virt(paddr);
+
+       dpaax_iova_table_update(paddr, va, RTE_CACHE_LINE_SIZE);
+
+       return va;
+}
+
+static inline rte_iova_t
+rte_dpaa_mem_vtop(void *vaddr)
+{
+       const struct rte_memseg *ms;
+
+       ms = rte_mem_virt2memseg(vaddr, NULL);
+       if (ms)
+               return ms->iova + RTE_PTR_DIFF(vaddr, ms->addr);
+
+       return (size_t)NULL;
 }
 
 /**