[dpdk-dev] [PATCH v1 20/28] eal/soc: map resources conditionally
Jan Viktorin
viktorin at rehivetech.com
Fri May 6 15:48:02 CEST 2016
Signed-off-by: Jan Viktorin <viktorin at rehivetech.com>
---
lib/librte_eal/common/eal_common_soc.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_soc.c b/lib/librte_eal/common/eal_common_soc.c
index af4daa5..d178c48 100644
--- a/lib/librte_eal/common/eal_common_soc.c
+++ b/lib/librte_eal/common/eal_common_soc.c
@@ -119,10 +119,12 @@ rte_eal_soc_probe_one_driver(struct rte_soc_driver *dr,
return 1;
}
- /* map resources */
- ret = rte_eal_soc_map_device(dev);
- if (ret)
- return ret;
+ if (dr->drv_flags & RTE_SOC_DRV_NEED_MAPPING) {
+ /* map resources */
+ ret = rte_eal_soc_map_device(dev);
+ if (ret)
+ return ret;
+ }
dev->driver = dr;
RTE_VERIFY(dr->devinit != NULL);
@@ -173,8 +175,10 @@ rte_eal_soc_detach_dev(struct rte_soc_driver *dr,
/* clear driver structure */
dev->driver = NULL;
- /* unmap resources for devices */
- rte_eal_soc_unmap_device(dev);
+ if (dr->drv_flags & RTE_SOC_DRV_NEED_MAPPING)
+ /* unmap resources for devices */
+ rte_eal_soc_unmap_device(dev);
+
return 0;
}
--
2.8.0
More information about the dev
mailing list