]> git.droids-corp.org - dpdk.git/commitdiff
mem: expose function for physical address use
authorGaetan Rivet <gaetan.rivet@6wind.com>
Thu, 26 Oct 2017 10:05:50 +0000 (12:05 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 26 Oct 2017 21:17:31 +0000 (23:17 +0200)
This function was previously private to the EAL layer.
Other subsystems requires it, such as the PCI bus.

In order not to force other components to include stdbool, which is
incompatible with several NIC drivers, the return type has
been changed from bool to int.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
lib/librte_eal/bsdapp/eal/eal_memory.c
lib/librte_eal/common/eal_private.h
lib/librte_eal/common/include/rte_memory.h
lib/librte_eal/linuxapp/eal/eal_memory.c
lib/librte_eal/rte_eal_version.map

index 3614da8db8c272583ce185696b22a178b3d0fff1..65c96b05eccaafe328723f35d5d78d01f2fb3654 100644 (file)
@@ -192,3 +192,9 @@ error:
                close(fd_hugepage);
        return -1;
 }
+
+int
+rte_eal_using_phys_addrs(void)
+{
+       return 0;
+}
index 9340b6ebd8b9593b4f58bfd3800e73c89c9678f5..80fea24c3d0d159ae4256b70af83e95153687865 100644 (file)
@@ -344,17 +344,6 @@ int rte_eal_hugepage_init(void);
  */
 int rte_eal_hugepage_attach(void);
 
-/**
- * Returns true if the system is able to obtain
- * physical addresses. Return false if using DMA
- * addresses through an IOMMU.
- *
- * Drivers based on uio will not load unless physical
- * addresses are obtainable. It is only possible to get
- * physical addresses when running as a privileged user.
- */
-bool rte_eal_using_phys_addrs(void);
-
 /**
  * Find a bus capable of identifying a device.
  *
index c545963c86fc3fba307d66e1d55c1e5e4ae36586..271d2bb65e34535f51b9c333e2342cc55b8e1a2f 100644 (file)
@@ -187,6 +187,17 @@ unsigned rte_memory_get_nchannel(void);
  */
 unsigned rte_memory_get_nrank(void);
 
+/**
+ * Drivers based on uio will not load unless physical
+ * addresses are obtainable. It is only possible to get
+ * physical addresses when running as a privileged user.
+ *
+ * @return
+ *   1 if the system is able to obtain physical addresses.
+ *   0 if using DMA addresses through an IOMMU.
+ */
+int rte_eal_using_phys_addrs(void);
+
 #ifdef __cplusplus
 }
 #endif
index 187d3389ec817da9d8df4f20272a9d872d1aae91..ddf88c54e96ddb67530d87fc44aa937751997657 100644 (file)
@@ -1494,7 +1494,7 @@ error:
        return -1;
 }
 
-bool
+int
 rte_eal_using_phys_addrs(void)
 {
        return phys_addrs_available;
index 8eb53abdfab21c0b6b6b174d4106ec4f43f80329..bcc594de112ac4f68cd967dea6d50ef32823f15e 100644 (file)
@@ -244,6 +244,7 @@ DPDK_17.11 {
        rte_bus_get_iommu_class;
        rte_eal_iova_mode;
        rte_eal_mbuf_default_mempool_ops;
+       rte_eal_using_phys_addrs;
        rte_lcore_has_role;
        rte_memcpy_ptr;
        rte_pci_get_iommu_class;