[3/6] eal: check hugepages within dma mask range
Checks
Commit Message
Hugepages get an iova address which could be out of range
for devices with addressing limitations. This patch checks
hugepages are withint the range if dma mask is set by a device.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
lib/librte_eal/common/eal_private.h | 3 +++
lib/librte_eal/linuxapp/eal/eal.c | 4 ++++
2 files changed, 7 insertions(+)
@@ -224,4 +224,7 @@
*/
struct rte_bus *rte_bus_find_by_device_name(const char *str);
+/* if dma mask set by a device, check hugepages are not out of range */
+int rte_eal_memory_dma_mask_check(void);
+
#endif /* _EAL_PRIVATE_H_ */
@@ -960,6 +960,10 @@ static void rte_eal_init_alert(const char *msg)
return -1;
}
+ /* If dma mask set, check hugepages iovas are within the range */
+ if (rte_eal_memory_dma_mask_check() < 0)
+ rte_panic("iovas out of range\n");
+
/* initialize default service/lcore mappings and start running. Ignore
* -ENOTSUP, as it indicates no service coremask passed to EAL.
*/