eal: introduce helper API for IOVA mode

Introducing rte_eal_iova_mode() helper API. This API
used by non-eal library for detecting iova mode.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
This commit is contained in:
Santosh Shukla 2017-10-06 16:33:42 +05:30 committed by Thomas Monjalon
parent 39bef5cb98
commit 93878cf025
5 changed files with 26 additions and 0 deletions

View File

@ -119,6 +119,12 @@ rte_eal_get_configuration(void)
return &rte_config;
}
enum rte_iova_mode
rte_eal_iova_mode(void)
{
return rte_eal_get_configuration()->iova_mode;
}
/* parse a sysfs (or other) file containing one integer value */
int
eal_parse_sysfs_value(const char *filename, unsigned long *val)

View File

@ -243,6 +243,7 @@ DPDK_17.11 {
global:
rte_bus_get_iommu_class;
rte_eal_iova_mode;
rte_pci_get_iommu_class;
rte_pci_match;

View File

@ -45,6 +45,7 @@
#include <rte_per_lcore.h>
#include <rte_config.h>
#include <rte_bus.h>
#ifdef __cplusplus
extern "C" {
@ -87,6 +88,9 @@ struct rte_config {
/** Primary or secondary configuration */
enum rte_proc_type_t process_type;
/** PA or VA mapping mode */
enum rte_iova_mode iova_mode;
/**
* Pointer to memory configuration, which may be shared across multiple
* DPDK instances
@ -287,6 +291,14 @@ static inline int rte_gettid(void)
return RTE_PER_LCORE(_thread_id);
}
/**
* Get the iova mode
*
* @return
* enum rte_iova_mode value.
*/
enum rte_iova_mode rte_eal_iova_mode(void);
/**
* Run function before main() with low priority.
*

View File

@ -128,6 +128,12 @@ rte_eal_get_configuration(void)
return &rte_config;
}
enum rte_iova_mode
rte_eal_iova_mode(void)
{
return rte_eal_get_configuration()->iova_mode;
}
/* parse a sysfs (or other) file containing one integer value */
int
eal_parse_sysfs_value(const char *filename, unsigned long *val)

View File

@ -248,6 +248,7 @@ DPDK_17.11 {
global:
rte_bus_get_iommu_class;
rte_eal_iova_mode;
rte_pci_get_iommu_class;
rte_pci_match;